DIY environmental controller

420weedgardner

Active Member
So instead of buying one of course I'd rather do my own and I stumbled across this guy named kyle who did a system was curious if anybody else has seen and made one similar to this if so how'd it turn out for you? https://kylegabriel.com/projects/2020/06/automated-hydroponic-system-build.html#more-1971 is the link for the setup it's a long read so if your not a reader watch his youtube video. I did price check for everything looking at roughly $1500 usd for everything but it tracks (I think controls some if not all of that listed) EC, ph, air temp, RH, water temp, Vpd, co2, and power consumption. Was wondering if anybody has something similar or better or if you got something easier/cheaper to do that you can still get data from please share.
 

Jesusgrowsmygrass

Well-Known Member
I use myCodo and like it. It does everything you need and more. If you want to step up to another level, that would be home assistant or openhab and it allows you to control your entire house.
 

420weedgardner

Active Member
I use myCodo and like it. It does everything you need and more. If you want to step up to another level, that would be home assistant or openhab and it allows you to control your entire house.
I'm glad to see someone else doing what I would like to do. I been leaning more towards home assistant myself.
 

lazaah

Well-Known Member
I've got 5x esp32 and a raspi with a bunch of components sitting on my desk now. Welcome to ask questions
 

pahval

Well-Known Member
So instead of buying one of course I'd rather do my own and I stumbled across this guy named kyle who did a system was curious if anybody else has seen and made one similar to this if so how'd it turn out for you? https://kylegabriel.com/projects/2020/06/automated-hydroponic-system-build.html#more-1971 is the link for the setup it's a long read so if your not a reader watch his youtube video. I did price check for everything looking at roughly $1500 usd for everything but it tracks (I think controls some if not all of that listed) EC, ph, air temp, RH, water temp, Vpd, co2, and power consumption. Was wondering if anybody has something similar or better or if you got something easier/cheaper to do that you can still get data from please share.
1500 usd? really? @Jesusgrowsmygrass how much did it cost you to make it? i tought it was supposed to be cheaper than other commercial products (altough for 1500 american pesos you get only controller without any sensors and actuators)... im doing my own myCodo level of controller (but different platform, eps32 and arduinos) integrated with openHab, if youll wait for a year or two it will be done XD
 

pahval

Well-Known Member
I've got 5x esp32 and a raspi with a bunch of components sitting on my desk now. Welcome to ask questions
what are in your experiences shortcomings of esp32 and arduinos? imho esp32 is what arduino needs to become a viable product, take mega with 52 digital IO and esp32s 2 cores with floating point unit inside very developed environment of open source libraries, and you can make miracles... but im worried about reliability, would you use those for something delicate as growing plants environment with hydroponics is?
 

linuxman

Well-Known Member
I recommend to build your own control system or at least learn how to build one, you'll be glad since it will be useful throughout your life in all projects. You can easily and cheaply replace parts if needed.
Best of all, you get 100% accurate outcomes you tried in achieving which is impossible to get from commercial products, what I mean is lets say you want to precisely control lights, dosing hydrogen peroxide, monitoring pH, ORP or TDS, whatever it would be, you can only do this with custom build control systems.
It is very inexpensive to do so. You can even use your old computer as a control system too. Depends how serious and much effort you want to put into it. Its not hard at all very easy to do.

The only thing that will cost a lot of money is quality important parts, precisely like sensor probes.

I'm actually doing a grow right now and will automate everything from top to bottom and 100% custom built control system, it will use a combination of ESP32 and AVR chips I will show how everything is done.
I'm doing a fully automated HPA system.

From my experience, I had good results using custom built systems on AVR and ESP32 micros.

The best microcontroller to use for reliability are ARM based microcontrollers if you want everything be controlled under one microcontroller. I would completely avoid using arduino IDE if you're serious about your grow. I'll someday show how to take an ARM micro and make a fully custom controller board.
 

linuxman

Well-Known Member
1500 usd? really? @Jesusgrowsmygrass how much did it cost you to make it? i tought it was supposed to be cheaper than other commercial products (altough for 1500 american pesos you get only controller without any sensors and actuators)... im doing my own myCodo level of controller (but different platform, eps32 and arduinos) integrated with openHab, if youll wait for a year or two it will be done XD
$1,500 for discrete microcontroller parts is really questionable.

I can build a fully custom reliable microcontroller board for less than $300 that will monitor, record and control: AC or DC lights, AC or DC water pumps, doings pumps, pH, TDS, temperature, humidity and etc.
Obviously this requires making my own PCB and circuits and programming everything from scratch.
 

dstroy

Well-Known Member
I recommend to build your own control system or at least learn how to build one, you'll be glad since it will be useful throughout your life in all projects. You can easily and cheaply replace parts if needed.
Best of all, you get 100% accurate outcomes you tried in achieving which is impossible to get from commercial products, what I mean is lets say you want to precisely control lights, dosing hydrogen peroxide, monitoring pH, ORP or TDS, whatever it would be, you can only do this with custom build control systems.
It is very inexpensive to do so. You can even use your old computer as a control system too. Depends how serious and much effort you want to put into it. Its not hard at all very easy to do.

The only thing that will cost a lot of money is quality important parts, precisely like sensor probes.

I'm actually doing a grow right now and will automate everything from top to bottom and 100% custom built control system, it will use a combination of ESP32 and AVR chips I will show how everything is done.
I'm doing a fully automated HPA system.

From my experience, I had good results using custom built systems on AVR and ESP32 micros.

The best microcontroller to use for reliability are ARM based microcontrollers if you want everything be controlled under one microcontroller. I would completely avoid using arduino IDE if you're serious about your grow. I'll someday show how to take an ARM micro and make a fully custom controller board.

I’m in the process of building another now. C++ is C++, C is C, in arduino ide or esp idf or arm gcc. If you’re just using the mcu in arduinos case and not a dev board then I guess you can use the avr toolchain but lots of people clone a layout and use an existing board package for fast prototyping. The arduino ide is meant to be easy to use since it’s targeted at beginners.
 

dstroy

Well-Known Member
$1,500 for discrete microcontroller parts is really questionable.

I can build a fully custom reliable microcontroller board for less than $300 that will monitor, record and control: AC or DC lights, AC or DC water pumps, doings pumps, pH, TDS, temperature, humidity and etc.
Obviously this requires making my own PCB and circuits and programming everything from scratch.
1640278189930.png

I started work on the pcb layout with the schematic partially finished, I've got quite a few headers to add still :(

I've found that it's cheaper to order knockoff parts from ebay or amazon and desolder them, since I'm only making a few boards I think that's the cheapest way to go... I bought 10 lm2596 adj for $10 and the chip itself is like $6 from mouser/digikey
 

linuxman

Well-Known Member
View attachment 5052397

I started work on the pcb layout with the schematic partially finished, I've got quite a few headers to add still :(

I've found that it's cheaper to order knockoff parts from ebay or amazon and desolder them, since I'm only making a few boards I think that's the cheapest way to go... I bought 10 lm2596 adj for $10 and the chip itself is like $6 from mouser/digikey
Nice stuff you got going there. How do you manufacture your PCB boards, everything made by yourself or will be sent to a fab house?

I took the liberty and bought like 6 different ESP32 chipsets from Aliexpress in bulk so that I always have a handful instock, the lowest priced ESP32 wroom chip is around $2.50 with free shipping. I would do the same as you, buy something from eBay/Amazon that would might require to desolder :eek:
 

bloomco

New Member
$1,500 for discrete microcontroller parts is really questionable.

I can build a fully custom reliable microcontroller board for less than $300 that will monitor, record and control: AC or DC lights, AC or DC water pumps, doings pumps, pH, TDS, temperature, humidity and etc.
Obviously this requires making my own PCB and circuits and programming everything from scratch.
PH and TDS probes alone will run $150-$450. Are saying the board will cost $300 + the cost of probes?
A quality C02 meter is about $60 too. I’m interested if you can give me a list that’s $300 or less for everything.
 

linuxman

Well-Known Member
PH and TDS probes alone will run $150-$450. Are saying the board will cost $300 + the cost of probes?
A quality C02 meter is about $60 too. I’m interested if you can give me a list that’s $300 or less for everything.
I use lab grade sensor probes, mostly from “Atlas Scientific”. It will give you the most accurate and reliable readings.
The ORP sensor (know as the amperometric sensors) and EC (TDS/PPM) sensor, I strongly recommend buying quality probes from a reputable company.

For a home grower, it’s easily possible to build an advanced controller board using a $3 microcontroller like an ESP32 (a powerful beast) hooked up with $150-$450 sensor probes.

I like to add a GUI interface, utilizing a big LCD display which I can interact with and control the grow.
You can get quality high resolution 5 inch displays for around $50 and easily hook it up to a raspberry pi or ESP32.
You can also control/monitor everything through the internet, Bluetooth or WiFi from your smartphone or what not.

So here is a list of parts needed to make a quality automated home grow controller system, for monitoring, it will be based for hydroponics or aeroponics systems:
  • A decent pH probe, complete kit for $70 from Atlas Scientific: Atlas Scientific

  • A quality TDS/EC/PPM probe, has a whopping 10 year lifespan, for $114 from Atlas Scientific: Atlas Scientific
    • You'll also need amplifier circuit, costs $11 from Atlas Scientific: Atlas Scientific
    • You'll also need a Development Board for the amplifier circuit. So that the monitoring microcontroller, EC probe and the amplifier circuit can all properly and safely connect together and communicate. Costs $19 from Atlas Scientific: Atlas Scientific
    • You'll also need calibrating solution to calibrate the EC probe, costs $13 from Atlas Scientific: Atlas Scientific
(Note: requires soldering the amplifier circuit to the development board. The EC probe and it's components will cost a total of $157, you're saving $48 but you could spend the $48 of a total of $205 and buy everything as a kit, all prebuilt from Atlas Scientific and avoid soldering and have a ready solution to put everything together and works out from the box. The full kit includes the EC Probe + better amplifier circuit + much better development board + Calibrating solution + extra cables: here is the link from Atlas Scientific for the kit Atlas Scientific)

  • A quality ORP sensor probe, complete kit for $79 from Atlas Scientific: Atlas-Scientific

  • A quality temperature probe, complete kit for $67 from Atlas Scientific: Atlas-Scientific

  • A decent CO2 sensor, "Sensirion’s Photoacoustic CO2 sensor, model SCD41" has an accuracy of 40 PPM+/- with the range of 400 PPM to 4,000 PPM. It also has a built in humidity and temperature sensor which is stated on the datasheet. Costs $50 at DigiKey: DigiKey
    • If you need a much higher accuracy and range for a CO2 sensor, would recommend the Atlas Scientific's "EZO-CO2" sensor, has an accuracy of 50 PPM+/- with a range of 0 PPM to 10,000 PPM. It is ready out from the box to be plugged into a microcontroller and provide CO2 readings. Costs $152 from Atlas Scientific: Atlas Scientific

  • The infamous ESP32 microcontroller. You'll get 3 pieces for $16 from Amazon: Amazon
    • Or if you want to solder the ESP32 to your own PCB board, you can get an ESP32 for less than $3 at AliExpress shipped from China: AliExpress
    • I am assuming you have all the DuPont wires needed to connect and test everything, if not you can buy a pack of DuPont wires from Amazon: Amazon.

Well that seems like a basic and important sensors needed for a hydroponics grow system, enough to monitor and record your grow.
However this is no where near complete for a fully automated system which can automatically do: nutrient dosing, fan control, pump control, light control and etc, more components are needed, I'm keeping this post short.

It seems you are only interested with pH, TDS and CO2. So I'll give you a practical price and it will be just as good or better than the commercial stuff targeted for home growers.
pH probe= $70
Temperature probe= $67
TDS probe= $157
CO2 probe= $50
ESP32 Microcontroller= $16
That all totals out to be: $344 :bigjoint:

Note: You'll need few miscellaneous things like plastic housing, battery/power adapter and etc. Also need to program the ESP32 to do the monitoring and recording tasks.

The price could be reduced much more if you're designing your own PCB and integrating all these parts together. Will be complex.

----------------
But I have a much better idea, obtaining a "Milwaukee MW804 MAX Waterproof 4-in-1 pH / EC / TDS / Temp", Pen Tester which costs $138.
Open that up and do some simple "reversing engineering" and hook it up to an ESP32, can be done easily.

Now this requires some automation to bring in some reservoir liquid sample to the Milwaukee MW804 sensor head, then have some kind of microcontroller to tell the MW804 to test the liquid sample, then extract the data needed from the MW804 to the microcontroller/database.
Lastly, need to automatically clean the MW804 sensor head with some clean distilled water. Have the waste water disposed to a waste container.

This process can be repeated automatically indefinitely, every 5 mins, 30 mins, 1 hour or 5 hours and etc.
Calibration can also be done automatically as well, requires more complexity to the physical design.
I choose the Milwaukee MW804 because it has good accuracy, reliable and best of all you can replace the sensor head when it's lifespan has reached it's limit. Thus this hacked system can be used and continued for many years.
So now the price for pH, TDS , Temperature and CO2 will cost less than $200 for a quality and reliable monitoring system.

The pros to this concept is that the pen tester probe is not always swimming in the reservoir 24/7, the pen tester will always be cleaned and calibrated automatically, so every reading should provide very accurate results and lifespan will last much longer and is cheaper than what we currently have today in the market for quality automation solutions. Maybe other lab grade "4-in-1" pen testers can be used.
If anyone is interested with this concept, I think I'll take the liberty and actually make a tutorial on how to build one.
I personally rather spend the extra money for the Atlas Scientific probes, simply because they work and save so much time from brainstorming for a cheaper viable alternative solution :mrgreen:.
----------------

The only reason why the commercial stuff costs thousands of dollars is because they have to pay good money for hardware and software engineers to make these boards and also have the boards sent to few separate authoritative agencies (which costs a lot of money) so that it would be tested and certified to be labeled in compliance with mandatory legal regulations and safety codes to be a viable product for the end customers.
 

bloomco

New Member
I use lab grade sensor probes, mostly from “Atlas Scientific”. It will give you the most accurate and reliable readings.
The ORP sensor (know as the amperometric sensors) and EC (TDS/PPM) sensor, I strongly recommend buying quality probes from a reputable company.

For a home grower, it’s easily possible to build an advanced controller board using a $3 microcontroller like an ESP32 (a powerful beast) hooked up with $150-$450 sensor probes.

I like to add a GUI interface, utilizing a big LCD display which I can interact with and control the grow.
You can get quality high resolution 5 inch displays for around $50 and easily hook it up to a raspberry pi or ESP32.
You can also control/monitor everything through the internet, Bluetooth or WiFi from your smartphone or what not.

So here is a list of parts needed to make a quality automated home grow controller system, for monitoring, it will be based for hydroponics or aeroponics systems:
  • A decent pH probe, complete kit for $70 from Atlas Scientific: Atlas Scientific

  • A quality TDS/EC/PPM probe, has a whopping 10 year lifespan, for $114 from Atlas Scientific: Atlas Scientific
    • You'll also need amplifier circuit, costs $11 from Atlas Scientific: Atlas Scientific
    • You'll also need a Development Board for the amplifier circuit. So that the monitoring microcontroller, EC probe and the amplifier circuit can all properly and safely connect together and communicate. Costs $19 from Atlas Scientific: Atlas Scientific
    • You'll also need calibrating solution to calibrate the EC probe, costs $13 from Atlas Scientific: Atlas Scientific
(Note: requires soldering the amplifier circuit to the development board. The EC probe and it's components will cost a total of $157, you're saving $48 but you could spend the $48 of a total of $205 and buy everything as a kit, all prebuilt from Atlas Scientific and avoid soldering and have a ready solution to put everything together and works out from the box. The full kit includes the EC Probe + better amplifier circuit + much better development board + Calibrating solution + extra cables: here is the link from Atlas Scientific for the kit Atlas Scientific)

  • A quality ORP sensor probe, complete kit for $79 from Atlas Scientific: Atlas-Scientific

  • A quality temperature probe, complete kit for $67 from Atlas Scientific: Atlas-Scientific

  • A decent CO2 sensor, "Sensirion’s Photoacoustic CO2 sensor, model SCD41" has an accuracy of 40 PPM+/- with the range of 400 PPM to 4,000 PPM. It also has a built in humidity and temperature sensor which is stated on the datasheet. Costs $50 at DigiKey: DigiKey
    • If you need a much higher accuracy and range for a CO2 sensor, would recommend the Atlas Scientific's "EZO-CO2" sensor, has an accuracy of 50 PPM+/- with a range of 0 PPM to 10,000 PPM. It is ready out from the box to be plugged into a microcontroller and provide CO2 readings. Costs $152 from Atlas Scientific: Atlas Scientific

  • The infamous ESP32 microcontroller. You'll get 3 pieces for $16 from Amazon: Amazon
    • Or if you want to solder the ESP32 to your own PCB board, you can get an ESP32 for less than $3 at AliExpress shipped from China: AliExpress
    • I am assuming you have all the DuPont wires needed to connect and test everything, if not you can buy a pack of DuPont wires from Amazon: Amazon.

Well that seems like a basic and important sensors needed for a hydroponics grow system, enough to monitor and record your grow.
However this is no where near complete for a fully automated system which can automatically do: nutrient dosing, fan control, pump control, light control and etc, more components are needed, I'm keeping this post short.

It seems you are only interested with pH, TDS and CO2. So I'll give you a practical price and it will be just as good or better than the commercial stuff targeted for home growers.
pH probe= $70
Temperature probe= $67
TDS probe= $157
CO2 probe= $50
ESP32 Microcontroller= $16
That all totals out to be: $344 :bigjoint:

Note: You'll need few miscellaneous things like plastic housing, battery/power adapter and etc. Also need to program the ESP32 to do the monitoring and recording tasks.

The price could be reduced much more if you're designing your own PCB and integrating all these parts together. Will be complex.

----------------
But I have a much better idea, obtaining a "Milwaukee MW804 MAX Waterproof 4-in-1 pH / EC / TDS / Temp", Pen Tester which costs $138.
Open that up and do some simple "reversing engineering" and hook it up to an ESP32, can be done easily.

Now this requires some automation to bring in some reservoir liquid sample to the Milwaukee MW804 sensor head, then have some kind of microcontroller to tell the MW804 to test the liquid sample, then extract the data needed from the MW804 to the microcontroller/database.
Lastly, need to automatically clean the MW804 sensor head with some clean distilled water. Have the waste water disposed to a waste container.

This process can be repeated automatically indefinitely, every 5 mins, 30 mins, 1 hour or 5 hours and etc.
Calibration can also be done automatically as well, requires more complexity to the physical design.
I choose the Milwaukee MW804 because it has good accuracy, reliable and best of all you can replace the sensor head when it's lifespan has reached it's limit. Thus this hacked system can be used and continued for many years.
So now the price for pH, TDS , Temperature and CO2 will cost less than $200 for a quality and reliable monitoring system.

The pros to this concept is that the pen tester probe is not always swimming in the reservoir 24/7, the pen tester will always be cleaned and calibrated automatically, so every reading should provide very accurate results and lifespan will last much longer and is cheaper than what we currently have today in the market for quality automation solutions. Maybe other lab grade "4-in-1" pen testers can be used.
If anyone is interested with this concept, I think I'll take the liberty and actually make a tutorial on how to build one.
I personally rather spend the extra money for the Atlas Scientific probes, simply because they work and save so much time from brainstorming for a cheaper viable alternative solution :mrgreen:.
----------------

The only reason why the commercial stuff costs thousands of dollars is because they have to pay good money for hardware and software engineers to make these boards and also have the boards sent to few separate authoritative agencies (which costs a lot of money) so that it would be tested and certified to be labeled in compliance with mandatory legal regulations and safety codes to be a viable product for the end customers.
that’s a good response. I will be saving this information. I have looked into atlas scientific for their probes and That’s where my question stemmed from. Their lab grade probes are decently expensive, especially for EC. I haven’t looked into ESP32, just arduino and raspberrypi (which are tough to find at a decent price right now).
 

craggin

Active Member
I'm prototyping Gen 2 of my controller design right now. Don't forget to factor waste into the final cost of your project! I've fried several Pis and butchered a few project boxes which meant replacements. I also needed double of everything so I could work out kinks & bugs on the bench while a completed controller was running a grow.

Here's my Gen 1 controller, which was just environmental and simple on/off for hydro pumps. Gen 2 adds hydroponic sensors and controls on top of basic EC in Gen 1.

20201214_083632.jpg 20210107_174947.jpg 20210107_175052.jpg 20210107_175141.jpg

Will provide Gen 2 pics when it's closer to being ready for production.
 

Billy the Mountain

Well-Known Member
I'm prototyping Gen 2 of my controller design right now. Don't forget to factor waste into the final cost of your project! I've fried several Pis and butchered a few project boxes which meant replacements. I also needed double of everything so I could work out kinks & bugs on the bench while a completed controller was running a grow.

Here's my Gen 1 controller, which was just environmental and simple on/off for hydro pumps. Gen 2 adds hydroponic sensors and controls on top of basic EC in Gen 1.

View attachment 5062140 View attachment 5062141 View attachment 5062142 View attachment 5062143

Will provide Gen 2 pics when it's closer to being ready for production.
I love the relay box, nice clean layout.
Are you using Rpi's or microcontrollers for your G2 setup?
 

craggin

Active Member
I love the relay box, nice clean layout.
Are you using Rpi's or microcontrollers for your G2 setup?
Thanks for the compliment!
Gen 1 - RPi 3B+ provides the top-level "brains" so to speak. One Arduino Mega for sensors and relay controls.
Gen 2 - RPi 4 (4G) provides all the "brains". 1 Arduino Mega for relays & 1 Arduino Uno for sensors. Keeps the C++ code much simpler & cleaner this way.
 

linuxman

Well-Known Member
I'm prototyping Gen 2 of my controller design right now. Don't forget to factor waste into the final cost of your project! I've fried several Pis and butchered a few project boxes which meant replacements. I also needed double of everything so I could work out kinks & bugs on the bench while a completed controller was running a grow.

Here's my Gen 1 controller, which was just environmental and simple on/off for hydro pumps. Gen 2 adds hydroponic sensors and controls on top of basic EC in Gen 1.

View attachment 5062140 View attachment 5062141 View attachment 5062142 View attachment 5062143

Will provide Gen 2 pics when it's closer to being ready for production.
Very organized and well thought out relay unit. I likes it. How much did everything cost?
 

craggin

Active Member
Very organized and well thought out relay unit. I likes it. How much did everything cost?
Thanks! Since I sporadically ordered stuff online during the pandemic as my design went from napkin to reality, I would need to go back and tally everything up. My costs were higher than need be as I bought components I either ended up not using, or I destroyed inadvertently during prototyping (several PIs were toasted and several project boxes got mangled). I also bought enough for a prototype in production and one on the bench. This helped me identify bugs or weak designs in the grow room, but then have a full dev environment with which to fix them.
 
Top