Atlas Scientific Wi-Fi Hydroponics Kit example yaml

Hi all,

I just picked up one of these WiFi Hydroponics Kits from Atlas Scientific. Was looking around for a configuration example but couldn’t find one, only a few mentions of the older hardware revision that had an ESP8266.

So for the v1.5, which comes with an ESP32, I found the following worked:

esp32:
  board: denky32
  framework:
    type: arduino
i2c:
  - id: bus_ezo
    sda: 23
    scl: 22
    scan: true

sensor:
  - platform: ezo
    id: ph1_ezo
    name: "pH G1"
    address: 99
    unit_of_measurement: "pH"
    update_interval: 10s
  - platform: ezo
    id: rtd1_ezo
    name: "Res Temp G1"
    address: 102
    accuracy_decimals: 2
    unit_of_measurement: "°C"
    update_interval: 10s
  - platform: ezo
    id: ec1_ezo
    name: "EC G1"
    address: 100
    accuracy_decimals: 2
    #unit_of_measurement: "μS"
    filters:
      # Take μS / 2 to get ppm500
      # take ppm500 / 500 to get EC
     - lambda: return x / 2 / 500;
    unit_of_measurement: "EC (ppm 500)"
    update_interval: 10s

Works out of the box as you’d guess, given it’s just an ESP32 with a MicroUSB.
Haven’t yet done any calibration of the pH pen, that’s a job for in a week or so time when I start using it.

Hope it’s helpful for someone else wondering about the i2c pins :blush:

2 Likes

works great! have you figured out how to calibrate the ph sensors?

thanks!

I haven’t yet had the opportunity to play around with these and calibrate the pH due to bulding the facility that’s going to use these. I hope to this coming week @jnrivra :slight_smile:

Here is my code which has calibration via buttons, temperature compensation, and switches to enable the pins that power the sensors.

esphome:
  name: <pool_sensor>

esp8266:
  board: huzzah

i2c:
    scan: false
    sda: 4
    scl: 5

button:
  - platform: template
    name: "Clear PH Calibration" 
    id: ph_calibrate_clear
    on_press:
      then: 
        - lambda: id(ph_ezo).clear_calibration();
  - platform: template
    name: "PH 7 Calibrate" 
    id: ph_calibrate_7
    on_press:
      then: 
        - lambda: id(ph_ezo).set_calibration_point_mid(7.00);
  - platform: template
    name: "PH 10 Calibrate" 
    id: ph_calibrate_10
    on_press:
      then: 
        - lambda: id(ph_ezo).set_calibration_point_high(10.00);
  - platform: template
    name: "PH 4 Calibrate" 
    id: ph_calibrate_4
    on_press:
      then: 
        - lambda: id(ph_ezo).set_calibration_point_low(4.00);     

switch:
  - platform: gpio
    pin: 15
    name: "Temp Enabled"
    restore_mode: ALWAYS_ON

  - platform: gpio
    pin:
      number: 14
      inverted: true
    name: "pH Enabled"
    restore_mode: ALWAYS_ON

  - platform: gpio
    pin:
      number: 12
      inverted: true
    name: "ORP Enabled"
    restore_mode: ALWAYS_ON

sensor:
  - platform: ezo
    id: rtd_ezo
    name: "Temperature Measurement"
    address: 102
    accuracy_decimals: 2
    unit_of_measurement: "°F"
    update_interval: 60s
    on_raw_value:
      then:
        lambda: |-
          id(ph_ezo).set_tempcomp_value(id(rtd_ezo).state);
    filters:
      - lambda: return x * (9.0/5.0) + 32.0;

  - platform: ezo
    id: ph_ezo
    name: "pH Level"
    address: 99
    accuracy_decimals: 2
    unit_of_measurement: "pH"
    state_class: "measurement"
    update_interval: 60s

  - platform: ezo
    id: ph_orp
    name: "ORP Level"
    unit_of_measurement: "mV"
    address: 98
    state_class: "measurement"
    update_interval: 60s

3 Likes

Thanks for that @jeremykeen !

I had the following myself:

web_server:
  port: 80
    
i2c:
  - id: bus_ezo
    sda: 23
    scl: 22
    scan: true

sensor:
  - platform: ezo
    id: phg1_ezo
    name: "pH G1"
    address: 99
    unit_of_measurement: "pH"
    accuracy_decimals: 2
    update_interval: 10s
  - platform: ezo
    id: rtg1_ezo
    name: "Res Temp G1"
    address: 102
    accuracy_decimals: 2
    unit_of_measurement: "°C"
    update_interval: 10s
  - platform: ezo
    id: ecg1_ezo
    name: "EC G1"
    address: 100
    accuracy_decimals: 2
    #unit_of_measurement: "μS"
    filters:
      # Take μS / 2 to get ppm500
      # take ppm500 / 500 to get EC
     - lambda: return x / 2 / 500;
    unit_of_measurement: "EC (ppm 500)"
    update_interval: 10s

button:
- platform: template
  name: "G1 pH clear calibration"
  on_press:
    then:
      - lambda: |-
          id(phg1_ezo).clear_calibration();
- platform: template
  name: "G1 pH Calibration 7.00"
  on_press:
    then:
      - lambda: |-
          id(phg1_ezo).set_calibration_point_mid(7.00);
- platform: template
  name: "G1 pH Calibration 4.00"
  on_press:
    then:
      - lambda: |-
          id(phg1_ezo).set_calibration_point_low(4.00);
- platform: template
  name: "G1 pH Calibration 4.00"
  on_press:
    then:
      - lambda: |-
          id(phg1_ezo).set_calibration_point_high(10.00);
- platform: template
  name: "G1 pH verify calibration"
  on_press:
    then:
      - lambda: |-
          id(phg1_ezo).send_custom("Cal,?");
- platform: template
  name: "Disable pH sensor light"
  on_press:
    then:
      - lambda: |-
          id(phg1_ezo).set_led_state(false);
- platform: template
  name: "Disable EC sensor light"
  on_press:
    then:
      - lambda: |-
          id(ecg1_ezo).set_led_state(false);
- platform: template
  name: "Disable Temp sensor light"
  on_press:
    then:
      - lambda: |-
          id(rtg1_ezo).set_led_state(false);

But I found huge swings consistently when in calibration solution:

Unfortunately I got sidetracked with other things and never looked into it further but I’m wondering if you may have any ideas? These swings were taking place for both pH7 and pH4 calibration solutions.

The documentation from Atlas Scientific seems to suggest that it should stabilize after a while, but even after 4-5 minutes it was still bouncing around all over the place:

I take it yours doesn’t do that?
Similarly I never got to the point I was able to see the output of pressing the pH calibration verification button:


I presume I’ve missed something there.

I see that @HydroRay has had some luck over here:

Is this something you may be able to shed some light on for us how it’s been working for you?

At least turning off those sensor lights works, but the main blue one on the carrier board itself, and the ESP32 are still on, so I’ll figure out how to turn those off eventually too :sweat_smile:

EDIT: Even in a large jug of tapwater, with the EC + Temperature probes, sitting still, for several minutes, it can’t make up its mind. Formatted it without the EC / Temp etc for easier visibility of how wildly it’s going all over the place:

'pH G1': Sending state 6.68100 pH with 2 decimals of accuracy
'pH G1': Sending state 7.24400 pH with 2 decimals of accuracy
'pH G1': Sending state 6.66900 pH with 2 decimals of accuracy
'pH G1': Sending state 7.01000 pH with 2 decimals of accuracy
'pH G1': Sending state 6.95200 pH with 2 decimals of accuracy
'pH G1': Sending state 7.07900 pH with 2 decimals of accuracy
'pH G1': Sending state 7.01400 pH with 2 decimals of accuracy
'pH G1': Sending state 6.84000 pH with 2 decimals of accuracy
'pH G1': Sending state 6.96300 pH with 2 decimals of accuracy

EDIT2: Also, despite unboxing it ~2 months ago, the pH probe hasn’t been taken out of the storage solution until just now, so it’s not like it’s dried out or anything :man_shrugging:

I’ve unboxed the second unit I have and hooked up the pH probe to the first unit. No resolution, it still varies by 0.5pH in the space of 30 seconds. Completely unusable :frowning:

Configured the second WiFi hydroponics units and attached the first probe to it, it’s now sitting within approx 0.02pH which is significantly better, but still never fully settles even after 10 minutes, as expected based on the documentation:

I’ll raise a support ticket with Atlas Scientific for the first one but I wanted to ask the accuracy levels for others pH probes and if they see them settling down completely, and how the calibration process has been?

Hi all!

I’m not sure if I’ll be too much help, but here’s my thoughts…

Just so you know, I’ve also experienced fluctuations when calibrating the probes, but around .05 not .5 pH, and . 01 or so EC (which is so small when you think about it).

  • It looks like in both examples you’re trying to calibrate 4 pH first. Make sure you calibrate 7 pH first, then 4 pH, then 10 pH.

  • How long are you using the calibration solution? I believe Atlas Scientific says it’s only good for a half hour or so (although personally, I bet it is good for much longer).

  • When I’m calibrating I only wait for like, 4 steady readings before considering it “stable” and pushing the calibration button. These sensors are super sensitive and we’re dealing in really small variances. I have a handheld pH and EC probe (BlueLab I believe) that I use to mix my nutes and check my nursery reservoir, and they only go to .1 accuracy.

  • @jeremykeen I would remove the temp comp for calibration for two reasons. First, I’m guessing you don’t have the temp probe in the calibration solution at the same time as the pH probe, so it’ll be adjusting results based on different solutions. It also just feels like another variable that could contribute to the fluctuations.
    (P.S. I don’t know if it matters and I’m not 100%, but should the temp comp lambda be under the temp sensor or the ph sensor?)

  • Just a tip, but I have

esp32:
  board: featheresp32
  framework:
    type: arduino

logger:
  level: verbose

@jeremykeen looks like you might have an older version with an esp8266? If not, definitely update the board. @Chilling_Silence not sure what a denky32 is but if we got the same kits, it should be the Adafruit Feather “Huzzah ESP32”. Probably doesn’t help the calibration situation though :sweat_smile:

I like having verbose on because it tells you what the readings are before any filters/lambdas adjust them.

  • (This is just personal advice now, please don’t take offense) I’ve learned not to stress so much over the readings (unless they are super poorly calibrated/messed up which would stand out pretty big). I allow my nutrient solution to rise and fall naturally around .3 in either direction before my automations trigger and add pH up or down (I’ve set up my automations to trigger only after the sensors hold a reading out of range for a few minutes to protect against the occasional glitch). Nutrients get absorbed at different pH levels and I want to allow the plants to absorb whatever they need whenever they like. I feel it’s my job to keep the nutrient solution in a good range and adjust it before it gets to a nutrient lockout level, but let the plants do their thing otherwise. Not sure if it’s the same with pools but hopefully it’s similar.

Great to know there’re other people out there in the community! Hope this post helps :grinning:

Thanks for the reply @HydroRay !
4 Seconds :exploding_head:

So, I’ve tried changing now from denky32 to featheresp32 and still no change there. I found that board as it looked to most closely mirror what Atlas Scientific included in the WiFi kit. I’m aware they originally didn’t include one in older models though.

Have been trying to calibrate in pH 7 first, but it won’t settle down, so I’ve placed it back into the storage solution. I’ve tried the Atlas calibration solution, but also tried another fresh bottle from Bluelab, and another from Nutrifield.
This is what the second unit looks like that I’ve just plugged in:
image
You can see where I first did an update, and then second where I changed to featheresp32

And here’s what leaving it for 24 hours gives me on the first:

I have both a Bluelab Truncheon as well as their pH Probe, and a Milwaukee kit too (which isn’t as good as the Bluelab stuff).

I’m hopeful to also have the same ~0.3 variation (From 5.9 → 6.1 during flower) in the NFT Reservoirs, and I’ve got both some diaphraghm pumps as well as some Peristaltic pumps, but can’t use those yet until I can get this pH to go solidly. The EC was fine though, no problems there… Just unsure why the pH isn’t happy :frowning:

Grateful for your time, you’ve already been infinitely more helpful than the responses Atlas Scientific gave when I contacted their support.

The Atlas Scientific tech support hasn’t been very helpful, they’re trying to tell me this is a calibration issue that it won’t settle on a stable value. I’m adament that’s not the issue, given even pre-calibration over time it should arrive at a stable and steady reading (even if that reading is incorrect).
Given the resolution is 0.001 and the accuracy is +/- 0.002, I’d expect that even maintaining a 0.1 value shouldn’t be difficult:


Given this is sitting in the pH4.00 calibration solution (Freshly opened) the whole time of this image, we shouldn’t be seeing that sort of reading swing.

Any input from people on why this may be happening would be greatly appreciated because I’m hitting my head against a brick wall here with their tech support :frowning:

Exactly the same setup, exactly the same problem:

The probe is sitting in a pouch for 8 minutes.

Update: tired different power sources, different usb cables, used tasmota instead of esphome. It’s all the same, readings are fluctuating within 0.3 range. Very disappointed, especially after reading the support is just shrugging off the issue.

My readings dance around the correct value, the same way @Chilling_Silence readings do.
I decided to try to take average over time (90 seconds). Here are results:

These are readings from pouches that I opened yesterday, so may be this is why 4 is a bit off. Will test with fresh later.

So if taking average over time it could be usable imo

@Chilling_Silence I get the feeling it might be best to just start from scratch and send the Factory command, then Cal,? to make sure it’s cleared and if not, Cal,clear too. Having readouts move over .25 in 10 seconds without doing anything to it sounds to me like something is either wrong with the probe or programming. My experience is much more similar to @mrph with fluctuations in the hundredths until stabilizing for a brief time (4ish readings in 5 second intervals) It might be a tiny pain if you’ve changed the i2c address as you’ll have to redo it, but other than that I don’t see any other lost progress. Then just make sure the order is Cal,mid,7.00 , Cal,low,4.00 , Cal,high,10.00 , and then Cal,? to get a “?Cal,3” response.

I was going to suggest sending the Slope,? command just to see if there was any information there, but when I just checked my sensor it was (“?SLOPE,96.2,92.9,-19.59”) so maybe my calibration techniques aren’t the best :sweat_smile:. With that said, being 4% off on the acidic side (which is what matters to us) would suggest the calibration could be off by a few hundredths, which is fine by me. Calibrating can be a frustrating process and as long as my Atlas Scientific probes line up with my Bluelab portable probe, I’m happy.

However, I’m really curious to see the Slope results on a factory reset sensor so if you decide to go that route please share :grinning:.

So when I reset my calibration, my slope comes out blank as expected:

I was dealing with Jordan at Atlas Scientific who ended up swearing at me and going off on a massive rant in an email, so despite being on the other side of the world I rang them and escalated the issue. Jordan is no longer dealing with it, instead Dmitriy is now helping and has been much better with suggestions.

Their documentation showing:



Meant that I knew I shouldn’t be hitting the Calibrate button, even though that’s what they were telling me to do.
That meant it wasn’t a calibration issue given it’s uncalibrated.

I even hooked it up to their example firmware in Arduino IDE and still was getting this:

Despite it being in 4.0 calibration solution, that part isn’t relevant, it’s the bouncing around that is relevant.

They’ve had me do some tests, like shorting from the internal part of the connector to the external (comes back a steady 7.0). Testing with the probe out of any / all solution, testing without a probe attached at all, testing with the EZO circuit in the end AUX slot instead…

This is the latest suggestion, but it also shows how quick and accurate it should be, taking approx 10s to get 0.01 resolution / stability:

Heck at this point I’d take 0.1 resolution if it was properly stable over 10 seconds, that’s realistically all that I need for my hydroponics setup. Anyways going to get another probe today (I have 6x but going to try another vendors) and get some adaptors to try and hook it up to another Arduino DFRobot kit.

Will keep you posted because it looks like @mrph may well have a similar issue, and Atlas are currently suggesting it’s environmental :man_shrugging:

Appreciate your insights too @HydroRay :slight_smile:

Sooo taking the product physically to another location, and I now get:
image

From what I can gather here it looks like Dmitriy from Atlas Scientific is right, in that there’s some kind of environmental interference with it, and for some reason it only seems to impact the pH?

The EC and Temp have both been happy all along. Accurate as you would expect.

Going to grab the other 5x units I have now and see how they go!

Edit: Shows up nice in HA too:


:exploding_head: So happy to have ~0.03 variation now, mind blown because I never thought I’d get here:
image

Got it calibrated using the button to set at 7.0 and 4.0, matches the Bluelab probe now which is awesome!

Calibration in HA works just fine too. Wish we could get the results of the slope etc without having to have the logger on debug :slightly_frowning_face:
Big progress, so stoked!!

Yes I had the same thought so I did indeed put the temp sensor in the calibration solution and let it stabilize.

Yes I have an esp8266.

@jeremykeen just a quick heads up!

Admittedly, I wasn’t using the Temp Comp feature (when calibrating or in normal use) for EC or pH partly because I remember trying it before and getting results (especially with EC) wayyyyyy off of what it was.

Well, I figured out why and think it might help anyone using the Celsius to Fahrenheit Converter

    filters:
      - lambda: return x * (9.0/5.0) + 32.0;

If you have this in your code I found your temp comp lambda needs to reverse the formula when using Atlas Scientific circuits because they only recognize Celsius.

The temp comp code should be

    on_value:
      then:
        - lambda: id(your_sensor_id).set_tempcomp_value((x - 32) * (5.0/9.0));

Before reversing the formula I ran T,? and found it had set it to 68 (the Fahrenheit reading) instead of 20 (the Celsius reading). The EC reading dropped from around 800 to 450 as soon as I flashed it.

@Chilling_Silence I’m happy to hear that moving physical locations pretty much solved the calibration issues! Maybe it has something to do with humidity or electrical interference? Either way, I’ll try that next time if the readings don’t stablilize.

This thread was of great help, I managed to commission my wifi-pool-kit after all.

Thank you, guys, for all the valuable input. Great job :blush:

The only problem I still face, is the power supply: I started with some knock-off wall warts,

only to find that the readings were all over the place. +/- 0.4ph!

The only way I managed to stabilize the readings, was by using a mobile phone power bank.

Although it would allow me to run the pool kit for about a week, I’d prefer a decent power

supply. I got in touch with Jordan from Atlas Scientific Support and was asking for a recommendation,

but to no avail.

What are you guys using? Any recommendation? I live in South East Asia, so if you could recommend

something I can order from aliexpress and the like, that would be great.

To measure PH the sensor needs “isolation Circuitry” any stray voltages from other sensors, pumps, heaters chillers, lights , static can cause fluctuations.image

I have no experience with EZO but I own several others. I recently built my first esphome with Micro fire ec/ph units and have some thoughts. I also have a Blue Labs ph/ec/temp combi meter for comparison. The Microfire EC/ph/temp kit is $210 (less than 50% of Atlas) but you need an esp32/box ect… and they are both kits.
Justin at Microfire was fantastic has complete yamls , lambdas and esphome he was VERY helpful and I needed it because I have little programing experience.

I am having some problems with calibrating using buttons in HA but I am sure he will assist me with that

You are measuring micro voltage fluctuations here are some suggestions for any ph/ec measurements.
Use better quality probes I suggest “double junction” probes from name brand companies like Blue labs $56-$80, (mine has been submerged for 2+ years) , Milwaukee $40-60. or Hanna $$$
I have had some problems with cheap single junction because I submerge them… and they are not stable. The cheap single junction probes Often called “lab grade” are meant to spend most of their life in the “storage solution” and used momentarily, then stored in storage solution.
If any one knows of a inexpensive EC probe that is reliable please post.
Here is a link to a great article by Texas instruments about ph circuitry if your interested