# Can you use a LED driver (WS2801) for a 4-20mA control loop

I am trying to make a 4-20mA control loop on a home made sensor that will connect to a PLC. I was using Texas Instruments XTR111AIDGQR, but it is too expensive, costing $1.72. so want to try switching it out with WS2801, an LED driver that costs$0.13.

The LED driver documentation says it has a wide output current range up to 150mA, which can be adjustable to the LED current. I limited the current to 20mA using a 30ohm resistor as shown in the diagram below. I will use the TWI (Two Wire Interface) to "Dim" the 20mA current.

Will this application work? Am I not considering something that will make this not work?

WS2801 datasheet:

• Depends. Are any other devices on the line allowed to sink the signal to ground to indicate a fault? What range of compliance voltage do you need to provide? – winny Oct 18 '17 at 17:21
• No other devices are on the line. The sensor will use software to limit the 4-20mA current from going under 4mA. The sensor is independently powered. – bradosia Oct 18 '17 at 17:39
• And at what compliance voltage? – winny Oct 18 '17 at 17:43
• It is the same as VCC. VCC is -0.3 to 6V. – bradosia Oct 18 '17 at 17:59
• How? Show schematic. – winny Oct 18 '17 at 18:02

The XTR111AIDGQR provides a DC current.
The WS2801 provides a PWM signal, not DC.

You have pin RFB pulled high, that is not going to work.

simulate this circuit – Schematic created using CircuitLab

Figure 1. Typical 4 - 20 mA sensor connection to PLC analog input.

Most PLC analog inputs are dual-purpose. The support 0 - 10 V input or, by addition of a 250 Ω shunt resistor, convert 20 mA to give 5 V on the input. The resolution is halved when using current rather than voltage but this is seldom a problem.

In the spirit of the comments to your question I will prompt you to work out:

• How will you source current for the loop using a chip designed to sink current from the LEDs?
• What voltage will be on R1 at 20 mA?
• What voltage is required at V+ to get that voltage on R1?