Home assistant and arduino ph automation help/questions

Aviatorshades

Well-Known Member
I got a ras pi and an arduino mega. I got some atlas scientific ph and ppm meters. I cant figure out how to get them to talk to the home assistant. Everyone just wants to sell me their stuff but not offer any help or leads on information. I was able to get arduino to read ph and ppm values on a scrolling text popup but cant get it nice and graphic looking in home assistant. My goal is just to control the ph of a reservoir in a rdwc system. controlling ppm would be cool too. I bought those hydrostatic pumps and relays and everything. just lack the know how to get them to talk and be able to write scripts to have it dose if XX gets too low. I have cpu programming experience so it will help once i get the basics.
 

Billy the Mountain

Well-Known Member
I got a ras pi and an arduino mega. I got some atlas scientific ph and ppm meters. I cant figure out how to get them to talk to the home assistant. Everyone just wants to sell me their stuff but not offer any help or leads on information. I was able to get arduino to read ph and ppm values on a scrolling text popup but cant get it nice and graphic looking in home assistant. My goal is just to control the ph of a reservoir in a rdwc system. controlling ppm would be cool too. I bought those hydrostatic pumps and relays and everything. just lack the know how to get them to talk and be able to write scripts to have it dose if XX gets too low. I have cpu programming experience so it will help once i get the basics.
I have a similar setup, using both a pi zero, and more recently, a pico w microcontroller. It's trivial to use mqtt to send messages to HA. HA does all the grunt work to create the pretty graphs.

As far as controlling hardware, you can do so either on the microcontroller side or through HA. HA is more geared to simple on/off in my experience; it's best to use the microcontroller and your code to read sensor data and control the appropriate hardware. I use HA primarily as a dashboard to display sensor output (pH, EC, temp, VPD), but the microcontroller code is what directly runs the show.

In a nutshell, your code will control the devices and periodically sent mqtt messages to HA to monitor the process.
 

zfyq

Active Member
necroposting but, this is a blueprint ive been working on for ph automation. have stalled for now until i get a reliable sensor and can fine tune the dose sizes between attempts https://github.com/jeemers/Homegrown-Assistant/blob/main/blueprints/Auto pH.yaml

I don't like the idea of doing logic on microcontrollers beyond backup automations in a brain MCU in charge of various things incase it loses connection to HA. I much prefer the logic be in HA so I can modify it on the fly without having to flash firmwares.
 

Aviatorshades

Well-Known Member
necroposting but,...
I'm still here brah. I'd like to figure out how to get home assistant to connect to my ph probe and ec probe. Because I'd like to program it so you can hit + or - and it'll does ph up or down into hydro so you can keep it in a certain range l. Can you help me
 

zfyq

Active Member
I'm still here brah. I'd like to figure out how to get home assistant to connect to my ph probe and ec probe. Because I'd like to program it so you can hit + or - and it'll does ph up or down into hydro so you can keep it in a certain range l. Can you help me
Highly depends on your probe. if its smart at all it might be doable. if its not smart, you could use a webcam and computer vision to 'read' the screens.
 

Lou66

Well-Known Member
The pH probe outputs a voltage (roughly -1 V to V). Read that with an ADC or use a dedicated circuit that connects via a digital interface (Atlas sells that, EZO pH circuit). With that you can create a sensor in HA and integrate it with a dosing pump, automations etc.

I prefer to use ESP MCUs with ESPHome for my Home Assistent applications. They are cheap (an ESP32-C3 costs just 3 bucks), have wifi and the programming is easy, even for me with barely any knowledge.
 

Billy the Mountain

Well-Known Member
I do exactly that with a pi pico. An ADC reads the pH sensor voltage and sends the calculated value back to HomeAssistant as an mqtt message. The pico also controls peristalic dosing pumps to raise/lower pH. This runs independently and doesn't rely on any connectivity with HA, the pico manages the pH and sends status messages to HA.
 

zfyq

Active Member
I do exactly that with a pi pico. An ADC reads the pH sensor voltage and sends the calculated value back to HomeAssistant as an mqtt message. The pico also controls peristalic dosing pumps to raise/lower pH. This runs independently and doesn't rely on any connectivity with HA, the pico manages the pH and sends status messages to HA.
How are you dialing in ph dose sizes as you get closer to target? Do you have any code up anywhere?
 

Billy the Mountain

Well-Known Member
How are you dialing in ph dose sizes as you get closer to target? Do you have any code up anywhere?
I haven't needed to do anything involving feedback or a PID controller for adjusting pH. I simply dose a fixed time/amount per gallon if necessary.
If pH > 6.2, a dose will reduce it to 5.9 in my reservoir. I haven't needed anything more sophisticated for pH.

It's literally just a few lines of code.
 

zfyq

Active Member
I haven't needed to do anything involving feedback or a PID controller for adjusting pH. I simply dose a fixed time/amount per gallon if necessary.
If pH > 6.2, a dose will reduce it to 5.9 in my reservoir. I haven't needed anything more sophisticated for pH.

It's literally just a few lines of code.
Word i get ya
 
Top