What's new

Biodome Jr: Prototype automated/monitored grow space

bonsai

Member
Long story short; I started this project 16 days ago with the goal of keeping my sub-tropical bonsai and orchids alive through semi-alpine winters in a small greenhouse, not to grow MJ. However, any attempt to learn about growing plants in controlled environments quickly leads to wonderful forums such as this one, and I'd be flat out lying if I said I don't love a good creative sativa buzz... So here we are! :gday:

This thread will document the prototype implementation of an automated/monitored grow box I'm building using the Arduino microcontroller platform. I've never developed anything with an Ardino or C++ before, but I'm a software developer 9-5 and so far I'm reasonably confident that a quality (and FREE! Open Source or Bust!) product will come from this that will hopefully be useful for other people's needs.

Biodome Software Overview - It's just Devices & Sensors
- Lights, fans, pumps, heat mats, whatever are treated as "Devices".
- Each Device can be scheduled to be on or off for every hour in a 24 hour period. This schedule is stored in a very simply formatted TXT file on an SDCard for easy adjustments during a monitored grow.
- Every X minutes, all Sensor outputs and Device statuses are logged to a CSV file on the SDCard. I'm going by the Schrödinger's Crop theory; if you open the box to take readings you're changing those readings. Besides, who wouldn't like to easily generate graphs showing the temperature and humidity in your grow space throughout the entirety of a grow.
- Each device can be set to respond to different temperature and/or humidity events, either turning on or off depending on the environment. These sensor-enacted statuses override the scheduled status of the Device.
- Sensor-enacted override events are logged to a separate CSV file to allow the gardener to easily review environmental abnormalities and extremes and adjust the grow space accordingly.
- Plugging a Serial-capable device into the USB port and pressing a button will push a full system status report to the connected device, allowing the gardener to know exactly what's going on without opening the box.
- "Re-entrant" -- the SDCard board has a RealTimeClock chip along with a separate battery to ensure accurate time keeping regardless of power source. If you unplug the box at 9am, drive it somewhere and plug it back in at 10am it knows what time it is and gets straight back to the schedule
- Easily configured for different setups! What's the point of building something like this if I'm the only person who can use it, or if I have to hack the crap outta it when I move it to my greenhouse?! As a brief example, below is the core configuration used in my prototype:

Device Light("Lights", 8);
Device CirculationFan("Circulation Fan", 9);
Device ExhaustFan("Extra Exhaust Fan", 10);
Device Devices[COUNT_DEVICES] = {Light, CirculationFan, ExhaustFan};

TemperatureSensor IntakeTemp("Intake Temp", 1);
TemperatureSensor ExhaustTemp("Exhaust Temp", 1);
SensitronSensor InternalTemp("Internal Temp", 2, 3);
Sensor Sensors[COUNT_SENSORS] = {InternalTemp, IntakeTemp, ExhaustTemp};
...

//---------------------
// DEVICES
//---------------------
// CFL Light Setup
Light.tempMax = 45; // ºC
Light.ignoreHighTemp = false;
Light.thermInvert = true; // turn off when hot

// Circulation fan
CirculationFan.tempMin = 22; // ºC
CirculationFan.tempMax = 30; // ºC
CirculationFan.ignoreLowTemp = false;
CirculationFan.ignoreHighTemp = false;

// Supplimentary exhaust fan
// powers up relative to temps of exhaust air coming out of carbon filter
ExhaustFan.tempMin = 30; // ºC
ExhaustFan.tempMax = 35; // ºC
ExhaustFan.ignoreLowTemp = false;
ExhaustFan.ignoreHighTemp = false;

...

// Lights turn off if grow space gets too hot
temperatureOverride(Light, InternalTemp.read());
// Exhaust fan turns on if exhaust temps get too hot
temperatureOverride(ExhaustFan, ExhaustTemp.read());
// Circulation fan turns on if intake temps are too hot
temperatureOverride(CirculationFan, IntakeTemp.read());

The goal is that anyone who has basic electronics skills and basic experience with any C-based programming language will be able to construct, configure and maintain their own Biodome :dance013:

All of the above features are fully implemented and tested

That's pretty much it for software. It's easily extended to work with other sensors such as pH or moisture sensors, but they're either too expensive or too inaccurate for me to bother with at the moment. Adding the ability to report to a website or even send an SMS is verging on trivial, but again is not something I'll be looking at in the near future. Right now it's all about the primary goals of the system, to help a gardener grow healthy plants.

The entire codebase and circuitry will be released as Open Source once I'm a little more confident in it (hence the reason for this prototype implementation -- to see how it goes in reality).

On to the micro grow box...
- Recycled PC case
- 2-4x 25W CFL lights
- 4 DIY LED panels. 2 panels are primarily red (620-660nm) with some warm white and cool white, 2 panels are primarily blue with some red. LED will be run from constant-current sources, one per panel. Each string of LEDs is running at 18mA rather than the 20mA to avoid cascade failure. If one string on a panel dies, the other strings will only have to dissipate 21mA each.
- 3 temperature sensors: one in the light trap measuring intake air; one in the main grow space; one in the "control room" behind the carbon filter to measure exhaust temperatures.
- 1 humidity sensor in the main grow space

The grow box build is about 50% complete.

Case layout:
picture.php


LED driver board and relay board plans
picture.php

**note: The pic above states the LED panels are running at 12V, it's actually 10.5V due to the drop of the LM317.

Microcontroller, SDCard expansion board, one of the two power supplies, relay board 1/4 complete and a couple of LED panels
picture.php


Two of the LED panels running at about 1/4 power:
picture.php




Well that's it for the (lengthy!) intro. Any questions please ask. I'm really hoping people are willing to offer experienced advice as this thing progresses so that it can be a cheap and useful grow assistant.
 
Last edited:
Beyond Bio-Dome

Beyond Bio-Dome

Is there an app for that? :tiphat:

Layman here. The C++ and all is fine and good but way out of my abilities. Confining myself to small cabs the thought of calling things up on my PC is a long time thought but I have no experience with integrating off-the-shelf hardware or powering the set-ups with drag and drop or push button ease.

I am now at a good stage of growing that would allow me to seriously start adapting my space, yet no know-how and very little, read that as NONE, hard cash to just start throwing money at ideas that I have no clue as to how they really work.


Any chance that you may be able to come up with a 'parts-list' that is plug and play via USB? Any ideas at all for us stoners with a green thumb but can only ... point-and-click?

If i can find the parts at Ace or Radio shack I will work on this as you go along too.



Hey, if you can simplify the 'How to' to the point that grampa could understand it, read THAT as dumb it down for me, then we are on our way to building Pot in a Box(C) for everyman.


I would be happy with some sort of temp-sensor that can be read off USB... even with out controls; active and interactive parameters seam a luxury to me, but if it can be done with off the shelf stuff, lets ROCK! :rtfo:


All my mothers are now Bonsai. Lets hope I do better with them than all the poor little trees that have been sacrificed in my long and sad learning curve...

it takes a village
 

Dojo

Member
I was thinking to myself

"Wouldnt it be great if i could use a laptop to control and regulate my enviroment to optimal performace"

This hit me when i was in home depot and noticed all the motherboards, wam wams and zoo zoos....im glad someone is working on this...this is a very nice ideal...although very technical...i cant wait till you get to the point where you can just dl app and buy the curciuts and stuff then build an automated system
 

bonsai

Member
Looks expensive.
Not as expensive as you might think...

(all prices AUD)
Microcontroller - $30
SDCard expansion board - $20
Relays & LM317 - $20
Temperature sensors - $2
Combined humidity and temp sensor - $30
4 veg & 4 flowering 25W CFLs @ $4 each

Everything else was scrounged for free.

Certainly more than a $10 timer and a $5 thermometer, but while today this is running one lighting setup and 4 sensors, tomorrow it could be running both a flower room and a mother/clone veg room with no extra expense (other than the rooms, obviously). Once this prototype run is complete I'll be moving the system to a larger stacked rubbermaid setup. Other benefits are stealth and potentially less power use. Devices are only powered up when they're absolutely needed for the health of the plants, and simple things like ensuring the grow space cools down and dehumidifies after the lights go out are very simple. I'll still have the primary exhaust fan going at all times to retain negative pressure, but the other fans will only fire up if they're needed.

Emperor Herer said:
Any chance that you may be able to come up with a 'parts-list' that is plug and play via USB? Any ideas at all for us stoners with a green thumb but can only ... point-and-click?

If i can find the parts at Ace or Radio shack I will work on this as you go along too.

First of all, I greatly appreciate your enthusiasm. (and the Mad Max III reference) :)
Plug and Play: Unfortunately no, not at this time at least. There are almost certainly commercial systems that are that simple to start using, but they would likely cost $$$$$. This setup is the best value for money I could come up with, which is why it doesn't include things like $200 pH sensors. For a medium scale hydro grower that might be a perfectly reasonable investment, which is why I've designed the software to be extensible -- support for pretty much any sensor can be added later.

Secondly, it's important for the speed of development that I don't start helping people setup similar systems until this prototype has had a chance to prove itself. At the moment I can make major changes at the drop of a hat and not have it affect anyone, which allows me to hack and slash at both the software and hardware without a second thought. The very second I'm confident this thing isn't going to kill your plants or burn down your house I will start offering to help people setup their own Biodome installs.

Dojo said:
i cant wait till you get to the point where you can just dl app and buy the curciuts and stuff then build an automated system

That's essentially what this is. The only thing that's outside that model is configuring the devices and sensors; ie: telling 'Device A' that it should pay attention to 'Sensor B', etc.
This can be simply overcome and is something I'm already planning. Here's the scenario:
- You buy your arduino and SDCard reader expansion board (adafruit.com)
- You build your relay board (or maybe I'll build some and sell them... they're very simple, but they do need to safely carry MAINS power)
- You download the Arduino programming software for free
- I provide an application that has a graphic interface for defining sensors and controlled devices. You plonk a Device on screen, name it "Exhaust Fan" and tell it what pin number on the Arduino you're going to connect it to. Then you do the same for a Sensor, and draw a line between the two to say that the Exhaust Fan should activate when that Sensor reports certain values.
- The config software then generates the file that the Ardiono programming environment wants. You plug your Arduino into your computer's USB port, open the generated file and press the big "Compile and Upload" button on the Arduino application.

That's the software side done. After that you'll still need a basic knowledge of electronics to wire everything up. But really that bit is more like complicated lego than electronics. Realistically it would be near the end of the year before I'd offer something like the simplistic configuration software described above. It would take more development time than the actual Biodome software.

Biodome is more about Growing with Science, rather than "stick seed in box and come back three months later to harvest". The amount of information and variables an experienced gardener subliminally processes just by looking at a plant and sticking their finger in the soil would be insanely expensive and time consuming to accurately recreate using computers and is not my goal here.
 

HUGE

Active member
Veteran
I am super excited about this. I used to hack satalite cards and this equipment looks similar to the bootloaders we used. I am decent at low voltage and soldering but I have 0 coding knowledge. I would love to help in any way I can or follow along if you write the code. I am really suprized someone hasn't done this yet as I was looking into it awhile ago. I think an iPhone app with this would be fantastic. It would have to be for hacked phones but still cool as shit. Also an alarm interface or flood alerts would be good features. Happy hacking.
 

bonsai

Member
Thanks for the well wishes.
I'll do my best not to take too long on this, however my newborn daughter insists on having my undivided attention when I'm not at work ;)

HUGE: There have been similar smaller projects (google: Garduino), but neither the feature set nor code quality were up to scratch. Getting status reports on any smart phone would be easy using Bluetooth or WiFi; changing the schedule from the phone wouldn't.

When I can afford it I'll grab one of these WiFi expansion boards so that Biodome can connect to my home wifi network and both broadcast status reports locally and more importantly, ping a web server with emergencies so that server can email/sms me.
 
B

BlackThumb

Hello bonsai,

I started a similar project about 9 months ago.
Once I had a working prototype I showed it to the world.
I had so many people ask me to build it the humble little project became a full time job.

Here is the result: www.thrivegardening.com

I do not use the Arduino platform nor the IDE however they are both excellent development / learning tools.

A couple of suggestions for your project:

  1. You may want to consider saving your raw or CSV data to a computer attached to your USB port rather than an SD card. The files get large quickly if your sample rate is high. Once every 5 seconds in my case.
  2. I did a lot of experimenting with wireless in fact my circuit board still has provisions for an XBee radio and my code supports it. I had problems with range in my test garden even with hi-gain antennas. Moving as far as possible from ballasts helped but ultimately I decided to use USB.
(Controller ==> USB ==> Computer ==> Internet)
The snippet of code you posted is really well organized.
Will this ultimately become a library?

I look forward to updates.
Thanks for sharing.

Cheers,
-BT

(Mark Webber Rules!) :gday:
 

bonsai

Member
Thank you for posting BlackThumb, I've not seen your product before but it looks very nice (as does the site and branding, clean). Congratulations on it being successful enough to become your full time gig :good:

Your system is a lot more advanced than what I'm making, but there are clear parallels and points I can learn from. Firstly thank you for reminding me about Pachube; I had read of it a while back but quickly forgot as I don't usually work with sensors.

To address your suggestions:
1) A core requirement of this project is that the controller is 100% standalone and very compact. The original intention was to jam it in a waterproof case in an already over-crowded green house in my back yard. 5 seconds per sample?! Wow. I don't think my humidity sensor (SHT11) would like that, at least if I wanted to keep using the anti-condensation self-heating feature.
My system samples all sensors every X minutes for shcedule checking and environment overrides, and only writes to the log every Y samples. So right now I have it set to check the environment every 5 minutes, but only log once every 3 iterations. 4 CSV rows per hour is no big deal, not with 2GB SDCards. Again this is vastly inferior to the sampling offered by your system but sits well with my bang-for-buck and compact footprint goals.

2) Very good point. There is an arduino wifi shield with an external antenna, but that's not going to do much for avoiding RF hash from switchmode power supplies. Feck. Not a game changer, wifi support was never going to be part of this prototype anyway. At least that gives me some time to bubble over the options.

/**
* Sh!t's about to get nerdy people, fair warning! :yappy:
*/
The guts of the code is already poorly organised into a library and will be released once it's a little more stable. Here's a pastebin posting of the library: http://pastebin.ca/1910552
Please be gentle, as I said I've never written any C or C++ before so I'm unfamiliar with the syntax.
Notes:
  • Direct property access has been favoured over getters/setters to reduce binary footprint. I'm already at 17,000 of 30,000 available bytes on the atmega 328.
  • The Sensor abstract class will be changed to an interface
  • The TMP36 temp sensor implementation in this copy isn't final, as my proper implementation takes multiple samples and averages the result minus the high and low extreme samples.
  • The SensitronSensor implementation is incomplete. There will also be two facade pattern classes to accompany it that will implement the Sensor interface and allow the humidity and temperature sensors in the SHTXX ICs to be addressed separately while sharing a single physical device. This is because my reporting relies upon the Sensor interface to iterate through all sensors, each of which can only have one value output.
  • Some refactoring will happen to move functions from the project into the library as the dust settles. A prime example would be that temperatureOverride() currently lives in the project and takes a Device as the first param; it will likely end up a method of Device
 
B

BlackThumb

bonsai,

Looks like you have done your homework.

I don't want to turn your thread into techno-babble. You are well on your way!

I am looking forward to following your progress.

Cheers,
-BT
 

bonsai

Member
I've cut my losses on the PC micro box and put it aside. It's not worth the time already invested in it, and is too limiting both for grow space and for access to the electronics.

Whipped up this instead:
picture.php


Holds 6 CFL, pics show 4x 25W fitted. Planning 100W veg, 150W+ 4 LED panels for flower.

Still struggling with syntax and compilation errors in a language that is entirely foreign to me, but making progress on the controller none the less.
 

bonsai

Member
Quick update...

The testing grow box is coming along well. It's been running for 30 hours at full light without circulation fans and the temps have only risen by ~2°C so that's "good enough" for now.

The sensors I'll be using for a test are: air temperature, humidity, dew point, soil temperature (just one pot), external temperature, soil moisture (one pot).

For anyone who would like to have a look at the "sketch" (the main program that runs on the microcontroller), I've temporarily hosted the current revision here:

http://pastebin.org/448079

I've made some largish changes to how Devices work, further isolating them from having any knowledge of types of Sensors. The reason for this is that previous a Device had to know about temperature, about humidity, about light levels, about soil moisture, about anything you wanted to have a sensor for. That's bad design.
 

bonsai

Member
FUUUUUUUUUUUUUUUUUUUUUuu

Everything was going great, relay board finished and tested, sensors all working nicely, spreadsheet logging and light/fan scheduling working nicely, box built, lighting/cooling/ventilation setup finished... then I plugged 12V into the wrong breadboard and fried my humidity sensor and two temperature sensors. Literally up in smoke.
I'm going to start asap anyway, as it's winter here and monitoring for excess heat isn't an issue. I'll have to order more sensors from the US, which I totally can't afford atm and will result in a couple weeks wait. CRAP.
 

bonsai

Member
This thing worked great for the first grow. Second SHT11 sensor died after taking a measurement every 5 minutes for 30 days. Bummer.
I'm building a new cab, 130W vertical scrog in a bedside drawer. Will be using this controller and code, along with a soil bed heating system for growing through winter.
 

bonsai

Member
All good Yggdrasil, open source ftw!
I'm in the midst of a complete rewrite of the codebase as a State Machine; it now has four states - sunrise, day, sunset, night - with separate temp targets and tolerances for each along with support for varying levels of cooling and heating to stay within those temp tolerances while using as little power as possible.
I have a friend with a commercial nursery, I will be working with him to install this system to maintain/monitor an environment for hardening off new plants from tissue cultures.

Very excited about getting the Biodome v.2 prototype running as it is already much better, with an LCD readout of internal temp+humidity, gas levels (eg: co2), external temp and control room temp. No more pulling an SD card to get a readout! The majority of sensors and peripherals I'm using for version 2 use the I2C protocol, so it's easier to scale the number of sensors before needing to multiplex I/O on the arduino board.
 

Latest posts

Latest posts

Top