Cannot get output from 4-20mA transmitter

Hi, I am not getting any output for channel 1 on my 4 channel transmitter. I can detect the device I2C ID as 0x0c but the following Python code does not produce any output. The transmiiter is powered by a 12v supply and the psu in the output circuit is 24v. Please help as I am under a serious time constraint: PS - I’ve posted this on the hardware thread as well - sorry for any duplication. Thanks in advance:

import smbus
import time

Get I2C bus

bus = smbus.SMBus(1)

while True:
for i in range(0,4095):
data1 = (i>>4)
data2 = (i&15)<<4
data = [data1, data2]
bus.write_i2c_block_data(0x60, 0x31, data)
#bus.write_byte_data(0x0c, 0x31,data1)
#bus.write_byte_data(0x0c, 0x31,data2)
time.sleep(0.01)
print ("Writing on DAC %d DAC value " %i)
i = i+1

Hi,
Can you share a picture of your setup ?

Thanks

Thanks for the swift reply. It is all pretty straightforward - RPi can see the tx 4 ch board which is powered from a 12v separate supply and the ch 1 output is wired as COM to 24v GND and return from valve is wired to tx board channel 1 signal. However, but there is zero current on output of the transmitter board (which incidentally I bought last week).

Can you check that the addresses I’ve used in the code are correct please because some sample code out there uses different addresses.

Also should I remove the valve and replace it with resistor or would you recommend an alternative so that there is nothing in play other than the transmitter board?

Thanks again.

Hi John,
Your wiring is correct.

The issue is with the code.
The i2c address is 0x0C not 0x60.

and the range will go
for i in range(400,2100)

Thanks

Hi Bhaskar,

Still no output with address 0x0c on either channel1 (0x41) or channel2 (0x42).
I also confirmed that the RPi I2C bus is functioning reading from another sensor.
So if my addresses and code are correct then I need to eliminate the valve - is there a standard load test that you do that I can try?
Again thank you for your kind help,
John D

Hi John,
Can you share the code you are using now ?

Thanks

Hi Bhaskar,

In answer to your question I have pasted in my code below - addresses are now correct. Now if I replace the valve with 2.7k resistor I can see the mA rise and then stop at 7.2mA. So at least the board is functioning thus far. The problem with the valve is that it does not appear to have a return wire that would allow me to complete the loop: signal to valve, valve to +PSU and -PSE to COM. The valve details are at: https://www.festo.com.cn/net/SupportPortal/Files/699030/VEAB_instruction_2020-02c_8117707g1.pdf

I know this is not your problem but have you seen such a setup before?

Thanks for your help.
John D

import smbus
import time

Get I2C bus

bus = smbus.SMBus(1)

0x0c — i2c address

0x31 – DAC cahnnel one

while True:
for i in range(400,2100):
data1 = (i>>4)
data2 = (i&15)<<4
data = [data1, data2]
bus.write_i2c_block_data(0x0c, 0x31, data)
print ("Writing on DAC %d DAC value " %i)
i = i+1

Hi John,
I dont have any exp working with this kind of sensor. Generally these sensor have two wires. which are used power power as well as for signal. in this case it make sense why they didnt do it because there are two prameters.

What the voltage across 2 & 3 and 4 & 3 on the sensor ?
if there is voltage whats the current ?

Thanks