420 Magazine Background

Arduinos In The Grow Room: My Project

odam2k

Well-Known Member
Finally, I'm getting a lot of coding done on the Web Server to allow me an easier way to configure the system, rather than directly editing the database :(

My "Web Server" is an ESP-01 (Esp8266 module) with 2M of Flash memory. I am constantly amazed at how much I can make this do, given the limited memory, and just how well it works. I didn't write the "server" code, I'm just using the example code for the HTTP Server, but my http module consists of over 8,800 lines of code which I've written. I'll see about gathering up some screen shots when I can. It's nothing fancy, just simple basic hand written HTML code, but it works, and that's the whole point of this entire project.

I could have used my Windows 10 box for my web server, it already runs my MySql Database Server, in fact, I have many years experience writing database intensive web sites, but the thought of running a web server on a postage stamp size module was intriguing. In fact, I have 4 little "servers" running on them, all mounted on a custom programming board,

servers.png
 

odam2k

Well-Known Member
That is SO cool. You are so ahead of me I have a hard time wrapping my head around your ongoing project!

We all start somewhere. I didn't have any real experience with Arduino before I started this project, and I'm still learning new stuff all the time, but that's part of the appeal...
 

odam2k

Well-Known Member
Whenever something happens that I should know about, I have a "Notification" system, which sends those pop up notices to windows, and since I spend "most" of my time in front of the computer, this works great. I do spend some time on the couch, either napping, or watching a tv show, and I can't really see the screen from there. Anyhow, I was playing with a piezo buzzer one day, and figured I could use that to get my attention almost anywhere in the apartment.

1.png


I'm using the 20x4 LCD screen, I only have the one, all the rest are 16x2. This one is easy to use, I'm using an I2C interface module. Notice the hole on my "shield", this is so I can access the DIP switches which I need when I lock up the esp8266 and cannot install software using OTA. This saves me from having to pop the boards apart. I'm also using an RGB LED, perhaps to grab attention visually.

The "This side up" interface, that's a serial connection to the Mega 2560, I prefer this over using the USB connector, since they always end up breaking off. I only use the USB if I have to load software onto the esp8266 when OTA is not working.

The other thing, at the end of the red/black wires, is the buzzer. It has a 20k trimpot to adjust the sound level, and a locking pushbutton so I can turn the buzzer on and off, simply by connecting and disconnecting the ground from the buzzer.
 

odam2k

Well-Known Member
When a module needs to send a "Notification", it ends up looking like this on my PC:

2.png


The text will change, this is still just development... Any module can send a "notification" by filling out the proper fields in a Class created to hold the data structure. This data is sent to the Notification Server, an ESP-01, using the BLYNK WidgetBridge tool to send data directly between modules. The Notification module saves the data to the database, and passes the record id to a windows program using http post. The windows program does the interface to the windows notification system.

An alarm is basically a notification with the ability to be displayed by the Alarm Module as well as the usual notification system. This is accomplished by adding new fields to the Notification Data Class, including a boolean, sendAlarm, which when true, tells the notification server to also send an alarm (write data to the database) so the Alarm Module can read the data, and display the alarm.

3.png
 

odam2k

Well-Known Member
Here's the front of the Alarm Module:

4.png


The switch is for the audible buzzer/alarm, so that it can be silenced. This is prominent so that you can easily see whether alarms are silenced or not. This switch simply enables/disables the ground connection of the piezo buzzer.

Ideally, a simple pushbutton should silence the alarm for the currently displayed alarm only (the one which is sounding the audible alarm) and this would be a software solution, this solution warrants further exploration.


If the sender leaves the first line blank, then the date and time are shown, and the count of alarms, current / total (1/3 = first of three alarms is displayed)
 

odam2k

Well-Known Member
The Alarm Module is working like a charm! The audible alarm isn't very loud, but that's probably a good thing, at least as far as the dog is concerned!

In order to make alarms even more visually "visible", I've created a Warning Light "Disco Ball" sort of thing...

This is just a fun little project...

It consists of 2 RGB LEDs and an Arduino Nano controller. I am using the Nano to expose an I2C connection, so this just hooks up to the Alarm Module, and all the Alarm Module has to do is send a single command to turn on or off the "Disco Ball". This single command tells the light which "pattern" to play, I can code as many different light patterns as I want (maybe even make these user definable?) I've also included a piezo buzzer so I can have it make noise too...

5.png


6.gif



ezgif-7-dd76389afb17.gif


It actually looks a lot better in person :)
 

odam2k

Well-Known Member
Almost time for you to start getting in to CAN bus ;)
You Again! Ha ha… How's it going?

You at least got me to read about it. One of my earliest projects with the Arduino was going to be to interface with the Cars electronics via the OBD Port, but I ended up spending all my time on GBW instead. We did a lot of car camping and touring around, so the idea of interfacing with the car was intriguing

95% of the communications within GBW are via WIFI, there are only a few I2C connections, just a couple sensors, and the Disco Ball :) The main sensors (temp, moisture, etc.) are simple devices without any sort of controller built in, which would be needed for the CAN Bus.

The problem with working on a system for the car is that we live in an apartment, so the car is not sitting just outside the door, or in a nice warm garage... I'd have to sit in the parking lot (in the cold, or heat) and work on it :( I originally figured it was a good task to keep me busy when we went camping :) I have a Bluetooth dongle for the OBD Port, and the car is in line of sight from our balcony... Perhaps I could put some sort of wireless link to it, I have a bunch of those 2.4Ghz NRF24L01 1Km Wireless Modules, that might be a fun little project...
 

odam2k

Well-Known Member
I've had these NRF24L01 modules for a couple years now, and I've played with them maybe a dozen times. There are lots of Instructables and blogs out there with instructions on how to make them work, but for the life of me, I just can't get them to talk to each other. I rewire and rewire, hoping I did something wrong, no go... I even ordered a BUNCH of spares, thinking maybe I was blowing them up somehow, still no go...

I've put them away again... <sigh>

I did do another fun little sidetracked job a couple weeks ago. When you stand at the sink in the kitchen, you block out the light, making it harder to see when doing the dishes. We looked at solutions at the store, and the best deal was about $50. I got bored that night, and pulled out an Arduino Pro Mini, a Motion Sensor module, a Relay, 2 LED strips, and a wall-wart 12v power supply, and voila, a perfect, under cabinet, led strip light, motion activated. Total cost? $0, but if I had to buy the parts, maybe $5 or $6?

It works great, and was a fun little distraction....

Anyhow, back to working on the web pages for updating configuration data.
 

odam2k

Well-Known Member
WooHoo! New computer...

My old ASUS laptop is overheating, the fans are going, for the second time... I didn't want to wait until it was an emergency to set up a whole new computer. I have a lot of development stuff on it, and would rather set it up without rushing, I can take my time this way.

So, I had to shop online, due to the pandemic, and liked the specs for an MSI Prestige 14 Evo. Powerful enough for my programming, etc, and very light weight. I ordered it, and went and picked it up (curbside pickup) and was excited to get it home... I have a 42" TV for my monitor (I use wireless mouse/keyboard) and discovered this new laptop didn't have an HDMI jack! Oh No! Then, on top of that, there was only ONE USB port... my mouse/keyboard dongle goes there, and there's no place to plug in my external drive I use to do backups to every night, plus, there is no ethernet jack, just WiFi.

I worked with computers since the early 1980's, but since I stopped working about 5 years ago I've completely lost touch with what's new, so I had no idea what these ThunderBolt 4 connections were for. I was surprised to see the power cord plugged into one of them. Of course, the 2 page manual that came with the laptop didn't explain anything...

Talk about confused... Well, eventually I figured out I needed some adapters, so ordered a hub, then realized it didn't have the ethernet jack, so I ordered another adapter... I should be good to go tomorrow...

I remember switching from DOS to Windows 3.1 when it came out (I ran a BBS and 3.1 supported networking) I hated it... I would rather type commands than point and click... Talk about being dragged into the present kicking and screaming... That's how I feel now, LOL. I know all these changes are probably for the best in the long run, so i just have to adapt.
 

odam2k

Well-Known Member
The new tent and fan/filter arrived yesterday. The bedroom I use for growing is about 10' X 8.5' so it's gonna be pretty tight with two 4'4' tents, plus some space to work, filling jugs for watering, replanting, etc. I came up with a way to hopefully find the best layout BEFORE I try assembling the new tent. Making sure I would have room to do that was important, it's a real pain with one person. I made a scale drawing, and cut out pieces of paper to use as the tents and tables.

Here is the current room layout with one tent, and a raised area for Veg with the light hanging from the ceiling:

1.png
 

odam2k

Well-Known Member
The new layout will be quite similar, there aren't a lot of alternatives:

2.png


I was able to slide the existing tent over, so the Flower Tent will be on the right when facing the tents, and the veg tent on the left. By sliding the existing tent over, into the corner, and removing the table that was on the opposite wall, there is now lots of room to put the new tent together.

The workbench is simply three shelves of one of those plastic shelving units. Great for storage, and the top shelf is the right heights to user as a workbench with a piece of plywood on it, covered with plastic. I might possibly put this in the closet to use for storage, not sure yet.
 

odam2k

Well-Known Member
What a lot of work! I had to make up a bunch of new wire lengths to go from the Sensor Modules to all the sensors. I could re-use a lot of them, but still a pain. I remember reading a site about automating a commercial scale grow room, and the guy said that you will spend most of your time making cables. It's true, I can attest to that!

The grow room is all set up now, just waiting for the modules to scan the sensors so I can make sure everything is hooked up correctly, then I'm sure I'll need to do some watering... I moved all the Veg plants out to the living room the other day so I could tear down the old veg area to prepare for the new tent. Putting up the tent by myself was as frustrating as I remembered it to be.

Now, with all plants in tents, I don't have to keep that foamboard window box (light baffle) to allow me to run the fan sucking in cooler air in winter (summer time I use an air conditioner).

WindowBoxLightBaffle.png


Also, no more bright light spilling out of the room, having to run down and close the grow room door every time someone knocks on our door. Now, I can leave the window open, and the lights off. Also, with the second fan/filter, there won't be any smell from the grow, they do a fantastic job. I also ordered a replacement filter for the Flower tent, that one is almost 2 years old, which is the stated life of the filters. I have a 6" fan/filter/ducting in the flower tent, but went with a 4" for the Veg tent, since the odor isn't nearly as strong as flower.
 

odam2k

Well-Known Member
Put VERY simply, my soil moisture sensors consist of two metal rods, about 1/2" apart, and when a positive voltage is applied to one rod, the system measures the voltage on the other rod, and calculates the soil moisture percentage from this. The higher the voltage, the lower the resistance, therefore the wetter the soil.

I tried other sensors, but corrosion was a huge problem, running current through them while in wet soil will do that :)

I came up with my current design, and corrosion was ALMOST non existent, the rods seemed to last forever. The initial sensors were constructed with some old leftover pushrods from my days of flying R/C Helicopters. These were big one, 6 foot rotor span, and the nice stainless steel pushrods for the tail rotor were perfect, and I still had quite a few spares. I cut them up and made sensors, and they lasted forever, but eventually I ran out of these nice stainless steel pushrods.

I had to find a new source of rods, and my son in law had a whole pail full of spokes for bicycle wheels. I figured since they sit outside rain or shine, and keep looking good on a bike, they should work for me. Well, I'm starting to find sensors with bad corrosion on both rods, rust just coated on....

So, I'm working on a new process for Grow By Wire, and that is Sensor Inspection scheduling and logging. Each sensor type has a schedule set for doing inspections, say 30 days... The system will give you a list each day of sensors needing to be inspected, and allow you to confirm the inspection via the web interface. Still thinking through the actual workflow, it needs to be unobtrusive, yet easy enough that I'll actually do the inspections, which really just mean pulling the sensor out of the soil, checking for corrosion, maybe loose wires, repair/replace if needed, and stick it back in the soil, then let the system know I inspected it, and let me enter any comments I have, such as the state of the rods.
 

odam2k

Well-Known Member
Two and a half years... I've been working on this project, it seems, forever...

I've simply run out of ideas to implement, or at least ideas I could use :) I recently spent a lot of time on the Web Server, and at this point, most configuration can be done there, I rarely need to use MySql Workbench any more :)

I don't believe for a second that I'm done... There's always lots of code cleanup, documentation, and I'm sure eventually I'll come up with some more ideas for features...


In the mean time, I've started on another little project... With the pandemic, we've been keeping the freezers full and the pantry well stocked. It's a nightmare trying to find anything in the freezers, we have a small chest freezer, and the one on the top of the refrigerator, and have been thinking of adding another chest freezer..

So, FIS was born... Freezer Inventory System. Good excuse to upgrade my old p-touch label maker to a new model that prints barcodes :) I also grabbed a wireless barcode scanner. I've been playing with this for about 4 days now and have it working

We have a small dog that hates clicking noises and beeping, things like the sound of a relay closing, or the beeps from a barcode scanner. Every time I use the scanner (which is a LOT while I'm working on this) it makes the beeps, and she comes running over, cowering at my feet... There is an option to silence the beeps, but it still beeps when it turns on and off , which it does every time I pick it up! I ended up opening up the scanner and de-soldering the buzzer from the circuit board :) I'll put it back in once I finish working on the program and we only use it occasionally..

I am now considering using barcodes for Grow By Wire, just not sure exactly what problems that would solve... I have some ideas, but I haven't put any thought into it yet...
 

odam2k

Well-Known Member
Dang, fighting with powdery mildew....

I suspect it came in through the bedroom window...


I saw it first quite a while ago, and thought I had it under control, it never got worst, just a few white spots... but this last harvest, almost all of my CBD 30:1plants had their buds full of it... My Green Crack seems to fight it off, they were fine...

I emptied the flower tent, and yesterday I sprayed it and the entire room with a bleach solution, and tonight, with 3% Hydrogen Peroxide, and tomorrow, I'll pull the plants from the veg tent, spray em all down with safers 3 in 1, and put em in the flower tent. then sterilize the veg tent... I'll keep 1 Green Crack and 1 CBD 30:1 plant and take clones from them. Once I get going again and have cured the problem, I'll pop some more seeds.
 

odam2k

Well-Known Member
In the summer, I use an air conditioner in the grow room, and it just recycles the air, it doesn't bring in outside air. In the cooler months, I use a 20" Box Fan in the window, and regulate the amount of cold/cool air coming in by sliding the window open or closed. This is where I think the spores came in... As a temporary fix, I went out and bought a furnace filter, and taped it to the fan (the side facing outside) so any air coming in has to pass through the filter, which states that it does filter out mold spores among other things.

I think long term, I'll build a box with slide in furnace filters, with 4" ducting to an inline fan on one side to suck the air through the box, and ducting on the other side to a plate in the window to supply the outside air.... Same fan and ducting as I used in my veg tent... So the fan will suck air in from outside, through the "filter box" and into the room. I could plug it into my "Switch Module" and turn it on and off with a relay based on temperature sensors in the room.

This could also have been the source of my thrip infestation (which thankfully is over). A cloud of them may have been sucked in the window... This will help keep insects out too...
 

odam2k

Well-Known Member
I smoke joints mostly... I use the bong occasionally... Very rarely do I use the vape...

I also cough a lot, especially when smoking. I wheeze when I'm just sitting around....

I do smoke a lot, I smoke almost continuously, unfortunately I don't get very high, but it does do wonders for my various pains.

My wife does a lot of surveys, and they send her stuff, samples... recently, one of those samples was a FIGR Vape Pen (without a filled cartridge). I decided to order a THC cartridge for it, just to try it, what the heck... The cartridge was $38 at the OCS online store. I was impressed with how long it lasted.... I would usually take a couple puffs after smoking a joint, or take it with me when we go out... Anyhow, I decided to check out the possibility of refilling the cartridge, since they didn't sell empty ones for diy refilling. It was still half full when I tried to pry it apart, so I had to be careful not to break it, but I managed... it also goes back together easily, and seems solid enough, I ended up smoking the rest of it...

Well, tonight it ran out, so I would get to test refilling it. Even if I managed to refill the cartridge, would I vape my ISO wash oil?

Let's see!

1.png


Once you pry the plastic top off, there is a rubber gasket, and when removed, it exposes the two holes I used to refill it. I had to heat the oil and pour it into the syringe, and then heat the syringe a bit with my heat gun to make it flow easily enough, but I managed to fill it about half way...

Now the big test, take a hit off it...

It works!

This is so much easier than the bong. I usually smoke it on a bed of ashes in the bong, but that's a pain.

We'll buy a couple more cartridges so we can have one for the CBD oil (got lots of it) and one for THC.

We also ordered two Arizer V-Tower desktop vapes for dry herb, again, one for CBD and one for THC. Since my wife uses the CBD, but not THC, I don't want to cross contaminate them and have her picking up thc resins off the vape. I grow two main strains, Green Crack for THC and CBD 30:1 for CBD. The CBD strain has almost ZERO THC. Cindy never gets high even if she smokes a whole joint.

Hopefully I'll stick to vaping, and my cough will clear up, and I'll quit wheezing... :)
 

odam2k

Well-Known Member
Seems to be lots of good news...

So far, it seems the powdery mildew problem is no longer an issue. I did a very thorough job with spraying the entire room, including walls, floor, ceiling, closet, and the outside and inside of the tents. First day, I used a bleach solution (2tbsp per quart of water) and the second day I sprayed everything with a 3% Hydrogen Peroxide solution (straight from the bottle) Note, I did not spray any plants with the bleach or peroxide, I did use Safers 3 in 1, then let them sit in the dark to dry off. I soaked the tops and bottoms of all the leaves, sprayed the stems, and even the top of the soil.... The plants were ok with this, they never showed any signs of being hurt by the spray.

The vapes are working great. I need to get used to the fact that I don't get a big lungful of dense smoke... I'm still rolling the odd joint, but I'm working on it :) The pen is working great for the oil, I'm on my third reload of the cartridge. I wish I had made a better quality batch of oil, but I had actually planned on cooking with it, not vaping it. Picked up another cartridge, working on emptying it :) They don't sell a CBD cartridge, so I'll smoke the THC that's in it, then clean it out and I'll smoke the first batch of CBD oil in it too, so by the time my wife uses it, she will just get her CBD, and not any THC.

There are a couple reasons she doesn't smoke the THC, first off, she doesn't smoke THC often, so when she does, it really goes to her head, and she usually ends up going to bed. Me, I love to get high (wish I had her low tolerance) but her, not so much. I no longer drive the car, mainly because I ALWAYS have extremely high THC levels in my blood, and I probably smell like burning pot all the time as well. She is always popping out to the store, the pharmacy, etc, driving at a moments notice. Ontario has a really strict law, as a permanent resident (she is American, I am Canadian) if she were to be charged with impaired driving, she could be deported. When pot was legalized, I was worried there would be people, left, right, and center, being charged with having thc in their system while driving, even if they weren't high (like me most of the time, enough THC to get a whale stoned, but my high tolerance leaves me pretty well unaffected. Anyhow, that's why we need a pure CBD strain that she can use any time, she has Fibromyalgia and bad arthritis.
I haven't really heard of any real problems with people being charged with impaired.
 
Top Bottom