Arduinos In The Grow Room: My Project

Quick update, the new "Module" prototype is complete, at least hardware wise I think.

Each "Module" supports 16 analog sensors plus about 50 digital. The code has been updated to support Relays on the digital pins, along with some coding to allow you to assign a sensor to a relay and use it to drive it. For example, I put a humidity dome on my DWV Cloner (I know, everyone says DON'T) because the humidity has been so low, about 20-25%. Of course, with the dome, the humidity under it was 100%, too much... I cut a small hole in the dome, and mounted a muffin fan, like you find in a PC. The fan comes on when the humidity reaches a certain level, and goes off when it falls below a certain level. So far, it';s working great, although it moves so much air it doesn't stay on. I may try to find a smaller fan for it.


Here are the new design modules, so much neater!

NewModules.jpg


And the back, with the Analog and Digital ports...

NewModules_2.jpg


and finally, the Humidity Dome with the muffin fan...

HumidityDome.jpg
 
I'm still playing around with Soil Moisture Probes, I haven't found a difference in quality of readings between the premade ones I bought online, and the ones I made myself using nails. I have found that simply wrapping the wire around the nail and soldering it was not sufficient, I was always having problems with the nails falling off, the probes quit working, and I had to dig for the nails...

So, new idea... As an avid R/C flier, I'm used to soldering bullet connectors on wire, and thought I'd give that a try, so I lopped the heads off the nails, and drilled a hole in the end, which I could then solder the wire securely into...

As they say, a picture is worth a thousand words, so rather than ramble on....

DIY_SoilProbe.png


I cheated and used the "frame" from the commercial probes, but can easily make my own if this idea works as well as it looks like it will...
 
@odam2k take a look at the HiGrow (ESP32) for a cost-effective Temp/RH/Moisture monitor: US $10.22 22% OFF|higrow ESP32 Rev1 WiFi & Bluetooth Battery & DHT11 Soil temperature and humidity sensor module-in Circuits from Consumer Electronics on Aliexpress.com | Alibaba Group

@Skybound and I have worked quite a bit on controller and monitor software, his original ideas sparked a flurry of code and refinement. All Arduino based currently, utilizing ESP8266, ESP32, and ATMega2560's. Features include programmable relays (via scheduling), climate monitoring (temp thresholds, etc.), and feeding.

There's even a custom PCB in the works, I'm still working with suppliers to get the production cost down for the DIY crowd. Here's a picture (3d rendering) of one of the early prototype boards based on the ATMega2560 and ESP8266:


test-render.png


I'll be lurking and watching your progress with great curiosity and interest - wishing you success!
 
@Latitude17 Thanks for the link, I had not seen that before. I DO like the idea of wireless, sure would save a big bundle of wires to manage... I have about 20 pots going at one time (up to 40 max per my license) so I'm not sure keeping track of batteries and charging would be much fun. I'd also worry about splashing on them etc. I did just receive a couple of the capacitive sensors as was suggested earlier, but have not had a chance to check them out yet. I'm sure that's the way to go but you can't beat the price of a chunk of wire and a couple nails :)

My plan is to continue using off the shelf arduinos, with custom "shields" for all the connections. I love the Wemos Mega 2560 with the on board ESP8266, it's more powerful than my first computer was! I just ordered 4 more, two backups for the two working modules, one for development, and another just because they were only $13CDN each :) Those plastic enclosures I used for the first 2 modules each cost more than that!

I saw a post somewhere from a guy who was putting multiple analog sensors on a single analog pin, and powering them each individually (from a digital pin, like I'm doing) so he powers up one sensor, reads it, then powers up a different sensor, reads it... He has a diode in the line going to the analog pin so the voltage doesn't flow back out through the other probes... kinda nifty idea, I might give it a try. I did order, and have received, a couple 8 channel analog multiplexer modules from Banggood, but haven't played with those yet either... sheesh, I've been so busy with software, I need to take a break and play with some hardware for a while :)

Tonight I'm playing with an idea, since I have a light sensor (LDR) I'm going to turn off my LCD Screen backlight, and prevent the LED (RGB) from flashing, when the lights are off on the flower space. I have a switch to turn off the backlight, but the leds are pretty bright, so I've been draping a towel over the front of the module just before lights out... Not a huge deal, but a nifty feature :) I'll probably reserve a pin for an LDR on each module...

@Growca2268 glad to have you here!
 
Tonight I'm playing with an idea, since I have a light sensor (LDR) I'm going to turn off my LCD Screen backlight, and prevent the LED (RGB) from flashing, when the lights are off on the flower space. I have a switch to turn off the backlight, but the leds are pretty bright, so I've been draping a towel over the front of the module just before lights out... Not a huge deal, but a nifty feature :) I'll probably reserve a pin for an LDR on each module...

Works like a charm (on my dev board, outside the grow room), AND I added a PIR motion sensor, so if I move around, the LCD Screen and LED come back on till the motion stops... Have to see how practical that is with an oscillating fan blowing the plants around...
 
I have about 20 pots going at one time (up to 40 max per my license) so I'm not sure keeping track of batteries and charging would be much fun.

It's not fun. :cool:

I only use those particular units on "control" plants to get an estimation of the temp/rh/moisture conditions. The 18650 battery will run non-stop for about 22 hours, but what I do is take full advantage of the powerdown/sleep features where it wakes up every 15 minutes, takes a reading, then goes to sleep. Doing this allows me to use an exponentially smaller amount of energy. I also use a small solar panel that trickle-charges the battery during lights on (why let that light go to waste, after all!). Most definitely overkill, but it's part of the hobby that keeps it interesting for the engineer in me. Admittedly the HiGrow was more of a novelty for me and the non-coated capacitive moisture sensor needs to be cleaned regularly. While I still use them, I have moved on to other sensors.

You might consider the i2C protocol with your I/O requirements if you haven't already, it will really simplify things quite a bit. Sure, it's a bit more complicated that just writing on/off for a digital port, but it opens up so much more flexibility!
 
It's not fun. :cool:
You might consider the i2C protocol with your I/O requirements if you haven't already, it will really simplify things quite a bit. Sure, it's a bit more complicated that just writing on/off for a digital port, but it opens up so much more flexibility!

While I've figured out how to hook up I2C devices, that's about the extent of my experience with it.

Are you talking about communicating with the sensors? What advantages would this offer over simply doing analog reads, and using digital pins for power? I'm curious, it's more of a hardware thing right? I'm a software guy, not a hardware guy :)
 
While I've figured out how to hook up I2C devices, that's about the extent of my experience with it.

Are you talking about communicating with the sensors? What advantages would this offer over simply doing analog reads, and using digital pins for power? I'm curious, it's more of a hardware thing right? I'm a software guy, not a hardware guy :)

I2C - learn.sparkfun.com Will give you a better explanation than I could in a reply :)

Basically you get to use a single two-wire setup for up to (theoretically) 128 devices per channel (it's more complicated than that, but I'm trying to stay at the 50,000ft overview level). For system expandability and management, it quickly outpaces analog reading capability - especially when you need to account for sensor read delays, etc.
 
I actually read that link earlier today when I was working on another project where I have 3 i2c devices hooked up to a Nano. (See below)

While I understand it, it seems like building an i2c interface, say for a soil moisture sensor, is a large undertaking, never mind then needing to write control software... It would make sense if I were using sensors that already come with an i2c interface, right? I'm definitely open to suggestions, but while I find the software side a breeze, having been a programmer for nearly 40 years, I am sorely lacking in hardware knowledge, I still have to look up resistor codes on my phone :)

I needed a break from the grow system, so...

Tonights project was a "sleep study" module... I use a CPAP machine at night, and occasionally have to go for a sleep study, and I hate them, so I picked up one of those blood oximetry modules, and a barometric sensor module. I mounted the barometric sensor inside my CPAP mask, and strap the oximetry module to my finger, and log the data to a microSD card, with a RTC for timestamps... Got it working, but not reliably... Strangely, when everything is hooked up, the RTC only gives me a valid time, with the default date from 2000. The SD module is SPI, the rest i2c. The barometric sensor is actually a 10dof gy-88 module, but with everything hooked up, the accelerometer doesn't work, so I can't log movement... at the moment. I'm hoping I'll figure it out eventually, I usually manage...
 
As I sort of suspected... There is an overlap in addresses used by these devices.

Depending on the device's datasheet, the manufacturer sometimes allows the addresses to be reprogrammed. Happy to help if you can provide a link to the datasheet of the conflicting hardware.
 
This is the RTC module:
RTC& EEPROM Module DS3231 AT24C32
EEPROM Datasheet https://www.elecrow.com/download/24C32.pdf
CLOCK datasheet https://www.elecrow.com/download/DS3231.pdf

MAX30100 datasheet https://datasheets.maximintegrated.com/en/ds/MAX30100.pdf

GY-88
MPU-6050 datasheet https://www.haoyuelectronics.com/Attachment/GY-88/MPU-6000A.pdf
HMC5883L datasheet https://www.haoyuelectronics.com/Attachment/GY-88/HMC5883L.pdf
BMP085 datasheet https://www.haoyuelectronics.com/Attachment/GY-88/BMP085.pdf


While I can live without the clock for this project, it may not be so easy to do so on future projects...

Appreciate your help...
 
RTC Only
Found address: 87 (0x57)
Found address: 104 (0x68)

MAX30100 Only
Found address: 87 (0x57)

The 0x57 appears to be for the RTC's (24C32) eeprom, and not the actual clock function at 0x68. Since neither of those can be reprogrammed, you can go the easiest route and get a different RTC without the eeprom (like a DS1307 or Adafruit's DS3231 w/o eeprom) since you need to use the MAX30100.
 
Electronics Technician here, Bravo - what a project. I just came across your post, I'm overwhelmed with just having a decent "grow", so many things to learn, but Man you are enjoying yourself, very impressive thanks for sharing.
 
Electronics Technician here, Bravo - what a project. I just came across your post, I'm overwhelmed with just having a decent "grow", so many things to learn, but Man you are enjoying yourself, very impressive thanks for sharing.

Thanks for checking it out... I must admit, the project scope has certainly changed since I started. I have no idea now where it will end :)
 
I thought I'd take a moment and share some thoughts on this project.

When I started, I was nearly a complete beginner to Arduinos, c++, electronics... I did have a nearly 40 year career as a software engineer behind me, and that helped A LOT! :) Unfortunately, my diabetes was causing me some health problems, and at the same time, my back started giving me hell... Then, to top it all off, tragedy struck Dec 23, 5 years ago, and I lost my Mother and Brother to Carbon Monoxide poisoning during a winter ice storm. I was a basketcase and couldn't work any more, my mind wouldn't work, I couldn't remember how to do my job... The pain in my back grew worse, the doctors just prescribed more meds, starting with Tylenol 3, then Nerve Block injections, a BuTrans patch, then Fentanyl patch, Tramadol, Morphine, and finally hydromorphone, in increasing doses... I became a zombie, literally... I couldn't complete a sentence, couldn't follow a simple tv show, certainly couldn't program, barely able to use my computer at all... After a close call with suicide, I spent 3 days in the psych ward where the "doctor" told me it was the pot I was smoking, interfering with the other drugs... So I stopped smoking pot, and it nearly happened again... So I started smoking again... When I told the doctor at the pain clinic what happened, he INSTANTLY changed his demeanor, and told me there was nothing more he could do for me, and we were done. Very strange... Anyhow, my doctor referred me to another pain clinic, and when I arrived expecting my fix, er, a prescription for my pharma meds, I was told they don't prescribe narcotics... Huh, a pain clinic that doesn't prescribe narcotics? Then he asked me the question... have you ever considered medical marijuana? OMG yes!

It took me 4 years to come through all that, but for the past year and a half, I've been opiate free. I also quit a number of other drugs which were doing me way more harm than good...

I got back into the Arduino (which I've had sitting around for lots of years, just never used them) because I ran across an "instructable" on how to build your own Carbon Monoxide detector... I thought, how fitting, this must be a sign.... So I ordered a couple sensors, and for the life of me, it didn't work... Half the battle was in my mind, the other half with the sensor... I worked with the author of the instructable, and we couldn't figure out why it didn't work. I even swapped sensors, same thing... Turns out both sensors were bad, and I ordered a couple more from another site, and they worked just fine :)

Because I had set up my workspace in the spare room, along with my grow, I could only work during the 12 hours light cycle, which I prefer during the day, so it worked out well. As I wrapped up the CO project, I ran across a few articles about sensing soil moisture with home made probes, and that got me going...

So, I learned about voltage dividers, capacitors, transistors, Bluetooth, WiFi, LCDs, wow, the list goes on... I read on one automation site that the most work was the cables... No kidding, seems I'm ALWAYS making up cables. So my mind is constantly working in overdrive, and my fine motor skills are being tested with all the soldering etc. All of this is leading to my recovery, at least in some aspects. I used to have the shakes so bad I couldn't hold a drink, or carry a plate... Now, I barely shake at all. I can sit at the computer for 16 hours straight and not lose my concentration...

So, this project, while it's stated goal is to Automate the Grow Room, it's true purpose is to help me feel, hmm, ANYTHING.... useful, excited, challenged, successful.... As a therapy tool, it can't be beat :)

I still have severe anxiety issues, and rarely leave the house, but while this project doesn't help with that, it does provide a comfortable place to spend my time... :)
 
I've been cleaning up code, mostly optimizing the communication between the Mega 2560 and the on-board ESP8266. They are directly connected via a hardware serial port, so timing is important, otherwise it works great. I chose to send XML packets back and forth just to help with the data framing, and to make it super easy to parse out any kind of data. As an example, upon bootup, the ESP8266 is busy connecting to the WiFi network, and the MySQL Server, and the Mega 2560 has to wait for this to happen before it can ask the ESP to load it's configuration data. So when it boots, it waits for a status packet from the ESP to say we're connected...

I'm tossing around a new idea... using two sets of sensors in a pot, one about an inch off the bottom, and the other about an inch under the top of the soil. Since each is powered on only when taking a reading, they won't interfere with each other, and I could share a common ground so it's still only 3 wire.... I've got about 50M of servo wire coming :) With this setup, I could build it right into the pot somehow, and have a much better idea of the plants water needs... Of course, this will need some significant database, and coding changes, but I think it might be worth it....


This mornings immediate project, fix my noisy Weller WESD51 soldering station. It's been a faithful tool for quite a few years, but last year it started making a loud buzzing noise. Google led me to tightening the bolts holding the transformer in place, and that solved it, for a while... Eventually the buzzing grew louder, became more annoying.... So this morning I smothered it in epoxy resin.... (just the transformer) to see if that will keep it from rattling.... I hope so, I don't think I could go back to a cheap iron and I'm in no position to replace this one...
 
I'm tossing around a new idea... using two sets of sensors in a pot, one about an inch off the bottom, and the other about an inch under the top of the soil. Since each is powered on only when taking a reading, they won't interfere with each other, and I could share a common ground so it's still only 3 wire.... I've got about 50M of servo wire coming :) With this setup, I could build it right into the pot somehow, and have a much better idea of the plants water needs... Of course, this will need some significant database, and coding changes, but I think it might be worth it....

Would love to see what you come up with on this one, as I've hit a creative wall myself.
 
Back
Top Bottom