Wiring multiple 4-20mA signals to arduino uno

Hi, @avogadrosmole

With everything disconnected from the sensor, measure the resistance between;

Temp output positive and PH output positive terminals.

Then

Temp output negative and PH output negative terminals.

Thanks.. Tom.. :smiley: :+1: :coffee: :australia:
PS. I suspect the two positives are connected together.

Yes, I do

You were correct. With everything disconnected I got a O.L between the two negative terminals but a 0.4 ohm reading between the two positive terminals.

Thanks, I was thinking along the same lines. I have not found din rail mountable DPDT relays that have a 5V coil rating. I used two relays instead to get the job done.

I've attached a wiring schematic for what I did. I realized after making this, I should only need one 220 ohm resistor that can be connected between the two relay com wire connections... oh well, this still works.

I used the following code to get accurate signals from both outputs:

int g_relayPin = 11;
int sen_relayPin = 9;
int sense_pin = 5;

float vPow = 5;

String pH_str = "P,";
String Temp_str = "T,";
String term = ",";

void setup() {
  Serial.begin(115200);
  pinMode(sen_relayPin, OUTPUT);
  pinMode(g_relayPin, OUTPUT);
}

void loop() {
  
  float pH = (analogRead(sense_pin) * vPow)/1024.0;
  pH = (analogRead(sense_pin) * vPow)/1024.0;
  Serial.print(pH_str);
  Serial.print(pH);
  Serial.println(term);

  digitalWrite(sen_relayPin, HIGH);
  digitalWrite(g_relayPin, HIGH);
  delay(500);
  
  float Temp = (analogRead(sense_pin) * vPow)/1024.0;
  Temp = (analogRead(sense_pin) * vPow)/1024.0;
  Serial.print(Temp_str);
  Serial.print(Temp);
  Serial.println(term);
  
  digitalWrite(sen_relayPin, LOW);
  digitalWrite(g_relayPin, LOW);

  delay(500);
}

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.