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.

sensor schematic

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

WS2801 datasheet: WS2801 datasheet

  • \$\begingroup\$ 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? \$\endgroup\$ – winny Oct 18 '17 at 17:21
  • \$\begingroup\$ 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. \$\endgroup\$ – bradosia Oct 18 '17 at 17:39
  • 1
    \$\begingroup\$ And at what compliance voltage? \$\endgroup\$ – winny Oct 18 '17 at 17:43
  • \$\begingroup\$ It is the same as VCC. VCC is -0.3 to 6V. \$\endgroup\$ – bradosia Oct 18 '17 at 17:59
  • \$\begingroup\$ How? Show schematic. \$\endgroup\$ – 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.

enter image description here

| improve this answer | |


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?
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.