Conductivity data logging HELP please

Hello everybody,

I have a conductivity transmitter: https://sensorex.com/product/cx3100-high-temp-boiler-controller/
And I would like to use my Arduino board to log all the data.
The transmitter has four 4-20 mA slots, 2 for temperature and 2 for conductivity (which I don't know if necessary to use).
I would like to know how to collect the same data that is presented on the transmitter's screen.
The following is the instruction manual: https://sensorex.com/docs/instructions/InstrCX3100.pdf

I'd appreciate any type of help!

To read a 4-20 mA sensor output using a 5V Arduino, most people use a 250 Ohm resistor and measure the voltage drop V2 across it (1-5V), using the ADC.

The connection shown below requires the resistor to be between the (+) and (-) of your isolated transmitter output, and for the transmitter GND (-) and the Arduino GND to be connected.

You will need to correctly scale the ADC output to match the sensor data, before logging.
4_20mA.png
In the above, optional components are C1 for noise reduction and R2 to protect the analog input from possible overvoltage.

4_20mA.png

Thank you very much for your response jremington!

What I did so far is connecting two 250 ohm resistors, 1 between cell 12-13 and one between cells 10-11. I then connected the wires coming from cells 11 and 13 to the Arduino's analog ins, and 10 and 12 to the Arduino's grounds.

I tried to use the Map function in the IDE but could not get the correct values. Could you please help me in understanding how to scale the data correctly? ( The probe measures temps 0-200C and conductivity 0-2000 mS/cm)

Thank you very much

tal67000:
I tried to use the Map function in the IDE but could not get the correct values. Could you please help me in understanding how to scale the data correctly? ( The probe measures temps 0-200C and conductivity 0-2000 mS/cm)

Thank you very much

Post your code (in code tags, please), and also a link to the probe specifications.

Adafruit has a good tutorial on calibration.

Hi aarg,

This is the link for the probe: https://sensorex.com/docs/instructions/InstrCX3100.pdf

I am still working on the code. I took most of it from one source.

void setup() {

Serial.begin(9600); // the bigger number the better

Serial.println("CLEARDATA"); //clears up any data left from previous projects

Serial.println("LABEL,Time,Time pass, Temp,Conductivity"); //always write LABEL, so excel knows the next things will be the names of the columns (instead of Acolumn you could write Time for instance)

Serial.println("RESETTIMER"); //resets timer to 0

}

void loop() {
int conductivity = analogRead(A4);
int temperature = analogRead(A0);
int volToCon = map(conductivity,0,1023,0,20000);
int volToTemp = map(temperature,0,1023,0,190);
Serial.print("DATA,TIME,TIMER,"); //writes the time in the first column A and the time since the measurements started in column B

Serial.print(volToTemp);



Serial.println(volToCon); //be sure to add println to the last command so it knows to go into the next row on the second run

delay(5000); //add a delay

Print the raw values you're getting from the analogReads. What do you get on the display at the same time?

This is not the correct mapping for a 4-20 mA sensor:

int volToCon = map(conductivity,0,1023,0,20000);

I attached both raw and mapped data below. How should the mapping look like?
This data corresponds to 0.00 conductivity and 21.3 C.

Hard to say with only one data point. What does it show over a range of readings?

Is it too much trouble to look at the tutorial linked in reply #4, or do forum members need to hold your hand the entire way?

Jremington, I attempted to do the one and two point calibration. If I need to check my analog input for the calibration, do I still have to use the 250 ohm resistor? Or could I use a 220 ohm instead and calibrate accordingly? (or is it important to protect the Arduino board?)
Lastly, just to make sure, if I do that I don't have to use the Map function correct?

Thanks

You will waste available output range and measurement precision using a 220 Ohm resistor.

With 1-5V input, you expect an ADC output range (with 250 Ohms) of about 818 ADC points between 205 and 1023, and (with 220 Ohms) about 720 ADC points between 180 and 900.

One point calibration is not possible, because you don't know the zero point. Multipoint calibration is ALWAYS better than one or two point.

I see, thank you for the explanation. Isn't there an easier way to capture the data from the device?
The conductivity and the temperature already appear on the transmitter's screen. Isn't it possible to get that to excel?

A close reading of the user manual should reveal your options.

Jermington -- If you don't want to help, you don't have to respond. I already read the manual and found the part on PLC, prior to posting on this forum. If that's what you're referring to, do I need a PLC controller or could I connect the transmitter to my PC using Arduino? Thanks

I can't be bothered to read the manual for you. PLC is not an Arduino topic.

I have taken the time to explain how you use the provided 4-20 mA transmitter to send data to the Arduino, which is quite straightforward, but you seem to be too lazy to follow through.

If you want to pay someone to help with Arduino, post on the Gigs and Collaborations forum section.

Bye.

Isn't there an easier way to capture the data from the device?
The conductivity and the temperature already appear on the transmitter's screen. Isn't it possible to get that to excel?

Based on my reading of the manual, there is no way to do that.

You will need to read the 4-20 ma outputs with the analog reading of the voltage drop across 250 ohms.

If your issue is finding a precision 250 ohm resistor, you can certainly use the 220 ohm ones that you have.

Substituting the 220 ohm would give voltages:

@20mA: V=IR = 0.02 × 220 = 4.4V
@4mA: V=IR = 0.004 × 220 = 0.88V

cattledog:
If your issue is finding a precision 250 ohm resistor...

Useless to find a precision resistor, unless you also power the Arduino with a precision supply of 5.000volt.
Any variation in the supply voltage will also show up in the readout.
OP might be using a Nano, which is about 8% off.

Better use a 51ohm resistor, and the internal 1.1volt Aref (assuming Uno).
Must be calibrated (like the setup with the 250 ohm resistor), but at least it will stay stable when changing supply.
Post 9 here.

Might have to use a different sense resistor value for other Arduinos.
Always give us all the facts.
Leo..