PH Sensor temp adjustment
Moderators: grovkillen, Stuntteam, TD-er
PH Sensor temp adjustment
Hi all,
thank you for this project!
I have recently bought this ph sensor with the included bnc board : https://nl.aliexpress.com/item/10050016 ... 4c4duSIvfn
Also an ads1115 to connect it to my esp8266 without any issues. It should read fine.
I have read that it should be calibrated with the buffer solutions, so i bought these along. Some questions:
- The board has screws for calibration. Should i do this in espeasy or should i do it with the 2 screws (please a bit of explenation on the 2 screws.)
- The temperature has influence on the ph readings. Should i wire the ds18b20 directly on the bnc board to provide calibration?
thank you for this project!
I have recently bought this ph sensor with the included bnc board : https://nl.aliexpress.com/item/10050016 ... 4c4duSIvfn
Also an ads1115 to connect it to my esp8266 without any issues. It should read fine.
I have read that it should be calibrated with the buffer solutions, so i bought these along. Some questions:
- The board has screws for calibration. Should i do this in espeasy or should i do it with the 2 screws (please a bit of explenation on the 2 screws.)
- The temperature has influence on the ph readings. Should i wire the ds18b20 directly on the bnc board to provide calibration?
Re: PH Sensor temp adjustment
Calibration information for the two pots: https://www.botshop.co.za/how-to-use-a- ... nd-sensor/The board has screws for calibration. Should i do this in espeasy or should i do it with the 2 screws (please a bit of explenation on the 2 screws.)
- Thomas
Re: PH Sensor temp adjustment
Thanks man, great guide!ThomasB wrote: ↑05 Aug 2021, 17:52Calibration information for the two pots: https://www.botshop.co.za/how-to-use-a- ... nd-sensor/The board has screws for calibration. Should i do this in espeasy or should i do it with the 2 screws (please a bit of explenation on the 2 screws.)
- Thomas
Re: PH Sensor temp adjustment
should this diagram be considered to be working or would i need a level converter?
Re: PH Sensor temp adjustment
What is the analog output level of the sensor?
Also make sure to check if the 5V pin actually has 5V if you power it like you want to power it.
Also make sure to check if the 5V pin actually has 5V if you power it like you want to power it.
Re: PH Sensor temp adjustment
The PH sensor would output 5V. some said that it doesn't matter for the digital pins sice the ads1115 will convert it to a digital signal.
Would need to check if it's 5v indeed. according to documentation, it should... I will power it with a 5v1a adapter .
Would need to check if it's 5v indeed. according to documentation, it should... I will power it with a 5v1a adapter .
Re: PH Sensor temp adjustment
The ADC chip might be capable to capture higher voltages, but better check in the datasheet.
On the other hand, converting an analog voltage into a lower voltage is very easy using 2 resistors.
On the other hand, converting an analog voltage into a lower voltage is very easy using 2 resistors.
Re: PH Sensor temp adjustment
indeed true, with a voltage divider. But the ads1115 should be doing fine since it accepts 5V. question is if a I2C level converter is recommended/needed.
Re: PH Sensor temp adjustment
I don't think so, as you power the ADC with 3v3, so the SDA and SCL will probably be pulled up to that level.
Re: PH Sensor temp adjustment
Thanks! Wiring seems fine ?
some other forums recommended it since it would improve accuracy, but i don't see where this would be improved tho.
some other forums recommended it since it would improve accuracy, but i don't see where this would be improved tho.
Re: PH Sensor temp adjustment
Well, personally I would have chosen to only use a single GND line.
Having multiple wires/traces with the same net may cause other issues.
Better to think of the GND and Vcc as a star than a loop.
Also it is good practice to add a small capacitor over the V+ and GND on each chip, as close as possible to the chip itself.
Typical value for this is 100 nF.
Especially for chips handling analog signals.
And you may want to add 2 pull-up resistors over the SDA and SCL lines to 3v3.
Typical values for the I2C pull-up resistors are 10k or 4k7. Doesn't really matter though.
Having multiple wires/traces with the same net may cause other issues.
Better to think of the GND and Vcc as a star than a loop.
Also it is good practice to add a small capacitor over the V+ and GND on each chip, as close as possible to the chip itself.
Typical value for this is 100 nF.
Especially for chips handling analog signals.
And you may want to add 2 pull-up resistors over the SDA and SCL lines to 3v3.
Typical values for the I2C pull-up resistors are 10k or 4k7. Doesn't really matter though.
Re: PH Sensor temp adjustment
Thank you!
All of this is still a work in progress so all can change
So wire the gnd together so it only used 1 pin on the ESP?
And the two pull up resistors could be exchanged by a level converter ? Have some lying around
All of this is still a work in progress so all can change
So wire the gnd together so it only used 1 pin on the ESP?
And the two pull up resistors could be exchanged by a level converter ? Have some lying around
Re: PH Sensor temp adjustment
The pull-up resistor is not a level converter.
It is to literally pull up the I2C signal levels, so all I2C devices pull the signal low when needed.
Just one example:
It is to literally pull up the I2C signal levels, so all I2C devices pull the signal low when needed.
Just one example:
Re: PH Sensor temp adjustment
Hi
had constructive discussions on how to use this pH sensors in another forum.
Why are you using level shifters?
the pcb of the ph Sensor has everthing onboard. You have two trimmer for calibration. One is used to shift the voltage in the positive area with a miminum of 0V.
By default this ph sensor boards uses negative and positive voltage level. ph value of 7 is normally 0V. 414mV is for pH value of 0 and -414mV is for pH value of 14. To make it measurable for the ESP analog input or better the ADS1115 you have to shift this linear function into the positive area by increasing the offset by one of the trimmer.
The other trimmer is used to define the maximum voltage output level. When you are powering the ADS1115 with 3,3V the maximum input voltage is 3,6V.
After this the ADS1115 can be used in single-end mode and the gain before the AD-converter is to be set for FS=4V.
You have a 16 Bit chip. this means a fix resolution of 65535 Bits.
Using FS=4V means 32767 Bits for the positive voltage area from 0V to 4V with an LSB=125uV
So for calculation to Volts you can use: value x 125uv = Analog Input Value in Volt
Because of this very low voltage input levels I would say this measurement includes to much noise etc. that has nothing to do with the voltage from the pH sensor.
So decreasing the sensitivity will have an positive effect for your results. Doing this by selecting FS=6V means an LSB=185uV and decreases sensitivity by 50%
For calculation this means: value x 185uV = Analog Input value in Volt
Of course, a direct conversion to pH valvues is also possible by using the formula. But please think about the usablity auf decimals. Out of my current understanding only one decimal might be usable. Even by using FS=6V you are still acting in mV areas and i do not believe that gives really usable results by looking to results based on 10mV resultion because the whole quality of measuremt do not have this possibility.
Best regards.
had constructive discussions on how to use this pH sensors in another forum.
Why are you using level shifters?
the pcb of the ph Sensor has everthing onboard. You have two trimmer for calibration. One is used to shift the voltage in the positive area with a miminum of 0V.
By default this ph sensor boards uses negative and positive voltage level. ph value of 7 is normally 0V. 414mV is for pH value of 0 and -414mV is for pH value of 14. To make it measurable for the ESP analog input or better the ADS1115 you have to shift this linear function into the positive area by increasing the offset by one of the trimmer.
The other trimmer is used to define the maximum voltage output level. When you are powering the ADS1115 with 3,3V the maximum input voltage is 3,6V.
After this the ADS1115 can be used in single-end mode and the gain before the AD-converter is to be set for FS=4V.
You have a 16 Bit chip. this means a fix resolution of 65535 Bits.
Using FS=4V means 32767 Bits for the positive voltage area from 0V to 4V with an LSB=125uV
So for calculation to Volts you can use: value x 125uv = Analog Input Value in Volt
Because of this very low voltage input levels I would say this measurement includes to much noise etc. that has nothing to do with the voltage from the pH sensor.
So decreasing the sensitivity will have an positive effect for your results. Doing this by selecting FS=6V means an LSB=185uV and decreases sensitivity by 50%
For calculation this means: value x 185uV = Analog Input value in Volt
Of course, a direct conversion to pH valvues is also possible by using the formula. But please think about the usablity auf decimals. Out of my current understanding only one decimal might be usable. Even by using FS=6V you are still acting in mV areas and i do not believe that gives really usable results by looking to results based on 10mV resultion because the whole quality of measuremt do not have this possibility.
Best regards.
Re: PH Sensor temp adjustment
Hi i've sent you a pm but still in my outbox!Oetsch wrote: ↑12 Aug 2021, 16:13 Hi
had constructive discussions on how to use this pH sensors in another forum.
Why are you using level shifters?
the pcb of the ph Sensor has everthing onboard. You have two trimmer for calibration. One is used to shift the voltage in the positive area with a miminum of 0V.
By default this ph sensor boards uses negative and positive voltage level. ph value of 7 is normally 0V. 414mV is for pH value of 0 and -414mV is for pH value of 14. To make it measurable for the ESP analog input or better the ADS1115 you have to shift this linear function into the positive area by increasing the offset by one of the trimmer.
The other trimmer is used to define the maximum voltage output level. When you are powering the ADS1115 with 3,3V the maximum input voltage is 3,6V.
After this the ADS1115 can be used in single-end mode and the gain before the AD-converter is to be set for FS=4V.
You have a 16 Bit chip. this means a fix resolution of 65535 Bits.
Using FS=4V means 32767 Bits for the positive voltage area from 0V to 4V with an LSB=125uV
So for calculation to Volts you can use: value x 125uv = Analog Input Value in Volt
Because of this very low voltage input levels I would say this measurement includes to much noise etc. that has nothing to do with the voltage from the pH sensor.
So decreasing the sensitivity will have an positive effect for your results. Doing this by selecting FS=6V means an LSB=185uV and decreases sensitivity by 50%
For calculation this means: value x 185uV = Analog Input value in Volt
Of course, a direct conversion to pH valvues is also possible by using the formula. But please think about the usablity auf decimals. Out of my current understanding only one decimal might be usable. Even by using FS=6V you are still acting in mV areas and i do not believe that gives really usable results by looking to results based on 10mV resultion because the whole quality of measuremt do not have this possibility.
Best regards.
Re: PH Sensor temp adjustment
Hmm I've not seen any
If you can't send it via DM, you can also try email?
If you can't send it via DM, you can also try email?
Re: PH Sensor temp adjustment
it's to Oetsch
Re: PH Sensor temp adjustment
Oh sorry and I normally only log in in case I want to write sth. so have not seen your messages.
But now hope you got an answer from me
But now hope you got an answer from me
Re: PH Sensor temp adjustment
No worries! Responded
Re: PH Sensor temp adjustment
Hi all!
at the end, the sensor board seemed to be broken, so I ordered a new one, which is working in esphome with readable ph outputs. How can I convert this to es-easy? I tried it with the ads plugin, set to gain of 6 but only gave me negative values.
esphome:
name: pool
platform: ESP32
board: nodemcu-32s
i2c:
sda: 22
scl: 21
scan: true
id: bus_a
ads1115:
- address: 0x48
sensor:
- platform: ads1115
multiplexer: 'A0_GND'
gain: 6.144
name: "Po A0"
unit_of_measurement: "V"
state_class: "measurement"
update_interval: 1s
- platform: ads1115
multiplexer: 'A0_GND'
gain: 6.144
name: "pH measurement"
unit_of_measurement: "pH"
state_class: "measurement"
update_interval: 1s
filters:
- calibrate_linear:
- 0.00 -> 0.0
- 2.50 -> 7.0
- 5.00 -> 14.0
- platform: ads1115
multiplexer: 'A1_GND'
gain: 4.096
id: do_measurement
name: "Do A1"
state_class: "measurement"
unit_of_measurement: "V"
update_interval: 1s
- platform: ads1115
multiplexer: 'A2_GND'
gain: 6.144
name: "To A2"
state_class: "measurement"
update_interval: 1s
binary_sensor:
- platform: analog_threshold
name: "Above set pH"
sensor_id: do_measurement
threshold: 2.41
at the end, the sensor board seemed to be broken, so I ordered a new one, which is working in esphome with readable ph outputs. How can I convert this to es-easy? I tried it with the ads plugin, set to gain of 6 but only gave me negative values.
esphome:
name: pool
platform: ESP32
board: nodemcu-32s
i2c:
sda: 22
scl: 21
scan: true
id: bus_a
ads1115:
- address: 0x48
sensor:
- platform: ads1115
multiplexer: 'A0_GND'
gain: 6.144
name: "Po A0"
unit_of_measurement: "V"
state_class: "measurement"
update_interval: 1s
- platform: ads1115
multiplexer: 'A0_GND'
gain: 6.144
name: "pH measurement"
unit_of_measurement: "pH"
state_class: "measurement"
update_interval: 1s
filters:
- calibrate_linear:
- 0.00 -> 0.0
- 2.50 -> 7.0
- 5.00 -> 14.0
- platform: ads1115
multiplexer: 'A1_GND'
gain: 4.096
id: do_measurement
name: "Do A1"
state_class: "measurement"
unit_of_measurement: "V"
update_interval: 1s
- platform: ads1115
multiplexer: 'A2_GND'
gain: 6.144
name: "To A2"
state_class: "measurement"
update_interval: 1s
binary_sensor:
- platform: analog_threshold
name: "Above set pH"
sensor_id: do_measurement
threshold: 2.41
Re: PH Sensor temp adjustment
Just based on this line: "multiplexer: 'A0_GND' "
To me it looks like ESPHome is then scaling it as an absolute value ranging from 0 ... (X-1)
If I'm not mistaken, ESPEasy configures the chip to have a range from -Y ... (Y-1) where Y is typically half of X.
So what you can do, is to add Y to the measured values before applying your calibration.
Have to check what Y is for this sensor, but I think it is 32768. (half the range of a 16-bit ADC)
So in your formula you can do something like this:
With N being the factor you need to get the right scale.
Not sure if you also need something else to get the right usable value?
To me it looks like ESPHome is then scaling it as an absolute value ranging from 0 ... (X-1)
If I'm not mistaken, ESPEasy configures the chip to have a range from -Y ... (Y-1) where Y is typically half of X.
So what you can do, is to add Y to the measured values before applying your calibration.
Have to check what Y is for this sensor, but I think it is 32768. (half the range of a 16-bit ADC)
So in your formula you can do something like this:
Code: Select all
(%value% + 32768) * N
Not sure if you also need something else to get the right usable value?
Who is online
Users browsing this forum: No registered users and 2 guests