09.24.98  Design Idea

-September 24, 1998


[Download PDF version] NOTE: Figures (below) link to Adobe Acrobat (PDF) files. To get the entire article in one PDF, click the button on the left. GET ACROBAT READER

September 24, 1998

Bipolars provide stable current sourceBill Morong, Morong's Harness, Dover-Foxcroft, ME
It's possible to implement a precise current source with a useful output at high frequencies, without using operational amplifiers. The circuit in Figure 1a suffers inaccuracies from both the VBE drop and the finite base current of the transistor. The circuit in Figure 1b overcomes the base-current problem, but has two VBE drops and does not perform well at high frequencies. The circuit in Figure 1c has no base-current problem and performs well at high frequencies, but is prone to inaccuracies from the VGS of the FET. The circuit in Figure 2 largely overcomes these problems.

The VBE of Q2 cancels that of Q1. Because the base current of Q1 diverts (via Q3) as shown around the current-setting resistor R1, IOUT is simply two-thirds of VIN divided by R1. Because the circuit provides error cancellation, the values and voltages are not critical, provided you match the upper and lower components. In this example, Q1 has a beta of 50; the circuit self-adjusts as beta varies. Neon-driver transistors are a good choice for Q1 because Q2 and Q3 need neither good high-frequency performance nor high output impedance. High-beta (400 in Figure 2) transistors are appropriate, as they minimize errors. Insofar as possible, it is desirable to have similar, high betas for Q2 and Q3. At high frequencies, it may be beneficial to bypass the base of Q1 to ground. (DI #2257).

8-pin µC forms one-chip programmable VCOYongping Xia, Teldata Inc, Los Angeles, CA
The circuit in Figure 1 uses a Microchip 8-pin µC (PIC12C671) as a voltage-controlled oscillator (VCO). Because the PIC12C671 has an internal 4-MHz oscillator, four-channel 8-bit A/D converters, and built-in power-reset circuitry, you need no external components to configure the VCO. The µC reads two analog inputs through AN0 and AN1. The reference voltage for the A/D conversion is the µC's power supply VDD. The converted 8-bit data determines the duration of output high and output low. Assume, for example, the digitized outputs from AN0 and AN1 are 43 and 87, respectively. Timer 0 loads the 43 after the µC sets output GP2 to logic one. Timer 0 receives its timing from the internal clock.

Once Timer 0 times out, the µC sets GP2 to logic zero before loading 87 into Timer 0. When Timer 0 times out again, the program starts the loop again. Thus, the voltage on AN0 determines the output-high duration, and the voltage on AN1 determines the output-low duration. If a simple 50%-duty-cycle output is satisfactory, you can tie AN0 and AN1 together and control them with one source. You can further program the VCO's output frequency by using D0 through D2. The µC has a prescaler between its clock and Timer 0. Each time the µC reads AN0 and AN1, it also reads D0 through D2 and loads the reading to the prescaler.

Table 1 shows some test results. The frequency range is 8 Hz to 8 kHz. Listing 1 is the assembly code for the µC. Because the voltage-to-frequency relationship is purely software-controlled, you can alter the program or use a look-up table to obtain a desired v-f curve. (DI #2259).
Table 1—Test results for PIC-based VCO

Cable tester is fast and cheapAbel Raynus, Armatron International, Melrose, MA
The cable tester in Figure 1 uses a low-end 8-bit µC. The specific µC to use depends on the number of conductors in the cable you want to test. For the current application, two types of cables were under test, one with three conductors and another with seven. So, the Motorola 68HC705P9 µC was suitable. The program first determines which type of cable is under test by checking the cable-switch position (Listing 1). Then, the program checks each conductor line from A0/C0 to A7/C7 by putting a high-level voltage from output port A on one end of the wire and measuring the response on the other end, which is connected to the input port C. If all of the checks show conductivity, the green "pass" LED turns on. In the opposite case, the red "fail" LED turns on. The test checks not only for conductivity but also for the presence of a cross connection.

If you want to test a variety of cables, you can use more switches. If a cable has more than eight conductors, you can use a different type of µC or multiplex the inputs.

You can download Listing 1 and an assembly-language program by clicking here. (DI #2225)

Capacitive sensor "likes" parasiticsBoris Khaykin, Candid Logic Inc, Madison Heights, MI
Stray capacitance is a common problem with capacitive sensors. The capacitance changes within the measurement range are normally much smaller than the strays; the result is a loss of sensitivity. Various methods are available to increase the relative sensitivity (Deltaf/f0): frequency subtraction, the use of bridges, and the use of a negatron to subtract the strays, for example. The idea here is not to do battle with the stray, but rather use it and turn its drawbacks to your advantage. This method uses frequency-dependent hysteresis in a classic op-amp multivibrator. Figure 1 shows a simple, flexible design for a capacitive sensor.

Without capacitor C2, the design is a classic multivibrator based on comparator IC1 with output buffer IC2. If R1=R2, the frequency is

20dieq1.gif (895 bytes)

R1, R2, and R3 define the hysteresis, 900 mV with the values shown. Frequency (f) is a function of capacitor C1, as Figure 2 shows. Without C2 and with C1=60 pF and DeltaC=20 pF, f0=159 kHz and the relative sensitivity Deltaf/f0 is -18%. With C2 connected in parallel with R2, the hysteresis becomes frequency-dependent. The capacitive reactance (XC=1/2pfC) in parallel with R2 reduces the hysteresis in an inverse proportion to the frequency. As a result, the frequency increases. This increase reduces XC, further reduces the hysteresis, and leads to a further increase in frequency. Thus the relative sensitivity Deltaf/f0 increases significantly (see Figure 2 with C2=40 pF).

With C2=40 pF, C1=60 pF, and DeltaC=20 pF, f0=945.5 kHz and the relative sensitivity (Deltaf/f0) is -82%. The sensitivity (Deltaf/f0) (38.6) in this case is 26 times as high as the case without C2 (Deltaf/f0=1.45). You can obtain even more interesting results by replacing C2 with a sensing capacitor. If C1=200 pF, changing the value of C2 from 0 to 200 pF changes the hysteresis from 900 to 28 mV, and changes the frequency from 30 to 1300 kHz. Figure 3 shows output frequency (f) as a function of capacitance C2. With C2=100 pF and DeltaC=20 pF, f0=145.2 kHz and the relative sensitivity (Deltaf/f0) is +393%. Thus, the frequency is directly proportional to the capacitance.

As Figure 3 demonstrates, you can adjust the desired initial frequency with R3, and the sensitivity with R5. Note that the higher sensitivity in this example occurs with a significant stray capacitance (100 pF, for example). If the real sensor has lower initial capacitance (50 pF, for example) the simple addition of a 50-pF capacitor in parallel with the sensor increases the sensitivity. The sensor "likes" the stray capacitance as it produces frequency-dependent hysteresis that, in turn, provides higher sensitivity. You could also use the added capacitor for temperature compensation.

If you use an extremely fast op amp or comparator in this design, there is a certain value of C2 for which the output frequency jumps up a few kHz with a hysteresis of 5 to 7 pF (Figure 4). This quirk is particularly useful in the design of super-sensitive capacitive switches. You can adjust the switching point with R3 and/or a capacitor in parallel with C2. You can adjust the hysteresis by using a small resistance connected in series with C2. On the other hand, the use of a slower comparator linearizes the frequency-versus-capacitance characteristic. For example, test results show that with an LM319 comparator, R3=200 kOhm, R5=200 Ohm, and C1=200 pF, the output frequency follows the empirical equation f=140+3.327(C2-100) kHz with 3% nonlinearity within the range C2=100 to 400 pF. (DI #2258).

| EDN Access | Feedback | Table of Contents |

Copyright c 1998 EDN Magazine, EDN Access. EDN is a registered trademark of Reed Properties Inc, used under license. EDN is published by Cahners Business Information, a unit of Reed Elsevier Inc.

Loading comments...

Write a Comment

To comment please Log In