Like many others, last semester's ProjX project started with grandiose plans. Our team, composed mainly of Putzen, decided to build a self-sustaining vertical farm, with algae (spirulina), fish, and edible plants. We wanted the fish to eat the algae, and wanted the fish to fertilize the plants. By doing this, we would sustain all three levels by providing only two inputs, electricity to grow the algae, and water to replace the water consumed by the plants.
Unfortunately, some quick research revealed that it probably was impossible for fish to subsist off of spirulina alone and our plan fell apart. In classic MIT fashion, we had neglected to do any research until after ordering a bunch of parts, so I was stuck with around $200 of various garden parts that I had to get ProjX to reimburse me for.
Because they only provide reimbursements after you demo something at their fair, I had to put something together that vaguely resembled our original idea. I decided to make a small desktop IOT vegetable planter.
I had already ordered grow lights and a peristaltic pump, so I decided to put both of these things in a box that would get bolted to the side of a plastic bin, and get a IOT microcontroller to drive both of them.
I started by CADing a quick model of the enclosure with mockups for the electronics. The grow lights are mounted on the top plate and the bottle on the side is a water reservoir for the pump. The idea is that the pump will draw water out of the reservoir, and push it through a tube with a bunch of small holes poked in it, allowing the water to drip out of the tube.
After the design was done, I started with the electronics. I went ahead and made the enclosure because I was pretty sure that it would all fit inside.
The electronics for this project were also pretty simple. They consisted of a Photon, a wifi connected Arduino-like microcontroller, some drive circuitry for the lights and pump, and a soil moisture sensor. I mainly just had to connect everything so that the microcontroller could control it all.
There was only one slight hiccup in this project, and it was with the drive circuitry. Although the threshold voltage of the large MOSFETs I was using was below the voltage that one of the Photon's digital pins could provide, I still decided to make a janky level shifter using another smaller FET so I could increase Gate-Source voltage of the second FET and make its on resistance smaller. The smaller FET had the same problem, but I figured that it didn't really matter since it only had to provide a very small amount of current for the larger MOSFETs.
The gate of the small MOSFET is driven directly by the Photon's 3.3V GPIO pins. The gate of the larger FET is pulled down by the smaller FET, and pulled up to 14V through a pull up resistor. This setup does mean that the PWM signal from the microcontroller is inverted, but that is easily solved in software.
Two of the MOSFETs drove the red and blue LEDs in the grow lights, and the last one drove the peristaltic pump for the drip irrigation system. I considered adding a flyback diode for the pump motor, but had forgotten to get one from the EDS stockroom. It ended up working fine without it.
After wiring everything and checking that it worked outside of the housing, I put everything in the box along with a buck converter to step down my 14 VDC input from a laptop power brick to 5V for the microcontroller. After attaching it to the side of the planter box and filling it with soil, I plugged it in and it worked!
I wrote a little bit a code that made it turn on and off in the mornings and at night, and run the pump when the moisture level in the soil was too low. Unfortunately, the reading from the one moisture sensor isn't really a good representation of the moisture level of all the soil in the bed, so if I ever decide to update this project in the future I'll want to add more sensors and maybe average the moisture levels they read.
Overall, this was a pretty quick project (I finished it in 2 days) and wasn't super interesting but I kinda wanted my money back and I made something so I figured I would write about it.
And here's a bonus shot of an aluminum MIT Solar Car model that I made as a Cruftmas present for Lisa. It has little pockets on the bottom side with bearings on pins so it can roll around like a real toy car.