Home | Looking for something? Sign In | New here? Sign Up | Log out

Dec 7, 2010

Microcontroller interfaces to 24V

Industrial-control applications often use PLCs (programmable-logic controllers) working at logic levels of 24V. That voltage creates a challenge to the safe use of a microcontroller. Such a design requires a physical barrier between the microcontroller and the 24V signals to avoid damage in case of errors or short circuits.
A simple and inexpensive way to switch 24V with a microcontroller is to use the ULN2003 or ULN2803 transistor drivers, which have seven and eight outputs, respectively. These ICs can energize light bulbs or solenoid valves at 500 mA. Damper diodes in these ICs eliminate the need for numerous passive components, especially in designs using coils.

Because of their digital inputs, passive components require numerous parts, complicating assembly, increasing cost, and increasing the need for troubleshooting and maintenance. Few simple ICs can handle more than 24V.

Microcontroller interfaces to 24V figure 1

With this voltage in mind, you can use an interface IC, such as the MC1489 or the SN75189 inverter, as an RS-232 line receiver. These ICs can receive digital signals as large as ±30V. As a bonus, they have some hysteresis-level transition, making them able to discriminate some of the electrical noise in signals (Figure 1).

You can connect these devices directly to a microcontroller. If you mount them in DIP sockets, you can easily replace them in case of damage. The circuit uses a 78L05 linear regulator to decrease the power-supply voltage to 5V. The 1N4007 between the 24V dc and the 5V LM7805 regulator protects the circuit from possible power-supply wire reversal. You must take that fact into account in programming your microcontroller because the signals complement the input.

Label