4-20mA current loop transmitter with Particle Photon

I have a 4-20mA Current Loop Transmitter that I want to hook up to a 4-20mA 7-segment display.
I have a Particle photon plugged into a screw terminal breakout board, which has a cable connected to the 4-20mA transmitter.

I can’t get the mA to change on the MCP4725, no matter what I do.
I have a scope connected to the SDA & SCL lines on the breakout board and I’m decoding the I2c bus and it looks like it’s sending the signals that it’s supposed to. (see pic)
I’ve also tried all the code snippets from here and here.
When I do a search for I2c devices on the network, it returns two devices, 0x60 and 0x61, I’m not sure why I’m getting two different address if I only have the 4-20mA transmitter attached, but I have tried to write to both address.

I’m not sure what else I should try. any ideas?

Hi,
Do you have loop power supply ?
Could you post a picture of your setup?

Thanks

Yes, I have a 24v hooked up to TB2-1 and TB2-2 and 24v+ going to one of the terminals on the MCP4725 and the other terminal going to TB1-1 on the display. (I have a voltmeter hooked up in series just for testing.)

can you see any current readings on the multimeter ?
could you share the code link.

Thanks

Yes, it reads 12.24mA and it doesn’t change.
the code I currently have running is this…
I’ve also tried leaving out the setSeed() as well as the #include<Wire.h>
the include statement isn’t needed on the photon.

#include <Wire.h>
void setup()
{
  Serial.begin (9600);
  Wire.setSpeed(400000);
  Wire.begin();
 
}
void loop()
{
/// at DAC vlaue 290 the current output will be around 4mA and 
///at DAC vlaue 1500 the current output will be around 20mA 
/// you can change these values to tune the 4-20mA output
 for (int i=290; i <= 1500; i++)
  {
  Wire.beginTransmission(0x60 );
  Wire.write(64); 
 // Wire.write(64); 
  Wire.write(i >> 4);        // 8 MSB
  Wire.write((i & 15) << 4); //4 LSB
 
  delay(100);
  Serial.print("4-20mA current trnasmitter output ");
  Serial.println(i*0.013);
  Serial.print("\n");
  Wire.endTransmission();
  }
}

in that case i will suggest looking into the wiring.
the code you are using is correct.

Hello. Was this issue resolved? If so can someone please provide feedback on how this was fixed. I have exactly the same problem with an Arduino Micro and the 4-20 ma loop transmitter. When looking for I2C devices the return is 0x60 and 0x61. The only difference is that I can change the ma between 4 -20 but regularly get error 2 as a return. I’m assuming this related to the address changes. Really appreciate feedback on this please

best regards

Peter

Hi,
do you have the address jumper installed on the 4-20mA board?
is there any other i2c devices in the chain as well?

Thanks

Hi Bhaskar. I have tried with and without the jumper and with and without other devices on the bus I have an ADC which I’ve disconnected for testing. In all situations the flipping of the address happens however the ADC address remains stable. (0x48) If the loop is not connected to anything then the address remains stable on 0x60. As soon as its connected to a load and supply (even a 9v battery) the address changes happen.

btw for now I’ve modified the writing routine to write to both addresses in case of error and that results in no more errors. I would prefer however to have a stable address. Could it be that the address selector is floating and allows interference to change the address? Should I ground or connect any of the jumper pins if I don’t need to have both addresses?

you can install the address jumper and it will fix to one address.
You can post a picture of your setup as well. will take a look and make sure everything looks good.

Thanks

Hi Bhaskar

The adress switching behaves the same with or without the jumper installed. Without the jumper most of the addresses are 0x60 and with jumper most are 0x61. I’ve used the reference diagram for connecting power and a load resistor, no earthing and a seperate power supply. Leads are very short. Even with a dc battery the adress flips between the two. I will post a picture later. Thanks Peter

I’m having the same problem with a transmitter attached to a Raspberry Pi. More worryingly, not only is its address flipping around, it occasionally disappears altogether for several seconds (does not show up in the results of i2cdetect/write attempts result in an I/O error suggesting a non-present device). And I can’t just blindly write to both 0x60 and 0x61 until I get through: I need to control two transmitters simultaneously, with significant real-world effects if I change the wrong thing at the wrong time.

I’ve tried powering the unit from both the +5V rail on the RPi and two separate bench supplies, so I am fairly confident that power isn’t the issue. Any other ideas?

i will conduct a test over here
can you confirm your Pi module version so i can test on same hardware.

also can you measure the voltage at the address jumper(A0)?

Thanks

It’s a Raspberry Pi 3 Model B (not a B+). I’m using the Adafruit 757/BSS138 level shifter; its reference voltages are the 3.3V/5V outputs from the Pi; the 5V output measures 4.964V.

With an external 5V supply powering the transmitter and no loop connected, I see 4.935V across the GND/+5V pins and 4.928V across the pins of the A0 jumper. With a 12V loop connected, the voltages rise to 4.985V across GND/+5V and 4.980V across A0. I’m using an external power supply for the transmitter now, but I saw the same problem when it was powered off of the 5V output of the Pi.

Thanks.

the address changes when the A0 pin state changes.
The issue is that that board has 2 grounds and they are coming together through the Address line and its changing the address.
We can do two things

  1. repair the boards by separating the address ground( can be done in few minutes)
  2. replace the boards with new boards ( it will be take around couple of weeks)

Thanks

Thanks for investigating.

Can you describe in detail the modification required to separate the grounds? We have several skilled electrical assembly technicians on staff who can almost certainly do the work in-house.

Remove RN1 ( near i2c in connector)
to set the address to 0x60 do this

to set the address 0x61 do this

let me know if you have any questions.
Thanks

Thanks. I’ll try this and let you know.

feel free to post a picture before powering up the device.
Dont forget removing RN1.

We’ve successfully modified both boards (after first testing one). Seems to work well. Thank you for the help.

If we need to order more, by when can we expect that orders for this unit will ship with a fix for this issue in place?