Page 1 of 1
Convert value
Posted: Wednesday 28 June 2017 20:58
by Artic1980
Good evening I'm trying to read the pH of the pool but I can not convert the value into ph.
I that 2.5v correspond to 7ph and 3.05 to 4ph how can i convert it?
The sensor is connected to an asd1115 and an esp8266
thank you
Re: Convert value
Posted: Thursday 29 June 2017 10:01
by Domosapiens
Assuming the sensor is linear, you have something like this,
where x is Volt and looking for y as Ph
So the formula is:
y=a+bx
You posted 2 answers for the formula:
7=a+2.5b (1)
4=a+3.05b (2)
Rework (1)
a=7-2.5b
Substitute in (2)
4=7-2.5b+3.05b
Calculate b=-5.4545
Substitute in (1)
Calculate a=20.6363
Your formula:
y=20.6363-5.4545b
In practice:
To get Ph: read the Voltage, multiply by 5.4545 and subtract it from 20.6363
But first do some input checking:
0V gives a Ph of 20 (rubbish!)
More than 3.78V gives a Ph lower than 0 (rubbish!)
Note 1:
the - sign for b gives a negative slope: the more volt, the lower the Ph
so .. the slope in the picture is just an example of a positive slope
Note 2:
Calculations with 1 decimal will be sufficient
Re: Convert value
Posted: Saturday 01 July 2017 21:36
by Artic1980
Thanks a lot tomorrow text
Inviato dal mio iPhone utilizzando Tapatalk
Re: Convert value
Posted: Sunday 02 July 2017 20:14
by Artic1980
Now is perfect. Thank
Inviato dal mio iPhone utilizzando Tapatalk