Arduinos In The Grow Room: My Project

I used to get smooth results from my soil moisture sensors, now after I switched to separate arduinos I have bigger variations each time I read it. It is the same sensor. It is a different mega board and different wires, but they were equivalent, bought at the same time. The only thing I can think of is that now it is powered by USB instead of a 9v external power source. I'll have to plug that back in to see if it fixes it. Are your old and new boards powered by the same supply? Are the boards the same voltage?

1757179


vs

1757183
 
Yes, I power all the Mega 2560 boards using 12vdc wall warts. They also have USB plugged in.

I have 16x2 LCD's on them, and find that powered only by USB, the screens were dim, and sometimes unreadable.
I also only power one sensor at a time, from digital pins.
 
There is also an advantage in the Mega can control up to 54 relays.

i2C can do way more. I'm almost completely off of my Mega setup now. Wish I'd known about i2C sooner myself!

Since I'm licensed for 40 plants, plus my 4 recreational, that is more than enough.... I rarely have more than 20 or so going...

40 sure used to sound like a lot to me, then I started cloning... and then I started perpetual... and then...

So one single "Auto Watering Module", stand alone in that nobody tells it what to do, it does it on its own.

Do you use the multiple modules to spread out your point of failure? One ring to rule them all (with a hot standby) is my approach.
 
i2C can do way more. I'm almost completely off of my Mega setup now. Wish I'd known about i2C soon myself!

Do you use the multiple modules to spread out your point of failure? One ring to rule them all (with a hot standby) is my approach.

Whether I call 50 i2c devices, or write 50 digital pins, makes no difference to me... My point was, I personally will never need more than 50 pumps watering my plants, and if I do, it's as simple as spending another $15 for another Wemos Mega. (I actually have 2 spares still)

I like to isolate tasks, keep the web server separate from the sensor modules, etc. Mainly from a software point of view, and as a follow through from when I started, and had major memory constraints on the pro/mini
 
Getting close....

2019/3/26 18:rocker:54 > Plant #48 Auto Water!
2019/3/26 18:rocker:54 > Pump 3.20 Liters of water
2019/3/26 18:rocker:55 > Available Water: 5cm (2.50L)
 
Whether I call 50 i2c devices, or write 50 digital pins, makes no difference to me...

Was more intended for people who come by later and read this thread, I should have clarified that - no offense intended (!).

I like to isolate tasks, keep the web server separate from the sensor modules, etc. Mainly from a software point of view, and as a follow through from when I started, and had major memory constraints on the pro/mini

Most of us (in the most general sense possible) using Arduino's or RaspberryPi's aren't coming close to the processing power of even one of these units with our simple tasks, which is what made me ask. Heck, I even have 2 dedicated ESP8266 wireless environment monitors right now that sit idle > 75% of the day.
 
Was more intended for people who come by later and read this thread, I should have clarified that - no offense intended (!).

None taken... I didn't read it as a personal slight, and if I knew then what I know now, I may have gone that route. My first modules were pretty crude and rather limited. The one big advantage to i2c is wiring, you can wire everything off one set of wires rather than running separate pairs of wire out to every sensor.
 
Gotta make sure there's enough water in the bucket, and send an email if not.... It does this at startup, and each time a plant is about to be watered...

Capture.JPG
 
Into my 6 US Gal bucket (22.7L) I poured 21L of water. The depth, as measured by my yardstick (Meter Stick?) is 330mm, or 33cm. The walls of the bucket are straight, so we can use the depth to know the volume.

33cm divided by 21L = 1.57cm/Liter...

Here's how the module sees it...

Code:
2019/3/27 04:clap:37 > Plant #48 Auto Water!
2019/3/27 04:clap:37 > Pump 3.20 Liters of water
2019/3/27 04:clap:38 > Available Water: 33cm (21.02L)

I'm stunned at the accuracy... it read 0cm in the empty bucket...

In the above example, you see plant #48 needs watering, and it is configured (in the db) to receive 3.2L per watering...

While I do have the option to run the pump based on either volume, or time, I think I will run them based on the volume of water pumped. So I just turn on the pump, and then monitor the water depth, stopping when the water drops the proper amount (1.57cm per Liter required). I'll put a time limit on it as well... Perhaps if you select both a time and volume, the time setting can be used as the MAX time... this allows each plant to be different, which is good...

I really like this, because eventually the system can become smart enough to adjust the required time and/or volume based on the sensor readings to follow...

I wonder if we can get our hardware to harvest the plants when they are done? LOL
 
Woah... had me worried for a minute...

Suddenly, the ultrasonic sensor started reporting the same number over and over no matter what the distance...

Turns out I had added the air/water pump from my DWC Cloner to stir and aerate the water, and those little bubbles of water that keep your clones alive, well, they aren't good for your HC-SR04 Sensor! I have it wrapped in clear heat shrink, but left the barrels open where the sound waves travel...

I removed the air line from the pump for now, I can always use a small air pump and air stone if I need to.

Other than this little hiccup, it's going good...
 
Woah... had me worried for a minute...

Suddenly, the ultrasonic sensor started reporting the same number over and over no matter what the distance...

Other than this little hiccup, it's going good...

Ok, not so good....

I was trying to figure out why the sensor wasn't reporting changing values as the pump was pumping water into a smaller container and didn't realize/notice that the pump was STILL running... I ended up with about 2L of water soaked into the rug that had overflowed from the container :( My worst nightmare....
 
So I told it to pump 2L, which translates to 3cm of water.

I then measured the water and it was actually 1.8L (1800mL)

Given the rounding, since the sensor is reporting whole numbers, that's pretty darn good... It started at 33cm, and stopped pumping when it hit 30cm.

I suppose I can modify the code on the water depth module so it reports cm to one decimal, that would make it more accurate... Maybe not much, 2L would be exactly 3.14cm, might have to go 2 decimal places, but not sure how granular the checks will be... guess there's only one way to find out for sure eh?
 
So this first complete test is done, and a success!

I did not pump water into the plant, I watered it by hand, but I verified all the following steps:

  1. Maintenance Server determined the plant needed watering and added record to db
  2. AutoWater Server verified it had enough water in the bucket to water this plant.
  3. AutoWater Server read that record, and updated it to mark it as being watered.
  4. AutoWater Server calculated the correct change in depth required to pump the correct volume of water as defined for this plant.
  5. AutoWater Server turned on the pump via a relay, and watched the water level until it dropped to the correct level
  6. AutoWater Server turned off the pump via a relay and checks for more plants that need to be watered...
  7. Maintenance Server verifies the plant was watered correctly once the soil moisture sensor is scanned following the watering, if not, email is sent to me
All that's left is to pick the next plant that will need watering, and set up the watering hose to the pot and configure it in the database.

Wow, I'm so happy to be nearly finished with this part....
 
This is taking FAR longer than I ever thought it would just to water some plants... I've been throwing this around for months...

However, I as I near the end, I'm pretty darn happy with it...

Code:
2019/3/27 11:03:23 > Auto Water Plant #48 on Relay #0
2019/3/27 11:03:24 > Pump  2L (31mm) Max Time 120 seconds.
2019/3/27 11:03:24 > Available Water: 21L (323mm)
2019/3/27 11:03:24 > Starting water pump
2019/3/27 11:05:26 > Shutting water pump off

I told it to pump 2L (notice I changed the depth check from cm to mm for better resolution)

Here's what it pumped...
Capture.JPG


Pretty consistent... I'll adjust my "conversion factor", should be able to make it bang on...

Now, why is this even more exciting than I expected?

Now I can log exactly how much water, and exactly when, each plant receives for it's entire life. Ok, so it's not the most exciting thing, but it IS different, and it is pretty cool.

So much more opens up for every step we take...

So now I need to add some of this data to the database so we have it... but I think it's safe to say that Auto Watering is ready for real world testing.
 
So what do you do now for watering? Do you water them all at the same time when one plant in a particular group droops? I have 3 plants flowering together (different strains) and one of them always seems to droop first, which triggers me to water all of them. I look forward to having automatic watering so that each plant gets its own schedule.
 
I water each plant on it's own merit. I generally look in on them a couple times a day, and when I see one looking thirsty, I water it. I look forward to never seeing a thirsty plant when I look in on them :)
 
I water each plant on it's own merit. I generally look in on them a couple times a day, and when I see one looking thirsty, I water it. I look forward to never seeing a thirsty plant when I look in on them :)

That sounds like a full time job :)
 
Interesting how much the "time pumping" fluxuates for the same volume of water. I've been pumping 2L each time, and the amount of water pumped is always 2L, but the time varies from 113 seconds to over 150 seconds. Just shows how inaccurate it would be if we relied on time...

Only problem I've run into in testing, it rebooted once, and sat waiting for a wifi connection. Unfortunately, a pump was running... I was there, watching, and no problem from it... (not like this morning!)

So I added code to loop through pins 22 to 53 and set them HIGH to open any relays that "could" be attached... I have to assume I can't get to the db to load the list of pins in use... I'm ok with hard coding this, it still leaves enough free pins for other uses...

I'll need to watch for other issues like this...
 
Only problem I've run into in testing, it rebooted once, and sat waiting for a wifi connection. Unfortunately, a pump was running... I was there, watching, and no problem from it... (not like this morning!)

This situation is often the one that we spend the most time chasing. It's that remaining 15-20% of code that covers every "what if" scenario to keep your plants alive. Even today I noticed a relay was supposed to be on, showed the led as though it were powered, but the throw wasn't activated. Tapped it a couple times with a good *thud* and the fans sprang to life. Glad it was just the new circulating fan rig I'm testing, but now I'll need voltage monitors on the other side of the relay to make sure it came on? Ugh!

How bad was the flooding? A couple gallons or "ow..."?
 
Back
Top Bottom