This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

LMP91200 - VREF is changed

Other Parts Discussed in Thread: LMP91200, ADS1115

Hello,

I created aquarium controller based on arduino where is used LMP91200 for pH measurement. I used default settings for LMP91200, so for VOCM it's 1/2 VREF. For VDD and VREF is used 3.3V directly from arduino 3.3V pin. For reading from VOCM and VOUT is used internal arduino 10-bit ADC, so digital result is from 0 to 1023 (max error is 3.2258mV = 0.05pH).
pH calculation is then 7 + (VOUT - VOCM) *(3300/1023)/ -59.16

My results:
Digital result from VOUT is from 494 to 501 (1594mV - 1616mV)
Digital result from VOCM is from 509 to 513 (1642mV - 1655mV)
Difference between VOUT and VOCM is from -17 to -9, so  pH result is then from 7.49 to 7.93 which is not good for me of course.

120 result for VOUT - VOCM:
-9        3x
-10        8x
-11        18x
-12        9x
-13        16x
-14        36x
-15        18x
-16        9x
-17        3x

For better precission I use software calculation.
120 times is reading from VOUT and VOCM, then kick out 10 highest and lowest values, then divide it by 100.
Then pH result  is from 7.69 to 7.77 (mostly from 7.71 to 7.74) which is already ok for me.

Questions:
- What can be the problem that some results are out? I understand that pH probe can be problem, but something else also?
- Why VOCM is from 509 to 513 if 1/2VREF is 511-512 for 10-bit ADC? I put same 3.3V to another analog pin on arduino for checking VREF and result is always 1023, so fully 3.3V.
- Is it a standard, that need use some software calculation for better precission or I'm totally wrong?

p.s. sorry for my english

  • HI Rastislav,

    most of the noise at VOUT is due to the pH probe and the layout of your board. Are you using the guard pin to shield the signal which is coming from the pH probe ? (in the DS there is an example of layout).

    Regarding the nosie on VOCM, it depends on the dtability of the VDD, for sure if you try to measure it with the ARDUINO supplied at the same voltage you will read 1023. You will read 1023 even if the supply is higher than 3.3V.

    The approach you used to calculate the average is notmally used in pH meters in order to reduce the effect of the envirometal noise.

    regards,

    Domenico

  • Many thanks for answer

    1. yes, i used guard pin, but i'm not sure if correctly, because i use only BNC instead of TRIAX

    whole my project is free and is here: https://github.com/rastocs2/AquariumController (there are also eagle files for pH/ORP)

    2. yes, it's truth that if there will be more than 3.3V there will still result 1023, so in that case i understand when VOCM is 513 instead of 511. But why is VOCM smaller than 1/2VREF e.g. 509 instead of 511 when VDD and VREF are always 1023?

    3. exists some general calculation for reduce noise? i used own simple calculation, but if exists some better i will glad when i can use it.

  • Hi Rastislav,

    the layout seems fine, the usage of the guard pins evan with a BNC is good. In order to reduce or eleimated the common mode noise, you could acquire the VOUT vs VOCM signal with a differential ADC. I do not know if the ARDUINO has a differential ADC inside.

    The VOCM has been though for that purpose.

    The average you have done to reduce the noise is a valid and well accepted method. just for your convenience (microconttoller convenenience) you can select average a number of values which is a power of 2, so instead of 100 reading you could select 128 reading. the division by 128 in the micorcontroller is a simple shift of 7 positions.

    regards,

    Domenico

  • hmm, arduino has no differential ADC, so i used 2 analog pins, but i understand that it's not same like differential ADC.
    so conclusion is, that i can't use LMP91200 with arduino internal ADC for VOUT vs VOCM signal, because there is not differential ADC and i also can't use only VOUT, because arduino ADC don't know negative voltage.
    So what are my possibilities? Is only one way, buy some external ADC and put it between LMP91200 and arduino?

  • Hi Ratislav,

    mine was a sugegstion to improve your measurements (such as one of the ADS111x sigma delta ADC could help).

    But if the results (precision) obtained with the current solution is fine for your application, stay with it.

    regards,

    Domenico

  • So far i tested it only in glass of water (water is from aquarium).
    But today i tried it already directly in aquarium, and results are totally bad.

    When all electric / electronic stuff are turned off (filters, lights, thermostat, ...) results are:
    Digital result from VOUT is from 459 to 536 (1480mV - 1729mV)
    Digital result from VOCM is from 472 to 547 (1522mV - 1764mV)
    Difference between VOUT and VOCM is from -59 to +21, pH result is then from 5.85 to 10.21 which is really strange, because all electric / electronic stuff in aquarium are turned off, so i think it can't be some electronic noise.

    When thermostat and filters are turn on, nothing is changed.
    But when lights are turned on, results are catastrophic:
    Digital result from VOUT is from 0 to 255 (0mV - 822mV)
    Digital result from VOCM is from 413 to 641 (1332mV - 2067mV)
    Difference between VOUT and VOCM is from -580 to -209, pH result is then from -27.95 to -15.52

    So there is something really bad. Maybe pH probe, maybe ADC, maybe PCB with LMP91200? Or something else? Any idea?

  • at anyway, i will test it with ADS1115
    i have to buy it and after testing i will write results
    thanks for idea

  • Hi Ratislav,

    I do not have an aquarium, but can you give to me some details on the electric and electronic stuff you have inside?

    Is there any chance that the water is grounded ? If so you will have problem using the LMP91200 becasue the VOCM which is the baseline of the PH measurement will be put at ground through the ph probe and the water.

    So it means that you generate a ground loop which makes the measurement unuseless.

    So be sure that water insided the aquarium is not grounded.

    regards,

    Domenico

  • Hi Domenico,

    directly in the aquarium is only pH probe, temperature sensor, thermostat and plastic pipe for external filter. I kicked out from aquarium temperature sensor and termostat so from electronic stuff there stayed only pH probe, but result is the same. So it's really strange, because in the aquarium stay only fish, plants, stones, wood and plastic pipe for external filter.

    Maybe i have electric fish :-)