Interface High-Voltage On/Off Signals to Low-Voltage MCUs

If one of your designs requires an microcontroller (MCU) to detect on/off signals from high-voltage devices, you might first think about an optical coupler or optical isolator with its LED connected to the high-voltage signal and its phototransistor connected to an MCU input. That approach will work, but your software must debounce signals from mechanical switch contacts and you’ll need several passive components to properly drive the LED and bias the phototransistor. You’ll also need one MCU input pin per switch or other sensed device.

An article, “Interfacing High-Voltage Applications to low-power controllers,” by Thomas Kugelstadt at Texas Instruments in the 4Q 2010 issue of TI’s Analog Applications Journal describes a better way to handle high-voltage inputs. The company’s SN65HVS882 integrated circuit can handle voltages from 6 to 300 V DC and convert them into serial bit streams that require only a few I/O pins on an MCU. The IC will work with limit switches, proximity sensors, relay contacts, push buttons, and other types of on/off devices, or devices that provide an on/off signal. You will find the article at: focus.ti.com/lit/an/slyt393/slyt393.pdf.

According to Kugelstadt, “Internally, each input signal is checked for signal strength and stability. A current comparator detects whether the input current is higher than a predefined leakage threshold, and a voltage comparator checks whether the input voltage is higher than an internally fixed reference voltage. If both comparator outputs are logic high, a programmable debounce filter checks whether the new input status is caused by a short but strong noise transient, or whether the signal presence outlasts the debounce time and thus presents a true input signal.”

The chip also provides an output pin for each input so you can attach an LED to monitor the status of a switch input. That’s a helpful feature for control equipment.

You can power the interface IC in several ways and its shift-register controls operate with 3.3V logic-IC signals. Serial transmissions can occur via shift-register or serial-peripheral-interface (SPI) timing, and a circuit can daisy-chain several SN65HVS882 integrated circuits to monitor the state of, say 24 or 64 signals, in groups of eight per IC. The serial transfer requires only three MCU pins.

If a major catastrophe strikes your area, will you be prepared? Do you know how to modify the tech you've already got or MacGyver what you need to fit your own situation? A free, five-day Continuing Education Center course starting April 6 will show you how.

Focus on Fundamentals consists of 45-minute on-line classes that cover a host of technologies. You learn without leaving the comfort of your desk. All classes are taught by subject-matter experts and all are archived. So if you can't attend live, attend at your convenience.