Tuesday, September 18, 2012

Gen 2 Electronics

This has been sitting in the draft box for 12 months because the Lexan got destroyed in a storm so I never got to implement the whole system.

A side goal of Gen 2 is to make the electronics a little cleaner and easier to deal with.  So I found some really nice perf board at work and cut a small piece to make a shield for the Arduino.

 Bottom of the board.  Tried to be a clean as possible.  Have a great soldering iron really helps, I used the professional Welder at work.  Compared to the work, I did last time with my fat tipped one this is amazingly clean.
Top of the board, has connectors for 4  2 pin sensors and a 6 pin header for the relay board.

 Last time around I created this crazy sensor stalk.  It had all of the sensors going into a 8 pin header I think.  It was a mess to solder and dealing with placing the sensors in the system was a pain.  This time around each sensor is discrete and has heat shrink  and a crimped two pin connector.

The whole system put together with the Open Squid.  I used an old 4 pin cd-rom audio cable(is a tad bit too long) for the 4 IO lines and a 2 pin jumper for 5V and Ground.

I will need to add the transistor circuit for the 12V fan.  There should be enough to add this to the bottom of the shield.

Tuesday, February 15, 2011

Working with Lexan

Well, after waiting over a year for my 4' x 8' sheet of Lexan that was my "Christmas present," work began on the Germination Station Gen 2. Since Lexan is quite expensive, I scaled the station down to a 2 foot square from the original 4 foot square.

My dad and I trimming a piece of Lexan on the table saw.

We found out pretty quickly that cutting a huge sheet of Lexan on a table saw is not easy. I tried to take into account the width of the blade when making all my measurements but it was hard getting precise cuts because the Lexan would warp and bend as it was being cut. I messed up the roof by 1/2 inch because when I calculated the hypotenuse, I forgot to add 1/4 inch on both ends of the roof where the front and back pieces would meet. In the end, it was a good learning experience. A laser cutter would have been nice :)

I set up a jig in my garage to glue the pieces of Lexan together. The glue wasn't really glue; it was a solvent that kind of melted the pieces together.

The box all glued up and taped.

The finished box
I put a bead of clear water proof silicone on all of the jointing edges. I haven't done a water test yet.

The box is pretty solid, and I am surprised by how much it weighs. I need to put some brackets on the inside for the lights, and I have to figure out how to put a vent in the back so that the box can be cooled.

Tuesday, July 20, 2010

Mixed Feelings

So I started reworking www.mymakespace.org a couple of weeks ago.  It has been laying dormant for awhile and I haven't taken the time to upgrade to the latest version of BuddyPress.  In the meantime, a couple of really cool addons have reached a good level of maturity so I decided to implement them.  This leaves only one big feature missing, a Help Wanted section.  The update broke my translation and some of the color scheme but that's ok for now.

Back in February, My Make Space had become fairly stable, but very raw.  I had posted my pcb design and had gotten some feedback, but barely any traffic.  So since I am a noob php programmer, I decided to solicit help from a couple of my favorite hack/make sites.  I sent emails to Dale Dougherty at Make(I had some nominal contact with him about a Make Ning group a couple years ago), Hack-a-day and Chris Anderson at Wired.  I didn't expect anything to come of these emails but I figured I would give it a shot.

So the owner of Hackaday made an interesting post last week on the 12th.  The jist was the he really wanted Hackaday to expand its mission statement.
Quote:  "Expand the mission statement to something along the lines of “hack everything” (or maybe “hack anything” sounds more ambitious/fun?). Perhaps best said is: “hack everything, and inspire and help others to do that same.”"

This is not 100% like what I envisioned for mymakespace but it is really close especially the quote/slogan that I had on the welcome page: "Hacking Anything for Everyone".

On Saturday, I got an very interesting Blog post in my RSS feed.  Basically it was Make Magazine announcing that they are going to be starting a "Projects" section to the site.  They currently have a projects section but it is just posts about internal projects. 

Quote: "The new Make: Projects platform will be a place where we, Maker Media, can post our step-by-step projects, and a place where you, the maker community, can too (and we can all add to and improve each other's content)."

This is basically what I have been laying out of the last 3-4 years.  You can still find a post I created in 2007 on the make forums.  I know this is not an unique idea and probably multiple people have thought of this simultaneously.(heck if it can happen with Calculus).  I am really glad this is avenue is available but it is frustrating because this idea has been a passion for me over the last 5 years.  I know that I haven't put as much work into it as possible but it does seem like it has been poached to some extent.  Well now I can get on with my hardware/garden hacks:)

Sunday, January 24, 2010

Open Squid is Released!!!

Well, right before Christmas, I ordered another set of PCB's.  I seriously messed up on my first attempt, so I made sure that the second time around, the board was laid out correctly.

The whole idea came from the Squid Relay from Liquidware.  I created the first version which worked but was messy and kind of dangerous.

Here are some pics of the PCB:

Just the PCB.  I added some text and mounting holes.  More on that later.

Board fully assembled with cables attached.

Got a couple Power Strip Savers from Jameco.

Fully assembled Open Squid with cables attached.

I wanted to add some helpful features to the Squid, so I added mounting holes that will allow you to mount the Arduino above the Open Squid.  One of the guys at work helped me find some standoffs.
Here are a couple of pics:

I didn't realize that one of the mounting holes was smaller than the other ones.  I couldn't find a standoff that would fit that one, but even with only two standoffs, it is very stable.

I really want to sell this as a kit (minus the cables).  How much would you guys pay for this?  $25?  All of the files are available on my other project Mymakespace in the Open Relay Squid project.

Please give me your feedback.

Wednesday, August 26, 2009

PCBs are here!!!!

I ordered a single PCB like 3 weeks ago, and it finally came today.  BatchPCB threw in an extra one, for which I am very grateful, because I am probably going to mess up one board trying to put on the surface mount parts.

I ordered all the parts last week, and they came on Saturday.

Here are some pics:
Once I build the boards and test them out, I will post the results.

Monday, August 03, 2009

Germination Station 2.0 Timeline

After being somewhat disorganized with Germination Station 1.0, I am making a better attempt to plan out future steps to address the problems that I ran into the first time around.

Step 1:
Currently, I am working on a pyQT Gui so that I can communicate and view the sensor data better.  It took a while to figure out how to communicate asynchronously with the Arduino.  I found an example of  an asynchronous I/O program, and I added a pyserial read.  Right now, I am reading the serial data and displaying it in a text box.  I am messing around with graphing the data, but that is proving to be more difficult.

Step 2:
The next stage will be to develop a serial protocol on the Arduino that I can use to read all the sensors and change parameters.

Step 3: 
Test new relay board circuit.  Spin PCB design and order prototypes.  It would be great to turn this into a little kit.  I am going to look into the cost of the BOM and what kind of markup is feasible.

Step 4:
I want to get one variable working from top(gui) to bottom(sensor and variable control).
I plan on growing some blueberries, and I might create a little sub-project that will just water the plants in pots on the deck.  That would just deal with moisture and pump control. (I would need to look into some cheap pumps/values.)

Step 5:
Integrate Fire, Wind, and Earth variables one at a time.

I  am looking at a hard plastic for the roof so that I can fix some of the water run off issues, but the current quote that I have is pretty steep ($109 for a 4'x8'x 0.125" lexan.).  I might try to put that off for as long as possible, but I think that having a hard roof is going to be a necessity.

I have not decided if I am going to implement Xbee on this version.  Just the Xbee units would be about $40, and it could cost more if I decide not to use the Xbee arduino adapter boards that I already have.  They might have been the reason that the last Xbee units got toasted.

Friday, July 17, 2009

Germination Station Part II

Electronics and Arduino Programming
I had fun naming my control variables. Earth = temperature of the soil, wind = temperature of the air, water = moisture, and fire = light.
The sensor stalk
I needed a way to connect all the sensors into the Arduino. I made my own shield and used a motherboard firewire cable. I used the heating pad (earth) from the previous project, a hair dryer, and a 12 DC fan (wind) and the two fluorescent lights (fire).
Finding the right layout was kind of a pain using a cheap board from radio shack (not so cheap).
Firewire cable had just the right amount of wires.
Three sensors: two thermistors and a photocell. This is the first version. The original plan was to be able to differentiate between daylight (higher) and the artificial lights (lower), but the photocell would get saturated and keep rising. I had to put an extension on it so that it was above the lights. I did not implement the water sensor because I did not have a pump.
Testing out the fan circuit. Used a TIP120.
Sensor Stalk header: I/O for the open squid, 2 pins for the the 12VDC, and 2 pins for the fan.
A little bit fuzzy, but everything hooked up.
The goal of the Fire (light) control was to turn on the lights at 6am and then turn the lights off when the sensor (sunlight) reached a specific point. The lights would turn on again if the sensor value dropped below the determined value and stay on until 8pm. As summer approached, the light would be used less and less.
I used the DateTime library. Syncing up the time with a pc and adjusting for a timezone were a pain.
I got the fire variable to work sporadically, but it never worked longer than a period of a couple days.
The lights are on!!! Having to haul my work laptop onto the porch did not help with debugging, especially when it is all software. I have really old Arduinos that still require the manual reset so that did not help either. I have not gotten around to modding them.

Here is a little clip from testing the photocell circuit. I sound ridiculous. That is Noelle's beautiful thumb at the end.

I used the FrequencyTimer2 library. Something wasn't running 100% correctly because the calculated overflow did not come out right, and I had to tweak it until it was approximately 1ms. I created an earth and wind PWM timer based off of the 1 ms tick. The wind period was 100sec, and the earth period was10sec broken into 100 increments with a divisor. This strategy needs to be evaluated because I was constantly troubleshooting the timers to see if they were correct.

Earth was almost the exact same algorithm that I used with the original PID controller. I cleaned up some of the calculations and added a larger range to the thermistor formula for both thermistors. The PID function producted a value from 0-100, which was used as the duty cycle of the earth PWM.

Wind was a bit more complicated. I designed the algorithm to turn off the hairdryer and turn on the 12VDC fan. The wind PID algorithm was allowed to go negative. The negative state would mean that the station had gotten too hot, and the fan needed to turn on. I think I got this working right at the end of the project, but I figured out that the fan did not have the CFM to cool down the germination station as the days got warmer. My original idea was to have one fan and a large heat sink with a film heater attached. I think that would have been a little neater, but the control algorithm would have been a little more complex.

In the end, I did not feel confident enough to leave some plants in the germination station. Whenever it rained hard, the plastic concaved a little and caught some water. I did not frame out the entire base of the station so the water leaked back inside. Thank goodness nothing got fried!

Here is some analysis of what problems I ran into and what I can do better next time. If anyone has additional input, I would be grateful.

Scope - I really wanted to have a GUI and a solid communications protocol so that I could read the data live. I hacked together a serial protocol, but it was not robust enough, and the fact that I had to sit outside on the deck did not help the whole development process.

One of the interesting philosophies that my boss has mentioned when developing our products (embedded systems) at work is to take a single slice of the project and make it work top to bottom. One of my goals going forward is to get a single element working (i.e. thermistor) and have it communicating with my new laptop (birthday present!!!!) with a pyQT UI. If I can get that to work, then I can slowly add the other variables.

I am going to have to adjust the Frame structure so that it is more stable. I plan on getting a sheet of lexan for the room. I would like to make the whole structure out of lexan but that might be cost prohibitive.

I have some really good ideas for the water sensor and pump. I am currently trying to figure out what method would be the cheapest and easiest to control (ac pump vs. dc pump).

The end game of this project is to have a system that will transmit the control data to a web server so that the station can be monitored remotely. Tweaking the PID values online would be kind of neat, but I don't think that is necessary.

Next post, whenever I get around to it, will be about the raised bed and garden that Noelle and I created this summer.

Germination Station Part I

I have been working on this project all spring, and I am finally getting around to posting about it.  Unfortunately, it did not turn out to be as successful as I would have liked it to be.  A couple of  years ago, I created a PID controller that controlled the soil temperature of a Biodome.  Now that we own a home, I was hoping to be able to add a bunch of other variables.  The variables were the following: soil temperature, air temperature, light, and moisture.  I also wanted to have Xbee units to relay the information back to a Webserver so that I could view the system's status from the web.

The  Xbee idea had to be postponed because 1 of my Xbee units got toasted.  As a result, I had to be tethered to the project via a USB cable, and that caused some technical and logistical problems.  I still got a lot done, but in the end, the entire system did not work.
The Structure:
The base: I wanted to see how much of the deck it took up.
The side supports. I will expand upon my rationale for this shape later.
I attached two fluorescent lights as part of the support structure. They were also the most costly part of the project.
Additional supports and hinges so that I would be able to easily lift the cover.
Cover attached to the base
You can see that I did not line up the cross supports. The whole structure was not as stable as I wanted it to be, which may have been responsible for water flow issues.
Plastic covering
I took a 4" by 4' PVC pipe and cut it in half(horribly) and glued it together. Attaching it to the structure was very precarious, and I will need to think this out better the next time around. The pipe was to funnel water into the trash can. The plastic that was connected to the "roof" of the pipe was very leaky, so it did not work as efficiently as it could have.
Electrical Systems
Wiring the Lights
I took a basic extension cord and cut the end off, then wired the lights in parallel together.
Electronics (Arduino and Open Squid)
I planned on using the Arduino again. I had an extra one on hand, but I didn't need to use it for the system. It was useful for debugging basic code at lunch, though.
Open Squid
I needed to control multiple AC devices (hair dryer, heating pad, and lights).  Last time, I hacked a digital AC timer.  That would have been a little too costly this time.  I found the relay squid by Liquidware, but it was a little out of my price range, and I figured I could build one cheaper.
Got these from Mouser.  Really cheap.  Just cut the ends off of them.  Time for some soldering!!!
I spent a good 2 hours working on the circuit in the top left corner, and it just would not work.  I found out that the relays that I had picked could be driven with just the output current of the Arduino. (After examining the Atmega and relay documentation, the relays should have blown out the IO on the board, but for some reason that did not happen)  I am working on redesigning the circuit now.
I wired the ground and neutral straight through to all the plugs and switched the hot.
Soldering the AC lines on the board was tedious. I am surprised it all worked.  I put some hot glue down to protect the connections and keep everything in place.
All done! Time to get it in the box (project box from radio shack).
Everything hooked up to the Open Squid.
I have created a schematic in Eagle with the correct transistor switching circuit.  I have laid out the PCB, but I want to do some testing of the circuit before I ordered the PCBs.  All the schematics and gerbers will be available after I do a system test.
Next time, I will go into the Sensor Stalk and the Arduino program and the problems that I ran into while working on this project.