Offering Electrical / Control Circuit / Programming Help

Welcome and pleased to meet you. We share similar interests. What are you programming? I am currently working on a project involving a Raspberry Pi and several ESP8266-12Es. Have you been down that road?
I've messed around with the various R-pis since they first came out, and I've done some esp stuff too. I can flail around in other languages, but I spend most of my time in C and C++.

What is your project? I've wanted to do a modular automated grow system for a while. ESPs came to mind, but wifi can be sketchy.

Another thing I did out in Cali was fertigation and pH control system for large agricultural irrigation systems. We used the signal from a pH sensor as an input to a PID loop on a motor controller that drove a pump that pumped acid into huge irrigation lines. Farming is nuts.
 
Last edited:

Timezone

Well-Known Member
What is your project? I've wanted to do a modular automated grow system for a while.
I have an automated grow system that started on an Arduino Uno (sensors controlling relays) and has evolved in to 2 separate sensor boxes, 1 for soil farmers and 1 for hydro farmers, controlling ancillary equipment plugged into home made smart switches (true 15A smart switches). So far I've built controls for a humidifier and dehumidifier, air heater, air conditioner, CO2, Exhaust fan, H2O chiller, H2O heater, and lights. I'm currently working on sending the data to the Pi by way of the ESPs, logging the data in a dbase and plotting the data on a display.

I had thought I'd write up a dyi here but I don't know what the level of expertise (in electronics) is here... so far there's you and me.

Here's the soil growers sensor box minus the 7 soil moisture sensors
P4090204.JPG

and here's one of the smart switches. The outlets are individually controlled.


P3160177.JPG
 
Last edited:
Hell yeah, bro. That's sweet. Have you been running into any issues with the esp modules or are you happy with them?

How are you sending the data between the pi and esp modules? I just started taking some signalR tutorials. Pretty awesome stuff.

I lost my 3rd light controller the other day so I did a stoned home depot session (my favorite) and decided instead of buying another consumer-grade switch I'd make a badass station that does anything I want.

I got as far as the attached pictures last night. Everything is rated for at least 15 amps. Excuse the wiring, I banged it out quickly and didn't think I'd be showing it off online. The orbit controller was an attempt to keep things simple until I cooked something up with microprocessors, but then when I fired it up I found out I can only switch at intervals of 240 minutes... So now I gotta whip something up quick. Tonight I'll pull out a pi and an sx1509, which will drive 8 relays that switch 24 volts to control the 20 amp relay modules up at the top of the box.

Once I have that all set up I can start getting crazy with wired and wireless sensor nodes. I'll use the orbit controller in my back yard I guess.
 

Attachments

Last edited:

Timezone

Well-Known Member
Have you been running into any issues with the esp modules or are you happy with them?
So far I've had no problems with the esps. Before this attempt, I tried the 433mhz transmitter/receiver combination but found that setup to be buggy, with outside interference causing things to turn on or off randomly.

How are you sending the data between the pi and esp modules?
I'm using (learning to use) Node-Red and MQTT to publish messages between the sensors, the PI and the smart switches over a LAN.

I lost my 3rd light controller the other day so I did a stoned home depot session (my favorite) and decided instead of buying another consumer-grade switch I'd make a badass station that does anything I want.
With 36 outlets, I have to ask a few questions like what lights are you running? Or is your grow that large? And what is the power source input (120V@15A)? What else will you be adding to this controller?

I am interested in that CO2 sensor. If you have anything written up on your setup I'd like to see it.
I looked at several CO2 sensors before picking this one:

https://www.dfrobot.com/product-1549.html

It is well supported and can be put to use with an Arduino Uno (~$10), a relay and some wire:

https://www.dfrobot.com/wiki/index.php/Gravity:_Analog_Infrared_CO2_Sensor_For_Arduino_SKU:_SEN0219

I haven't written anything up yet because I haven't completed the project. I want to make sure I can make it work before explaining to someone else how to do it. I had thought that I could post about how to hook up some of these sensors to an Arduino and relays to make things happen but that would require one to install the Arduino onto one's computer and then there's the programming and... well it becomes complicated for me to explain.

I think you should look at an Arduino Mega to control relays in your control box. It is easily programmed and has 54 digital input/output pins (of which 14 can be used as PWM outputs) and 16 analog inputs... and they're inexpensive, for example:

https://www.amazon.com/Elegoo-EL-CB-003-ATmega2560-ATMEGA16U2-Arduino/dp/B01H4ZLZLQ/ref=asc_df_B01H4ZLZLQ/?tag=hyprod-20&linkCode=df0&hvadid=309743296044&hvpos=1o2&hvnetw=g&hvrand=10129370420382070672&hvpone=&hvptwo=&hvqmt=&hvdev=c&hvdvcmdl=&hvlocint=&hvlocphy=9008393&hvtargid=pla-490931309987&psc=1

Maybe we can help each other with our respective projects and if anyone else is interested, let me know.
 
"With 36 outlets, I have to ask a few questions like what lights are you running? Or is your grow that large? And what is the power source input (120V@15A)? What else will you be adding to this controller?"

Hahaha... fair enough. Those strips were 2 for 8 bucks and rated for 15 amps. It was just a super simple and cheap solution. I'll throw my veg tent lights and fans on one strip, my flower tent lights and fans on another strip, and I'll have two switched strips ready to go for hyrdro pumps or whatever I get into after the setup grows.

Just a cheap convenient UL listed receptacle with a built in pilot light, honestly. Otherwise I'm buying boxes, covers, outlets, Romex - or thhn and conduit.... I know it looks stupid, but it was cheap and effective. I'll definitely never be looking for a plug again. Works for my basement.

I currently have two 400 watt lights in a 4x8 and a 4x4 with two platinum LEDs ( 300s I think) in my veg tent. Those light setups fluctuate, and knowing me, the operation will get more elaborate. Just wanted room for expansion.

A mega would definitely be a good solution, and I appreciate the recommendation. I have a closet full of Arduino products, but I picture this box with a pi as a central connecting point / webserver / starting point for a modular system that I could host a flashy web interface on. Anything that connects to it will be cheap microprocessors.

I love arduino, but I love teensys more. Paul at PJRC is the man, and has contributed so much to the open source community that I try to give them as much money as I can. The teensy 3.6 is sick.

I am very willing to help out however I can, feel free to shoot me a message if you are facing any specific challenges. I'll take notes as I work and publish a blog on here. Please keep me posted on what you get into, and I'll do the same.
 
Last edited:
And what is the power source input (120V@15A)? What else will you be adding to this controller?"

I have some #8 awg SO cord and a 2 pole 40 amp breaker in my basement from another piece of equipment that I'm no longer using. That's way more than I'll need. Everything downstream from that will be protected at 15 amps.

Main panel -> 40 amp 2-pole -> perhaps a twistlock plug -> #8 4 conductor SO cord -> my distribution / control panel.
 

Kage87

Active Member
315w draw led
100w draw led
50w draw led
600w hps dig ball.
16in ocs. Fan
Small tower fan
2x clip on fans
Seedling heater mat
6 inch exhaust fan
4inch exhaust fan
Plus 2 60w bulbs in the room itself

All running off 15amp breaker..am I ok..been about a year no problems..but got to thi king lately
 

Kage87

Active Member
I did a quick google for the average power consumption of the devices you listed without a wattage, and made a simple google spread sheet that anyone should be able to download and plug their own stuff into it.

A branch circuit should technically be capable of delivering it's full rating, but when I size something I keep it below 80% of the rated value.

https://docs.google.com/spreadsheets/d/1rdVPQM2gIrbP4KF3k7x6Xddhfm7hV3hE-3CEwM9usns/edit?usp=sharing
That's awesome bro ...considering nothing is ever really running all together I think I'm alright...I'll be moving soon and j plan on adding more and having a dedicated panel
 
I'm pretty good at PCB design, I'd like to build my own pH dosatron someday.
My programming is still old school though, I am quite comfortable with plain machine language and old PIC processors.
That's on my list.

The pH management stuff I did in the past was very large scale, but lessons I took home were calibrate often, clean the water loop often, and if you use cheap sensors, buy a few extras.

The atlas pH sensor kit looks like the real deal, but it's pricey.
https://www.sparkfun.com/products/10972

I do a fair amount of motor controls. If I was going to build a doser I'd get some stepper motor peristaltic pumps for super accurate dosing. That's because I am a nerd though. You'd be totally fine just running a dc peristaltic pump for a few seconds at a time.

Stay in touch. A friend that PCBs is a friend indeed.
 

Axion42

Well-Known Member
IMG_20190411_070738_01.jpg IMG_20190411_070730_01.jpg
That's on my list.

The pH management stuff I did in the past was very large scale, but lessons I took home were calibrate often, clean the water loop often, and if you use cheap sensors, buy a few extras.

The atlas pH sensor kit looks like the real deal, but it's pricey.
https://www.sparkfun.com/products/10972

I do a fair amount of motor controls. If I was going to build a doser I'd get some stepper motor peristaltic pumps for super accurate dosing. That's because I am a nerd though. You'd be totally fine just running a dc peristaltic pump for a few seconds at a time.

Stay in touch. A friend that PCBs is a friend indeed.
I know this isn't as fun as building and coding your own but this has been on clearance for a few weeks now to anyone interested
https://m.liveaquaria.com/product/prod_display.cfm?c=747+6780+4699&pcatid=4699

I know the picture shows an ORP controller but that's incorrect, I called to verify before I purchased. All you need are a couple dosing pumps and a box and you're set.
 

ANC

Well-Known Member
That's on my list.

The pH management stuff I did in the past was very large scale, but lessons I took home were calibrate often, clean the water loop often, and if you use cheap sensors, buy a few extras.

The atlas pH sensor kit looks like the real deal, but it's pricey.
https://www.sparkfun.com/products/10972

I do a fair amount of motor controls. If I was going to build a doser I'd get some stepper motor peristaltic pumps for super accurate dosing. That's because I am a nerd though. You'd be totally fine just running a dc peristaltic pump for a few seconds at a time.

Stay in touch. A friend that PCBs is a friend indeed.
I was thinking of maybe using an existing unit's probe, and just adapt the software to the observed curve.
 
Top