Did You Know? Improving Logic Inputs

A regular contribution from Bob Schmid, WA9FBO

Connecting signals from the outside world directly to low-voltage IC inputs—like those on Arduino boards and other microcontrollers—is common practice. But without a bit of protection, it can lead to unreliable operation or even damage. Fortunately, adding a simple input buffer can improve both safety and signal integrity.

Overvoltage Protection

One important reason to buffer an input is to guard against overvoltage. For instance, a logic input rated for 3.3 V or 5 V could be damaged if its wiring comes into contact with a 12 V source. A suitable buffer can tolerate the higher voltage and keep it from reaching sensitive circuitry.

Raising the Switching Threshold

Another reason is improved noise immunity. A long wire connected to an input can act like an antenna and pick up noise, causing false triggering at the input. It’s even more likely if the signal comes from a Darlington transistor, common in open-collector drivers. Darlingtons have a relatively high collector-emitter saturation voltage (VCE(sat))—typically 0.7 V to 1.2 V—which can leave the input voltage hovering near the logic threshold. In that region, even modest noise can push the signal across the threshold and cause the state to be misread.

Here are two straightforward buffer designs. The first addresses the above objectives, while the second handles a special case.

General Purpose Logic Input Buffer

Figure 1 illustrates a general-purpose buffer. Here’s how it works.

Schematic of a general purpose logic input buffer: IN through R2 and divider R3 to the base of 2N3904 transistor Q1, R1 pullup on IN, R4 pullup on the collector to OUT, all from +5 V
Figure 1 – General purpose logic input buffer

Let’s say the IN terminal is connected to a switch, sensor, relay contact, open collector, or similar device having two states: open and closed (shorted to ground). When the switch is open, pullup resistor R1 supplies base current to Q1, turning it on. (R1 may not be needed if the device provides a voltage output.) When Q1 is on, OUT is at a logic low level—around +0.2 V to +0.3 V.

When the switch is closed, IN is pulled to ground, cutting off the base current to Q1. Q1 turns off, causing R4 to pull the collector up to +5 V and producing a logic high level at OUT.

R2 and R3 form an approximately 3:1 voltage divider. Since Q1 turns on when there’s about 0.7 V from its base to emitter, the minimum voltage needed at IN to turn Q1 on is three base-emitter drops: 3 · 0.7 V = 2.1 V. Bottom line: When IN is below +2.1 V, OUT is high. When IN is above +2.1 V, OUT is low.

We can use this circuit with a wide range of input voltages, but be mindful of the power dissipation in R1. For example, if IN is at 28 V, R1 has 23 V across it and dissipates P = E2 / R = (23)2 / 4700 = 0.11 W. Since that exceeds the safe limit for a 0.1 W 0603 surface-mount resistor, a higher power resistor is required.

How to Tell If an LED Is On

Suppose we’re repurposing an old VHF or UHF mobile radio for digital or linking use. It may be helpful to derive a carrier detect signal from its “channel busy” LED. As seen in the circuitry to the left of the dashed line in Figure 2, the job is made more interesting due to the way LED1 is wired.

Schematic for sensing LED status: a radio’s LED1 with terminals A and B across the base and emitter of PNP Q1 (2N3906), which drives NPN Q2 (2N3904) to the OUT terminal
Figure 2 – Circuit for sensing LED status

Assume LED1 has a forward voltage drop of 1 V. When it is off, there’s +5 V on both its anode and its cathode (no current flow, so no voltage drop). When LED1 is on, there’s +5 V on its anode and +4 V on its cathode.

We could detect LED activity with a circuit that decides whether the cathode is at +4 V or +5 V. But we can sense the voltage across the LED instead, making the on and off states more apparent and less affected by marginal logic thresholds.

In Figure 2, the voltage across LED1 is monitored by Q1, a PNP transistor. When the LED is off, there’s +5 V at terminals A and B (R2 helps insure they’re the same). Q1 is off because its emitter and collector are at the same voltage. No current flows to NPN transistor Q2, so it is likewise off and its output is an open circuit (a pullup resistor can be added from Q2’s collector to +5 V if a logic high voltage is desired).

When the LED is on, the current flowing in it creates a voltage drop. Terminal A has +5 V and terminal B has +4 V, so now the base of Q1 is more negative than its emitter by more than its turn-on voltage of 0.7 V. With Q1 on, current is sent to Q2, turning it on. The voltage at OUT is 0.2 V to 0.3 V, a logic low level.

Summary

These types of buffers are simple, inexpensive, and offer reliable signal detection in the real world.

This article originally appeared in the September 2025 issue of the Tri-Bander.