|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Table 1Test results for PIC-based VCO |
||||||||
| VC1/VC2 | D2/D1/D0 | |||||||
| 000 | 001 | 010 | 011 | 100 | 101 | 110 | 111 | |
| 0V | 899 | 474 | 243 | 123 | 62.3 | 31.2 | 15.6 | 7.9 |
| 0.2V | 928 | 490 | 252 | 127 | 64.4 | 32.3 | 16.2 | 8.1 |
| 0.4V | 963 | 509 | 263 | 133 | 67.2 | 33.8 | 16.9 | 8.4 |
| 0.6V | 1000 | 531 | 274 | 140 | 70.1 | 35.2 | 17.6 | 8.8 |
| : | : | : | : | : | : | : | : | : |
| 1.0V | 1090 | 579 | 300 | 153 | 77.3 | 38.7 | 19.5 | 9.7 |
| : | : | : | : | : | : | : | : | : |
| 2.4V | 1560 | 858 | 451 | 232 | 118 | 59.5 | 29.7 | 14.9 |
| : | : | : | : | : | : | : | : | : |
| 4.4V | 4410 | 2980 | 1810 | 1010 | 537 | 268 | 141 | 71.1 |
| 4.6V | 5320 | 3880 | 2420 | 1410 | 768 | 402 | 206 | 104 |
| 4.8V | 6720 | 5550 | 4130 | 2730 | 1470 | 807 | 474 | 243 |
| 5.0V | 8220 | 7970 | 7490 | 6710 | 5550 | 4130 | 2720 | 1620 |
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)
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

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 |