I am a newbie in ESP home, so I am looking for some hints how to make some “logic” inside yaml.
I am trying to build hydroponic monitor for pH + TDS / EC metering. I have all the sensors hooked up, and working. But I face one issue. The TDS probe interferencing with pH probe and thus make the measurements useless. I found out, it is actually normal behaviour, and the workaround solution is to connect the TDS probe / circuit only when reading the value. So, the reading of the sensors are alternating. It means to wire the TDS circuit on transistors, and when I want to read the value, to turn it on, read ADC, and turn it off. But I have no idea how to do such task in ESP home.
Can you please help me?
I have pH ADC sensors up and read the value every 5 seconds + averaging 24 samples. But I would like to read TDS ADC sensor value every 5 second in-between pH 5 seconds, and averaging 24 samples. So let’s say, I would read every 5 seconds pH and every 2+5 seconds TDS, if it make sens.
Probably it should be automation with on-time trigger, where I should toggle TDS on / off and read it’s value. But I don’t know, how to read value of the sensor in the automation.
That might be the way.
Only the update interval should be “never” and than force it to update as you propose.
Will try to implement it with some script for switching the TDS sensor.
Sure, no problem.
The issue with weird behavior of pH probe is quite normal, as the pH probe is probably the most sensitive sensor I have had in my hands (it measures pico amperes). But, the solution seems to be quite easy. Just measure one measurement at the time. I don’t like this solution, as the pH probe seems to need some time to stabilize. Again, pico amperes is extremely small. So, I use Gravity: Analog Signal Isolator - DFRobot.
Then, you need better pH probe. The one, constructed to be continuously submerged. If you use the other one, in china mostly the transparent one, this will slowly draft its measurement to one or another side of the pH range.
I have test setup already working, now. But I have to tweak some minor issues.
My current setup measure the values, and there is some automations in esphome happening, when the measurements are out of range.
At the beginning, I use Analog Threshold Binary Sensor, but then I want to parametrized by lambdas, so I switched to normal Binary Sensor, which can be driven by lambdas.
When I am finished, I will share all my work, as I gathered some interesting knowledge. Now, the setup is working and balancing nutrients for my seedlings and I am in process of designing first prototype of PCB for hydroponics. Something like Atlas scientific, but way cheaper.
For now, I use scripts triggered by the Binary Sensors. But at the end, I will probably switch to Interval component, as I don’t need fast response, and I have to drive pumps, and measurements in certain period of time. For example, I should not measure pH and EC when pump is running water through whole system.
just wondering how this is working a year later?? What TSD sensor did you use? people have said the cheap tds sensors don’t last long so I was looking at the Atlas TDS sensor but its like $200 and I am wondering if a cheap one would work just as good? I just want to see what’s going on big picture with my organic system that auto feeds from compost so it would be nice to get an alert if PPMs go low since that happens a lot in the summer with heavy feeding plants.
also how is the PH sensor working? do you think an expensive one from atlas worth it?
Thanks
For me, Atlas is overpriced. I am OK with paying a bit more for extra, or for “not manufactured in china”. But their prices is in laboratory range, and they are not laboratory company. They are consumers market company.
About TDS, that is actually impressively easy probe, compare to pH probe. It is basically voltage meter. It is good to buy some “industrial grade” probe as they are able to withstand longer the immersion in water. The laboratory one, are not. What I end up using, is cheap chinese module for TDS, but I swap the probe for that “industrial grade” one from aliexpress.
The pH sensor is different story. When you know, that this probe, when immerse in water 24/7, you should buy once a year new, then atlas is again a bit pricey. The main thing for longer immersion is, that you want a pH probe with white-ish collar around the glass ball. That is highly likely to be PTFE junction which is more suited for longer immersion in water. For more info, search for how pH probe work.