Wednesday, April 27, 2016

Shell meet Gorilla Glue, Gorilla Glue meet Shell....

Many packages arrived today, the look on Elon's face was priceless. Every time the next package arrives he jumps up and down with anticipation of what it unlocks next in this build.

I started gluing the magnets to the shell, the ones that ripped off earlier. So far so good.

I also started to dig into the Light Sensor and why it was not working...

So here is what I did.

Steps
  1. Grab voltmeter and check the power and ground. After determining my sensor was 3.3V instead of 5V, I connected a flying wiring to the 3.3V rail on the Arduino Mega.
  2. Check if Sensor is now working.... nope..... Continue the debug
  3. Build a connector wire so that I can clip one probe lead and then using the other probe lead ohm out for connectivity that the data communication lines SCL and SDA are routed to the Mega.
  4. First I started with the wire to the grove shield. I had to desolder and resolder, so I could have had a bad solder joint.  I heard the connectivity line squeal when I touched the two points.Nope... debug continues....
  5. I then opened up the Eagle PCB layout and schematic viewer. To Check how the grove shield is wired.  Schematic PDF is available here
  6. The layout indicated pin 18 and 17 were the SCL/SDA..... hmmm, this seems in terms of Arduino Uno a different board all together.... something is starting to smell fishy. I keep going.
  7. I looked up the SCL/SDA pins on the Arduino Mega board..."Arduino Mega, SDA is pin 20 and SCL is 21" .  see this link for details
  8. I put one probe on the grove shield and the other on the Mega..... no squeal..... this means there is no connectivity.....
  9. Then I looked at the board from a birds eye view (top down) and saw this.
 If you look closely you will see the i2c pins are not connected at all to the prototype shield. So thats why i2c communication is not working. Using some jumper wire. I hooked into the grove shield header and jumped it to the mega prototype board on pin 20 and 21.

Typing "ALPN 1 1", the grow lights kicked on and I could see the light sensitivity jump in the output stream. It no longer was indicating communication timeouts as well.



So... case of the light sensor not working.... Solved. and we press on....

Also in the mail the rock-wool, and our first seeds arrived.  Still missing Temp and Humidity sensor... that one is important along with the humidifier.

I also noticed I placed my ph and EC sensor boards too close for when I add the sensor BNC cable to it... so I will need to dismount them and drill a hole in the cable mgmt box for additional space. Live and learn the next time I build a FC 1.0.


Till next time, Keep Building, Learning and "Growing"

Monday, April 25, 2016

Packages from China are starting to arrive.... The "Kit" has been ordered.

It has been a few days since my last post.The Grove shield arrived and guess what, my gamble on the connector type did not pay off. So.... out comes the pliers to pull off their headers and replaced with the JST headers I had purchased. Once that was done, on went the shield, and further debug and testing commenced.

Elon and I made it to home depot to pick up the remaining supplies. Here is Elon carrying down the foam board for the tub. I traced the outside of the tub, then using a caliper measured the depth of the side. Using one edge of the caliper I scrapped the new inside dimensions out. The fit was perfect. So good that I had to drill a hole just to remove the panel. I will wait to drill the seed holes once the "rock wool" arrives.


I started on the window as my lexan 24x24 window arrived. I cut some cost by not buying a full sheet as the BOM intended.  I placed some magnets on the high bond tape and some on the lexan. When I went to remove the window, the magnet pulled off the shell. Left the mess behind. I did some searching on the internet about good glue for foam and the Gorilla Glue appears to have a good high bond, so I plan to patch this up and replace the magnet once the Gorilla Glue arrives.

 Some more items... the instructions do not comment on the wiring of the LED panels. I used the extra Wago connectors used earlier and spliced the hot, neutral and ground lines together. This made it easier to route the wires to the one AC switched plug meant for the grow lights.


Another modification to the design I made was using the wire shell from the AC cables I noticed they make really good and stiff spacers for the internal fan. This way it should be able to provide better airflow through the chamber. Just screw the long screw through the wire shell and then into the PVC.







 A few more pictures of the shell coming together. I moved the motherboard panel onto the shell wall as well.


















The spray glue arrived today and this will allow me to glue the white plastic cover onto the shell. This should give some more strength to the shell when the window is placed on and off.

We are still missing our temp and humidity sensor... its on its way..... Also we ordered the wet kit and some seeds. We plan to start with lettuce and bell peppers. Lets see how we do....

Again any tips on seed starting would be much appreciated at this point.

Till next time, keep building, learning and "growing"...

Wednesday, April 20, 2016

1/2 inch bolts arrived, you know what that means....

Or maybe you dont. It means that I could finally get to work on the rest of the frame for the grow chamber. Needless to say this was not an easy task. I had to undo almost every bolt a few times to get things to "line" up. When it was all said it done. It looked like this:

I placed the grow lights and tub in the bottom to check the fit.

With the shell on top, its starting to look like a food computer.
A little shout out to MIT media labs as I was watching how to build a food computer inside my food computer.

As you can see Elon really enjoys spending time on the project. Even his pet racoon joined in the fun. Hopefully that will be the only pest to come near this Food Computer.

Elon and I spent some time debugging the motherboard.
I loaded the Arduino up with code, and started checking the voltage around the protoboard. Elon and I thought we were in good shape. If you notice the mistake in the picture above your quick.

Did you see it? 

I will tell you. The red and black wire to the power supply were placed on the wrong terminals. My LED's would not fire when connected, but for some reason my fans continued to work. Remembering back to my college days, LED's only work in one direction and the Fan's working, well that was mistake number two in my late night soldering job of the fan connector. Lesson learned, fixed and we move on.
Debugging the fan and LED's required us to open the USB Serial port monitor in the Arduino development application. Once we loaded the gro-microcontroller ino file, we can see the serial payload streaming out about once a second. The actuators and sensor have acronyms that you can follow in the steps at the end of the MIT media lab motherboard build instructions.

You can enter commands too, this is how I determined that the LED's were not getting the proper voltages. Swapping Red and Black on the power supply, the room lit up!




Next came time with the Raspberry Pi. There are no real instructions past the arduino step. You have just entered into "the code documents itself land".  The arduino is powered by the Raspberry Pi USB port and the RPi communicates with the Arduino over that same wire (/dev/ttyACM0).

The Raspberry Pi image provided by MIT media labs has some quirks to it.
1. It assumes you have connected the Adafruit LCD touch screen board to the Rpi. I did not. Reason being,.... I think $50 is too much when you control this Food Computer via a desktop application over an IP connection. This means that when the image loads, the HDMI output never enters into Xwindows. No biggy. Time to SSH into the Rpi and have a look around.

2. After spending some time looking around, I discovered the gro-daemon.sh and gro-daemon.py. The gro-daemon.sh is the old launch method for the raspberry pi growing REST api and interaction with the arduino. The new method to launch the service is gro-daemon.py. But here is the trick. It is already running. MIT used the "upstart" services to auto launch the python script at start of day. I wasted a few hours trying to figure out this error, only to discover I was launching a second instance of the daemon and it was conflicting for access.


So... figured it out, its already running, that is great. I modified the server-ip.txt with the ip address of the Rpi and began tracking down the gro-ui.


On git hub I found the installer, installed the file and launched the application. Username "plantos", Password "plantos", and I was in.



I noticed the "Window Open" indicator does not appear to be working as I had the switch in my hand while watching the screen. I confirmed it is conveyed over the Arduino... so. sounds like another debug session is in order.


Overall the software is very cool. There are a few plants to pick from, lettuce, strawberries, tomatoes... all of which Elon has said he is excited to try.

We are getting very close here to starting the "Grow". However...... I KNOW NOTHING ABOUT GROWING plants or how to start.

If anyone knows of a Wiki or a good resource let me know, as I need to figure it out before Elon catches wind that Daddy is not the oracle of all knowledge.

Again, its late.... and I should be heading to bed. I am really enjoying this build.

P.S. I chatted with a few people from MIT Media labs, there is some grumblings about the EC and PH sensors in the FC 1.0 version of the Build of Materials. They have been trying other versions from other companies looking for a more reliable source. I wish  I could offer more info or advice here, but I need to do some research as to the importance of EC and PH to plant growing.


Till next time. Keep Building, Learning and "Growing".





Friday, April 15, 2016

On goes the Shell ...

The other night I worked on the shell. Elon and I did some cardboard mock ups. He helped me measure with "stretch" as he calls it from the tv show Handy manny. I heard today he told his preschool teacher about how he and his dad are building a food computer. I must say, these are the types of memories I hope he retains when he is all grown up.
I measured out the dimensions and marked the insulation using a sharpie. I also noted which side was up and down as I didnt want to make a wrong measurement. Which happened once or twice with the cardboard mock ups that Elon and I started with.



 Once the pieces were cut, I mocked them up to check the fit. The next part I would say was pretty difficult given the puny hot glue gun. You really need a glue gun that can squeeze out quickly giving you enough time to place the panels together before the glue cools. I fumbled through it and got to taping the seems with foil tape.
 Once foiled and glued, I spent some time on the motherboard panel. I do not own a hole saw, and didnt want to spend the extra 30-40$ to buy one. So out comes the dremel and the circle cutting jig. You get one shot at it, sometimes my holes were not just right, but they are close enough.


 With the holes cut out, I checked the fit. I used the dremel circle jig on the heater project box as well.

 Next, I mounted the fans and louvers. It turn out I ordered the wrong fans. But hey they sure look cool. Hopefully amazon will correct my mistake soon.


Tomorrow, Elon and I will head to home depot and get some more supplies. I ordered some lexan on amazon that was 24in x 24 in, as this is not a standard size at home depot. To keep the cost lower I decided not to buy the full sheet at 100$ and this will allow me to see the motherboard panel. The 24x24 lexan should be large enough to cover the window area with some magnets that I purchased on ebay.

On another note the wife acceptance factor (WAF) is increasing. I think the whole family will be catching the Food Computer bug shortly.

Still waiting on some important components to arrive.... Grove Shield, Grove Cables, Temperature and Light sensors.

Thursday, April 14, 2016

The smell of solder in the evening ...

Wiring Diagram from the underside of the prototype board
Most of the prototype board materials arrived today. Including the JST 2.0 mm headers. These are close enough to the grove shield headers so I do not expect a problem with them.

After examining the circuit diagrams and digging into the relay logic and connector header pin outs I formed a wiring diagram plan.

Essentially the connectors are laid out in a manner where the DC supply connects into S4 header with a cable. This provides +12V and GND, which must be routed to switching relays. via S1 and S7. So now S1 and S7 are switched +12V and GND. These will now the the "socket" that needs to control the Fan's and the LED's. Both of which take 12V. The Fans and LED's connect to S2 and S8. So... the switch socket needs to be wired to the receptacle that connects to the Fan's and LEDs. This is why you see the blue and yellow lines jumping over from the left column to the middle column. Note, GND is extended to the middle column from the DC supply source on S4.

S5 is intended to connect to the CO2 sensor. So it gets its own isolated signals. It prefers 3.3v and arduino logic ground. In addition it has Rx and Tx pins. These need to be wired in a manner that the Ardunio Rx(pin 12) connects to the CO2 Sensor (Tx pin 7 on the sensor, the yellow wire).

Lastly we need to wire up the 5V logic controls on S3 and S9 that route to the relays which are controlling the Fans and LED's.

After it was all done, this is what I have:

Here is the color legend:
          • White = 12V from S4 DC supply
          • Green = GND from S4 DC supply
          • Blue = 12V relay out
          • Gold = other 12V relay out
          • Black = Arduino GND
          • Red = Used for 5V arduino, and 3.3v arduino (as I lacked another color).
          • Little blue wires = Those are the digital logic pins which I wire wrapped to the prototype board.





I ohm'd out the connections and tested from the top of the board to ensure the pins that should be linked together were indeed connected.... So far so good. Only risk here is the Grove shield arrives and the sensors on order from China dont match the JST 2.0 mm connector.... we will wait and see if my gamble paid off.

Prototype board assembled and connected to Arduino and Pi.


 Once the sensors and grove shield arrive, which should be in the next 2-3 weeks (must be shipped over on a container boat at this rate), final system debug can begin. I plan to walk Elon through all of this, but if he had to wait while I solder this together I would have never gotten it done. He is very excited to grow food in this, and that is why I am spending the time at night to jump this project forward quickly.

Tuesday, April 12, 2016

Mr. Pi and Mr. Arduino decided to stop by....

Today the raspberry pi 2 arrived.  After work I spent a little time, 4 hours, reverse engineering the differences between the MIT released version and changes I would need to either use this with my own monitor or upgrade to the raspberry pi 3. Needless to say, I am not done with this process.....

 

 The next day, the Arduino arrived in the mail. Elon gets so excited when amazon delivers another component. I think that is his favorite part of this build. Delivering me the packages and discovery what secret it unlocks for our build.
Raspberry Pi connected to Arduino Mega

 While waiting for sd card images to write, I spent some time on the power outlet wiring and getting it ready for when my grove jst 2.0 mm connectors arrive to make the cabling for the sensors and arduino mega board. I finished wiring the relays and using some jumper wire connected the inputs to test my AC work. So far so good....


Its getting to about quitting time, but I managed to use the black and decker saw to do some cutting. There was a lot of fitting and adjusting to get the motherboard panel  to bolt correctly.

That is all for tonight, it is a work day.

Sunday, April 10, 2016

And on the third day, there was grinding metal brackets

At the end of the day, Elon and I were able to cut up our metal brackets that attach the PVC main chassis board. I decided not to buy the $100 worth of brackets, and instead buy 2 of them for around $18. To make the most of it, I cut two 6 inch pieces and then two 18 inches from the 48 inch. After than I cut the other 48 inch into two 24 inch pieces. I realized after I cut them, I will need to make another trip to Home Depot for one more 36 inch bracket.

A couple of notes on cutting metal.
1. I do not own a band saw, and the hand file would never had worked. So, I broke out my dremel and a metal cutting blade.
2. Grinding outside when windy and dry, probably not the best idea. However I took precautions and had my hose out and watered the grass around me.
3. Elon and I both were wearing eye protection, and as you can see in the photo, he was standing far away from me, but still watching closely. That is the whole point of this project with him.


After cleaning up my work area, and dealing with a 4.5 year who just wants to go ride his bike instead of grinding metal.... I was able to place the brackets on the main PVC chassis board.


I think it turned out quite well. After dinner I started on the dimensions for the upright board which the "motherboard" will attach to. For the life of me, I dont know why they want to cut a whole for the motherboard to attach onto. Only thing I can think of is it makes servicing the unit easier if you have to take if on and off again. 
Its midnight now, and tomorrow is a work day. This project will need to wait for another day.

Saturday, April 9, 2016

And so it begins.... Elon looks excited!




Elon and I returned home to see our first packages arriving for our Food Computer build.



 We opened the boxes, and got right to work. This was Elon's first time holding a soldering iron. I made sure it was off for this picture.


 We did not have all the components to place on the prototype board but I was able to place all of the arduino headers necessary to pass the signals from the Arduino Mega through to the Groove shield which will come shortly.

Attention spans for this much soldering is something to be desired.... Elon went up for a snack while I finished. When I came up I offered for him to join me on the home depot trip to pick up the material for chassis. He declined, and it turned out, was a good thing. Transporting the 96 inch long insulation and pvc board would not be possible with two cars seats in the back and Elon in one of them.

While I was at home depot I asked them if they would slice up the insulation and the pvc board.





















I followed the recommendation from the  github documentation

However, recommendations on the PVC were not to be found. Luckily while in the store I was able to find a post indicating the PVC dimensions:
Here are the dimensions that I used:
PVC Base Board, 32.875 in x 21.125 in
PVC Motherboard Dock Panel, 31.875 in x 21.375 in
PVC Motherboard Panel, 20.75 in x 15.75 in
 Erroring on larger is better, I asked him to cut 33 x 24 inchs, and then 31 x 24 inch, and lastly two 16 x 24 inch cut outs from the PVC. I had to make a quick decision and now I realize I undersized the motherboard dock panel. perhaps I can get away with a little less on the top.




After Elon went to bed I spent some time on the chassis. I have to say the price listed for the metal work is too much. My plan, create a strong foundation, but use small wood trim to frame out the rest.

You can see I took a printout from eDrawing and then added the dimensions to it. I spent quite a long time double checking my measurements....finally I drilled. So far so good. I am eager to cut the metal trim, but with two kids sleeping I can not do it tonight for risk of the fire alarm potentially going off.