ArduinoGeneral

DFR0300-H with MCP3008 and Raspberry Pi Issue

userHead Account cancelled 2019-01-16 07:03:50 2838 Views0 Replies
Hello,
I have a new Analog Electrical Conductivity Sensor(K=10)(DFR0300-H) and I am trying to get it to work with an MCP3008 A2D converter, a RaspberryPi and Python coding. The physical setup is fine, I can get a digital reading from the sensor using the MCP3008 A2D. This is also not my first setup using an A2D, I just did an Analog pH probe(other manufacturer). So I am not a total noob to this kind of thing.

I have been trying to get the Python code found at the below link to work.
https://github.com/DFRobot/DFRobot_EC

The issue seems to be that the code was made to be used with the DFRobot_ADS1115 A2D, whereas I am using the MCP3008 chip. I think there is some math that the ADS1115 code is doing that I am missing.

There is this line in "DFRobot_EC_Read.py" that is doing something with the raw digital value read from the A2D that I am not understanding.

#Sets the gain and input voltage range.
ads1115.setGain(ADS1115_REG_CONFIG_PGA_6_144V)

My digital raw readings from the MCP3008 in the 12.88ms/cm Buffer Solution is around 80 (0-1024). So it is working, I just need the right math to do the reading numbers conversions the "DFRobot_ADS1115.py" code is doing. With this, the rest of the "DFRobot_EC.py" library should work.

Does anyone have any experience with this sensor and using an MCP3008 instead of the ADS1115? Better yet do you have any Python for taking readings without the ADS1115?