Post Go back to editing

pH and conductivity on a EVAL-AD5940ELCZ (AD5940 chip)

Dear Support,

I'm using with success the CN0428 Water Quality Measurement System with your evaluation software: it's great!

Now, for the project I'm developing I will prefer the AD5940 component to be used with a companion MCU. I've downloaded from your ftp server the examples pack related to the EVAL-AD5940ELCZ, they are very easy to understand and to implement, but I have not been able to find any example regarding the measurement of pH and conductivity, although the BNC suitable for this is present on the board.

Now, since the porting of your examples from ADuCM355 (CN0428) to the EVAL-AD5940ELCZ is not so fast, I wonder if you can provide me with the example code to carry out these measurements on the EVAL-AD5940ELCZ board in an easy and fast way to validate the product.

Regards,

Stefano T



privacy hint
[edited by: Stefano T at 8:38 AM (GMT 0) on 28 Nov 2019]

Top Replies

  • Hi Stefano,

    Thank you for you query. Our latest examples for the AD5940 are located on GitHub.Unfortunately we do not currently have example projects available specifically for pH and conductivity measurements. However we do have a number of application level and block level examples that can be used and modified to carry out pH and conductivity measurements. In the mean time ADI will work to develop custom examples and add them to the SDK.

  • Hi MLambe,

    I have arrived at the same point as Stefano: I'm building a project that will measure pH, EC, and DO on a single card.  By the time I adapted the CN0428 circuitry to my card and connected it with isolators for I2C and all the other control signals to my control MCU, the cost and complexity went through the roof - and the knowledge required to get everything working well included knowing two different MCUs on an intimate basis!  While I'm sure the system would work well, the complexity and cost are too much for my target market.  Also the textual interface to the sensors isn't really needed in this context.

    It looks like the 5940 eval board has the identical sensor interfaces as CN0428, so this should be a software issue only.  I would also vote for any assistance AD can provide in moving the pH and EC code from CN0428 to the AD5940.

  • Hi, 

    Thank you for your feedback. I think Micheal mentioned that they would consider it in the future software update but I am not sure how long the development may take or when are they planning to do this. We will follow up the team regarding this matter and we will let you know if we have an update. 

    Thanks,

    Jellenie 

  • Thanks!  In the meantime, I'm designing my application based on the reference design in the EVAL-AD5940 so when I get around to the software, it will be compatible with that board, but have similar functions to that available in CN0428 (excluding the command interpreter since my entire system is Modbus based..)  I'll look to share that code when it's done.

  • Hello MLambe, 

    I will be working on an ad5941 which will be a companion chip to an MCU.
    I'm going to use this AD5941 to do a conductivity measurement, I can't find an example in the git repo.
    
    Have you developed an example of conductivity measurement or would you have an example to provide me?

    Regards,

    RPaul
  • Hi,

    Ready code for pH measurement is not available for A5941. 

    Reference may be taken from AD5940_EIS , AD5940_Impedance and AD5940_Amperometry

  • HI, I am trying to do  PH measurements for the AD5941 along with Amperometric readings. I do not want to do them simultaneously. But have been struggling to create code for it. Did you perhaps manage to get it working? Do you have any tips or maybe some code that you can share?

    Thanks in advance

  • Hi Akila, what do you mean by taking reference? Could you possibly elaborate more on how to set up the AD5941 to do PH measurement.

    I am working with a EVAL-AD5941ELCZ board. 

    I have tried taking the output from the High Z Channel. Which is connected to AFE4 to the ADC. But the results were very unpredictable and did not seem correct.

    I have also tried setting up a sequencer and FIFO for doing the reading but again the results were unpredictable.

    Please could you give some guidance on how to move forward. 

  • Hi,

    AD5940 and ADuCM355 have same analog front end, same library files and functions . (Only difference is ADuCM355 has built in cortex M3 processor).

    Below water quality measurement example explains pH, ORP and conductivity measurements taken by ADuCM355: 

    aducm355-examples/examples/ApplicationExamples/M355_WaterQuality at master · analogdevicesinc/aducm355-examples (github.com)

    The above example does EIS measurements for calculating pH and conductivity of water. 

    AD5940_EIS example is available in Github: ad5940-examples/examples/AD5940_ECSns_EIS at master · analogdevicesinc/ad5940-examples (github.com)

    In case you are opting for CN0428:

    GUI for CN0428:

    Below are the EIS outputs obtained with loads= resistors mentioned:

     

    Console output:

    Please wait for sensor startup and initialization:

    ...........

    Sensor in site 1: 0x04 initialization error. Address 0x0A!

    Water Quality Sensor in site 2 initialized successfully. Address 0x0B!

    Sensor in site 3: 0x04 initialization error. Address 0x0C!

    Water Quality Sensor in site 4 initialized successfully. Address 0x0D!

    ----------------------------------------------

    Sensor Site: 2!

     

    Available commands:

    help                   - Display available commands

    sensortype <type>      - Change the type of sensor that is connected (default:pH).

                              <type> = ph, conductivity, orp

    measuretemp            - Measure and print current temperature value

    measuresensor          - Make sensor measurement for configured sensor (pH, conductivity, orp)

    measureeis             - Perform EIS sweep on sensor and estimate sensor health

                              add optional argument bode to print bode instead of nyquist plot

    printhealth            - Print sensor health value from last EIS measurement

    printtemp              - Print temperature without updating (i.e., temp of last sensor meas)

    printconfig            - Print configuration (sensortype, hizmode, temperature enabled)

    printserialnumber      - Print ADuCM355 unique ID (can be used to store calibrations)

    enabletemp <en>        - Enable/disable temperature sensor channel.

                              <en> = 1 to <en> = 0 to disable

    enablehizmode <en>     - Enable/disable high-impedance TIA. Ensure S2 matches this setting

                              <en> = 1 to <en> = 0 to disable

    setmineisfreq <freq>   - Set minimum frequency for eis measurement

    setmaxeisfreq <freq>   - Set minimum frequency for eis measurement

                              <freq> = 0.1 to 200000 or full to set to full range

    renamesensor <name>    - Rename the sensor.

                              <name> = new name (<16 characters)

    switchsensor <site>    - Switch to sensor board at <site>.

                              <site> = 1, 2, 3, 4. Channel num of the sensor board to switch to

     

    Switching to site 4

    Unknown command!

     

    Min EIS Frequency set to 5.00 Hz

     

    Max EIS Frequency set to 5000.00 Hz

     

    Starting EIS Measurement. This will take about 30 seconds.

    Impedance Result:

    Frequency,Real,-Imag,RCAL

    5.0068,74837.2813,114.1749,199622.2656

    9.9987,74497.7031,-31.2605,199604.0938

    19.9974,74527.2578,12.1449,199454.0781

    49.9934,51150.6445,-2530.8601,199493.2656

    94.9949,74706.9766,-183.9579,199558.3125

    255.0036,74429.9609,766.3658,199350.9063

    499.9936,74643.3906,-571.4081,200061.4063

    1000.0020,74908.1328,-839.3597,203186.4375

    2000.0040,74319.7656,1382.7277,199538.2500

    4999.9951,74456.6875,4562.1367,202153.5938

     

    Min EIS Frequency set to 0.10 Hz

     

    Max EIS Frequency set to 500.00 Hz

     

    Starting EIS Measurement. This will take about 30 seconds.

    Impedance Result:

    Frequency,Real,-Imag,RCAL

    0.1937,1205642.8750,-15068.6465,199742.7344

    0.4023,1197008.1250,-6450.7095,199705.0000

    0.8047,1184479.7500,-69199.2734,199676.8750

    0.9984,1188097.0000,-97191.0703,199705.5000

    1.9968,1196194.8750,9092.7646,199696.5938

    5.0068,1192823.7500,33223.5078,199714.8125

    9.9987,1189646.1250,1469.7908,199677.3750

    19.9974,1188058.0000,8788.7158,199648.7344

    49.9934,-22516.5957,-133157.4688,199650.5000

    94.9949,1181152.1250,-70229.0391,199757.4531

    255.0036,1183120.7500,334932.0938,199520.4063

    499.9936,1260771.7500,-167080.5938,200293.7500

     

     

    Note: Measurement at 50Hz (49.9934 Hz) is ignored (power supply rejection).