Beruflich Dokumente
Kultur Dokumente
This is a story about the construction of a simple device to measure a capacitor and/or
a resistance. Perhaps you are not interested in measuring the capacitance or
resistance... you need a device to measure a temperature or an amount of light.
Read on!
It is not difficult to translate temperature to resistance... just take a resistor of which
the value is depending on the temperature of its body. This can be a PTC (positive) or
a NTC (negative) resistor.
A PTC rises the resistance at a rising temperature...
A NTC lowers the resistance at a rising temperature...
"THE" resistance is given at typically 25 degrees centigrade.
To load a capacitor (or battery) via a resistor takes time. A high valued resistor drops
the current flowing into the capacitor... so it will take longer to load the capacitor.
If we were able to measure the time needed to load the capacitor than we would know
the value of the resistor and hence the temperature, since the resistance of a NTC or
PTC is temperature dependent.
To measure the time it takes to load the capacitor we can use the computer's RS232
port and a program written to perform this task.
Each RS232 (COMx) port supports 8 active lines, but we do not use the TxD or RxD
for this project. So we have 6 active lines left, 4 for input and 2 for output.
The output lines =DTR & RTS= carry +9 volts if "high" and -9 volts when "low",
maximum current is 10 milli-amperes.
After firing up our computer all the output lines are set low. With our little program
we will make the output line DTR (pin 4) high in order to load the capacitor via a
resistor. The maximum value of this resistor should be 10 kilo-ohms.
One of the input lines (CTS = pin 8) is connected to the capacitor and this line should
detect when the capacitor is 'loaded'. Our program will measure the time between
making DTR high and CTS becoming high.
Of course, all is measured to the ground potential = pin 5 = GND.
This is all folks... well, we need a program for the computer. Let's write one in
QBASIC (or any BASIC dialect).
First we have a decision to make: COM1, COM2, or?
The program is started by calling the COM-port by its Basic Address, BA.
Basic Address = BA
decimal hex
COM1 1016 3FB
COM2 760 2F8
COM3 1000 3E8
COM4 744 2E8
The output lines can be activated by the output register at the address BA+4.
Bit 0 is used for the DTR output and bit 1 for the RTS output.
A "1" sets the output line, makes it high.
A "0" resets the line to low.
DTR RTS total
off 0 off 0 0
on 1 off 0 1
off 0 on 2 2
on 1 on 2 3
Part 1 of the program has to be changed since we introduced some new labels,
BEGIN: and START:. T and TOT must be set to zero at the beginning of the program.
The next step, as in the old program, is to peek to see if the capacitor is already
loaded. There is a difference in the state of the output pin of the 555: if C is fully
loaded CTS goes into the 'low' state (was 'high' state)... CTS becomes 0 and not 16.
We have to change this in the new program.
Another change is that there is no need for 8 measurements since the 555 gives a far
better accuracy. The lines that deal with that in the old program are abolished.
The input impedance of the 555 is very high. So we can use a resistor up to 10 mega-
ohms to load the capacitor. I used two resistors, 1.5 kilo-ohms for large capacitors and
1.5 mega-ohms for small capacitors. The switch has been added to choose between
capacitors measured in nano-farads (1nF = 0.001µF) or micro-farads (µF).
The minimum capacity that could be measured was 220pF (0.21 nano-farad on the
monitor). The largest capacity I measured was 0.47 farad (470,000µF) and it took so
much time to load that capacitor that I went for a cup of coffee.
Calibration has been done using an accurate capacitor (1%) of 64.9nF. An accurate
capacitor is expensive and this one was found in my junk box. The value of the
capacitor is of no importance, but take a large one for the sake of accuracy.
Calibrating the micro-farad range was an 'educated guess' since no accurate
electrolitic capacitors were available.
With no capacitor attached to the input the counter still counts to 2. We have to
subtract this in the computer program.
N = N-2
The range switch not only chooses the load resistor and lights the red LED, but also
makes DSR high, adding a value of 32 to the read register "IN".
Capacitor loaded: N=0 or N=32. If N=32, the capacitor's value is printed on the
monitor in nano-farads, if N=0 this will be in micro-farads.
****program com555us.bas****
END
Construction
A piece of double sided copper foil construction board was used. First the 555 was
placed at the side for the pins 6..9 on the board.
Pin1 : drill a hole and solder the pin at both sides to the foil.
Pin2 : bend up, no hole, solder 10 kilo-ohm resistor to pin 7 of DB-9
connector.
Pin3 : solder directly to pin 8 of DB-9.
Pin4 : drill a hole AND make a trace to pin 8 (under the 555).
Pin5 : make an 'island' and solder a C of 10nF (SMD prefered) to ground.
Pin6 and pin7 : drill two holes and make an 'island' to interconnect pins 6 and
7 on both sides of the board. From the islands the two load resistors are
mounted to the switch.
Pin8 : see pin4.
The two LEDs on the photograph are NOT on the circuit diagram. The green LED is
connected to TxD via a 2.2 kilo-ohm resistor. The polarity of TxD is negative!
The red LED signals the position of the switch and is connected via a second 2k2
resistor to pin 6 of the BD-9 connector.
After we drilled the holes for the 555 into the board we can draw the traces with a
small felt pen. Now the traces can be milled by a 1.2 millimeter mill (ask your dentist
for NEW 'drills') for quick and easy milling.
File or saw the space for the switch and finally clean up the construction board. ALL
non-milled copper foil is ground.
Now solder the components to the right place and if all goes well... this measuring
instrument does its job at the first firing up!
Of course, we could use this instrument with a fixed capacitor and a variable resistor.
Resistors with their resistance related to temperature, the amount of light, moisture or
...
This way a wide range of measurements are possible.