Premium Content

New Signal Chain Resources from Texas Instruments:

Simple Interface Connects Sensor Output To Microcontroller

Date Posted: April 20, 2011 11:10 AM

It generally isn’t safe to connect programmable logic controller (PLC) and industrial sensor outputs directly to microcontrollers that need transistor-transistor logic (TTL) or CMOS signals, which can make such sensors difficult to use. This design (see the figure) provides a simple solution to the interface problem when the sensor uses an NPN output stage that can support a pullup resistor to sensor power (10- to 30-V range with 24 V typical). The translated signal output from this design is fully compatible with the input stages of TTL/CMOS circuits, can source 500 µA, and can sink over 100 mA.

The NPN pullup is split into two parts. The top part (R1) is a high-power, 1-W, 1k resistor. The lower part (R2) is a low-power, 1/4-W, 10k resistor that connects to the sensor’s NPN output transistor’s collector. Two additional parts finish the design: Zener diode D1 (with a value of either 5.1 or 3.3 V depending on the logic level required) and capacitor C1. Capacitor C2 is optional and only used for high-frequency noise suppression with sensors having low-frequency signal outputs.

The Zener diode serves two purposes in the design. Its main purpose is to set a constant, safe voltage for the translated signal output to protect the attached microcontroller. The diode’s other purpose is to provide, in combination with C1, a regulated output that can supply power to the microcontroller. The circuit’s current capacity is limited to 7.5 mA, but this is sufficient for running a low-power microcontroller and LCD display.

If used for noise suppression, C2 should have a value so the time constant R2 × C2 corresponds to one-third the sensor or PLC output’s maximum operating frequency. Sensors with a maximum frequency of 10 kHz and above do not need C2 because cable capacitance will provide sufficient filtering. A good quality twisted pair or coaxial cable on the signal output will provide the best results.

Part Inventory
Go
powered by:
 

 
You must log on before posting a comment.

Are you a new visitor? Register Here
  • Andrew Neil
    1 year ago
    May 14, 2011

    Indeed there is nothing novel or interesting about this as a "Design Idea" - it is just absolutely basic electronics, pure and simple!

    http://www.kpsec.freeuk.com/components/diode.htm#zener

  • Aubrey Kagan
    1 year ago
    May 13, 2011

    You have got to be joking! This is a simple DC supply regulated with a zener diode and a pull up resistor on the output of a transistor. It was old news 30 years ago.

    In addition depending on the size of the capacitor, when the transistor turns on the discharge of the capacitor can blow the transistor.

    I thought ED had some kind of review panel. See the Ideas For Design issue 10/07/10 Vol 58 No 13. "Anoops Analysis".

  • Phil Ouellette
    1 year ago
    Apr 28, 2011

    Never mind the voltage level translation, you are connecting the PLC/sensor ground to your processors ground. This is asking for trouble. Plus you are going to have difficulty getting UL approval on your product using an input circuit like that.

    A much better way to interface discrete signal (not analog) to a micro is to use an optical isolator. I like to use TLP621 or OPIA410 optical isolators because the inputs can handle DC or AC at anything from TTL levels to AC Mains voltage (with the appropriate series resistor). The output is an open collector transistor output that can switch in excess of 50 VDC and up to 50 mA. You can connect the input directly to your micro and add a pull-up resistor to the output and you have a TTL compatible signal. You can also use these parts for either input or output buffers.

    These parts only cost $0.25 in small quantities.