Design Idea
Convert signals to proper logic levels
Reduce digital-voltage levels to those compatible with microcontrollers.
Abel Raynus, Armatron International Inc, Malden, MA; Edited by Martin Rowe and Fran Granville -- EDN, 2/5/2009
When designing a test station incorporating a microcontroller, you often face voltages in the test that exceed the maximum input level permitted for the microcontroller. For example, if a microcontroller uses a 5V power supply, then the maximum input signal should also be 5V. When a test voltage exceeds 5V, you might think to reduce the voltage with a voltage divider. A voltage divider can influence the DUT (device under test), however. So, a signal conditioner needs high input impedance. Also, the signal conditioner’s output signals should match the logic levels of the microcontroller despite some fluctuation of the measured signal. It allows you to use the regular microcontroller-input pins instead of ADC ones.
Engineers often use a noninverting op amp to bring signal voltages in line. However, most op amps have differential-input-voltage ranges matching their power-supply voltages. Thus, you need one more power-supply voltage with a higher voltage and several extra resistors to lower the op amp’s output to the microcontroller level. Moreover, the output will follow the measured input-signal variations, so it needs analog-to-digital conversion in the microcontroller.
A better approach is to use a small-signal MOSFET in the voltage-repeater configuration (Figure 1). You can use the BS107A from On Semiconductor for this task. You can consider the gate-to-source area of the MOSFET as a capacitor with a value of approximately 60 pF. To discharge it in the absence of the DUT, connect a resistor of approximately 1 MΩ between the gate and ground. Also, the input voltage should be more than the MOSFET’s gate-threshold voltage, VTHR, of 3V dc but less than the maximum rated gate-to-source voltage, VGS, of 20V dc. In this figure, the output voltage never exceeds the power-supply voltage, and variations of the input voltage have no effect on output as long as they happen in the saturation region. A drawback of this approach is that you must use as many transistors as the number of testpoints in the DUT.
|
Another good option is to use any dual- or quad-voltage comparator. You can use an LM393 from National Semiconductor because it’s inexpensive and widely available. Figure 2 shows a simple configuration with few components. The 5V power-supply voltage acts as the positive-threshold voltage. The output is 5V for input signals lower than this level. If the input signal exceeds 5V, the output voltage drops to 0V. Resistor R1 connects an open collector of the LM393 to the supply voltage.
Sometimes, a zero-output signal is undesirable. A missing power-supply voltage, a bad solder joint, or a broken wire in the test fixture could cause this zero-output signal. Use a logic high level when the signal under test is present and logic low when it’s absent. At first glance, it seems that just switching the comparator pins of the input and the threshold voltages provides an acceptable approach. However, that assumption is invalid because the positive input voltage may exceed the power-supply level only as long as the other voltage remains within the common-mode range. The upper limit of common-mode input voltage for the LM393 is 1.5V less than the power-supply voltage, or 3.5V. Thus, you should use the voltage divider comprising R2 and R3 for the threshold voltage (Figure 3).
















