Battery powered capacity meter
A capacity meter is more useful than you might expect.
By Pjotr1010
After finishing the FPPCe meter (see elsewhere on the ElektorLabs website) I discovered that a capacity meter is even more useful than expected. The FPPCe meter is fine when working on a prototype, especially when that prototype is partly build on a breadboard. Trying to test a suspect capacitor deep inside a malfunctioning piece of equipment is something else. The PFFCe meter does the job, but is not very ruggedized itself and requires external power. I decided to rebuild the meter as a battery powered capacity meter.
Too many times I have encountered equipment with exhausted batteries because the user had forgotten to switch the equipment off after use. So I wanted to implement an automatic switch off.
Requirements:
· Capacity measurement only
· Battery powered
· Robust housing
· Automatic switch off
· Easy to use
· Only through hole components
Here are the results.
I have chosen for a Hammond box type 1553TTxxBAT. (xx may be GY for grey or BK for black). Not the cheapest, but strong and it has a battery compartment. The funny shape of the print was a challenge. I found it difficult to pinpoint the right spot for the hole in the box for the switch. No good reference points and a all walls curved. To solve this problem for copycats I changed the Kicad footprint of the used switches and added a small hole (1.1 mm in diameter) in the centre of the switch.
The Hammond box 1553TTxxBAT allows for mounting a PCB in the box and/or in the lid. The mounting holes in the box and in the lid are lined up. By mounting the PCB temporarily in the lid – before any component is placed! – the print now doubles as drilling jig. Use a 1 mm drill to mark the spot of the switch on the inside of the lid. The same trick is used to mark the corners of the cut-out for the display. My prototype print figuring on the photo’s does not yet have this feature, but it is in the gerber files and in the Kicad files. The meter became a simple handheld tool with a small display (2 lines of 8 characters) and a single pushbutton to operate it.
The measurement method is the same as in the FPPCe meter. The time needed to charge (or discharge) the capacitor under test between to voltage levels is measured. From that time the capacity is calculated. The charging resistor is 3M3. When it takes too much time (capacity over 250 nF) the measurement restarts with a charging resistor of 3k3. With that 3k3 a double measurement of the capacitor under test is done. One charging the capacitor, one discharging the capacitor. Both values are shown in the display. The upper line of the display shows the capacity measured with a rising voltage (charging) over the capacitor, the lower line of the display shows the capacity measured with a shrinking voltage (discharging) over the capacitor. See photo “Elco”.
Large capacitors, electrolytic types in particular, often show leakage and might require some current to rebuilt the insulation layer that forms the capacitor. When charging the capacitor this leads to loss of current for charging the capacitor, the capacitor seems to have a larger capacity. When discharging the capacitor the discharging goes faster, mainly because of the leakage. The capacitor seems to have a lower capacity. Good capacitors show two almost identical values. Sustaining different values indicate leakage. Values growing towards each other show the effect of rebuilding the insulation layer.
The meter has only one button for normal use. Shortly press the button and capacity measuring begins. A longer press on the button switches to measuring and displaying the battery voltage. Release of the button continues with capacity measurement. After 15 seconds the meter switches itself off. Only for measuring very small capacitors (< 100 pF) it might be helpful to readjust the meter for its own capacity. A “Zero-C” switch can be placed for this purpose.
More details of the meter are in the various PDF files. Also included are the Kicad files and the gerber files for print production.
After finishing the FPPCe meter (see elsewhere on the ElektorLabs website) I discovered that a capacity meter is even more useful than expected. The FPPCe meter is fine when working on a prototype, especially when that prototype is partly build on a breadboard. Trying to test a suspect capacitor deep inside a malfunctioning piece of equipment is something else. The PFFCe meter does the job, but is not very ruggedized itself and requires external power. I decided to rebuild the meter as a battery powered capacity meter.
Too many times I have encountered equipment with exhausted batteries because the user had forgotten to switch the equipment off after use. So I wanted to implement an automatic switch off.
Requirements:
· Capacity measurement only
· Battery powered
· Robust housing
· Automatic switch off
· Easy to use
· Only through hole components
Here are the results.
I have chosen for a Hammond box type 1553TTxxBAT. (xx may be GY for grey or BK for black). Not the cheapest, but strong and it has a battery compartment. The funny shape of the print was a challenge. I found it difficult to pinpoint the right spot for the hole in the box for the switch. No good reference points and a all walls curved. To solve this problem for copycats I changed the Kicad footprint of the used switches and added a small hole (1.1 mm in diameter) in the centre of the switch.
The Hammond box 1553TTxxBAT allows for mounting a PCB in the box and/or in the lid. The mounting holes in the box and in the lid are lined up. By mounting the PCB temporarily in the lid – before any component is placed! – the print now doubles as drilling jig. Use a 1 mm drill to mark the spot of the switch on the inside of the lid. The same trick is used to mark the corners of the cut-out for the display. My prototype print figuring on the photo’s does not yet have this feature, but it is in the gerber files and in the Kicad files. The meter became a simple handheld tool with a small display (2 lines of 8 characters) and a single pushbutton to operate it.
The measurement method is the same as in the FPPCe meter. The time needed to charge (or discharge) the capacitor under test between to voltage levels is measured. From that time the capacity is calculated. The charging resistor is 3M3. When it takes too much time (capacity over 250 nF) the measurement restarts with a charging resistor of 3k3. With that 3k3 a double measurement of the capacitor under test is done. One charging the capacitor, one discharging the capacitor. Both values are shown in the display. The upper line of the display shows the capacity measured with a rising voltage (charging) over the capacitor, the lower line of the display shows the capacity measured with a shrinking voltage (discharging) over the capacitor. See photo “Elco”.
Large capacitors, electrolytic types in particular, often show leakage and might require some current to rebuilt the insulation layer that forms the capacitor. When charging the capacitor this leads to loss of current for charging the capacitor, the capacitor seems to have a larger capacity. When discharging the capacitor the discharging goes faster, mainly because of the leakage. The capacitor seems to have a lower capacity. Good capacitors show two almost identical values. Sustaining different values indicate leakage. Values growing towards each other show the effect of rebuilding the insulation layer.
The meter has only one button for normal use. Shortly press the button and capacity measuring begins. A longer press on the button switches to measuring and displaying the battery voltage. Release of the button continues with capacity measurement. After 15 seconds the meter switches itself off. Only for measuring very small capacitors (< 100 pF) it might be helpful to readjust the meter for its own capacity. A “Zero-C” switch can be placed for this purpose.
More details of the meter are in the various PDF files. Also included are the Kicad files and the gerber files for print production.
Discussion (4 comments)
HaSch 3 years ago
after reading your text attentive, I wonder what can happen if a battery is connected and simultaneously power the circuit over USB module. You write: " When using such a module be careful with power. Use either USB power or a battery, or leave D3 out." But isn't U1 (78L05) protected via D2 (1N4001) and USB module via D3 (1N5817)? I think it will be save to use both power sources parallel.
Best regards,
Hans
Pjotr1010 3 years ago
Be aware of the power management module. After switching the meter off, the software enters an endless loop and waits there for the next power up. But the power control only swiches off the battery power. When the meter is powered from USB and the switch off condition is met, the display backlight goes off and the meter does not do anything anymore until a powerup reset or a button reset happens.
Powering via USB is therefore a bad idea for normal use.
Best regards,
Pjotr1010.
HaSch 3 years ago
What's going wrong? I have no idea.
HaSch 3 years ago
Pjotr1010 3 years ago
Good that you found a work around. The only reason for half the capacity I could imagine is a clock of 8 in stead of 16 MHz. May be your first ATMega has the factory default low fuses, meaning it runs on internal 8 MHz RC clock, ignoring the X-tal.
Half capacity = half the number of clock tics required to load a capacitor = half clock freq = running on internal 8 MHz RC osc in stead of 16 MHz x-tal. Because your second ATMega works correct, it is not a resistor of 6.6 MOhm in stead of 3.3 MOhm.
Another side effect of the lower clock frequency should be the impossibility to measure the capacity of the meter itself. This small capacity, about 20 to 40 pF requires a 4 MHz effective clock. The software reduces the clock speed by a factor 4, resulting in 4 MHz with a X-tal of 16 MHz. With a buildin RC oscillator of only 8 MHz, the resulting effective clock speed is 2 MHz, which is too low to measure 40 pF.
Succes
Pjotr1010.
HaSch 3 years ago
I read your text about software and the speed of MCU. After that I'm not sure if it is possible to program MCU using Arduino IDE. I have a ATmega328P-PU with bootloader and an USB to TTL module. Do I have to pay special attention to anything when using the Arduino IDE?
Best regards,
Hans
Pjotr1010 3 years ago
Leave the bootloader and the switches as default for an Arduino UNO. At powerup the bootloader will function normally and allows programming of the chip using the USB interface. There are two disadvantages:
Many tutorials circulate on the internet of how to use an Arduino UNO or nano as interface between the USB and the ISCP connector. Program the Arduino with "Examples", "11 ArduinoISP". The IDE supports programming via ISCP via tab "Hulpmiddelen" (Dutch version), line "Programmer" and selection "Arduino as ISP", and than "Schets" (Dutch version) en than choice "Uploaden met programmer". You can connect the ISCP interface of the Arduino UNO/nano directly to the ISCP interface of the meter, pin 1 to pin 1 ... pin 6 to pin 6, exept for the wire on pin 5 of the meter (RESET), which must be connected to IO pin D10 of the Arduino UNO/nano.
After programming the CKDEV8 fuse the chip starts up with 2 MHZ clock, but the bootloader will not work due to timing problems. Programming of the fuses must the be done using the ISCP interface.
One way to do this is using AVRDUDE directly from the command line.
After changing the fuses the application program must be programmed using the ISCP interface too.
I hope I did not confuse you too much.
Succes.
Pjotr1010.
HaSch 3 years ago
This is a very nice project and well documented. As I can use such a measuring device well, I decided to recreate it. It really looks very promising. The PCBs are already ordered if someone has a need ...
Best regards,
Hans
Pjotr1010 3 years ago
Thanks for the compliment. Success with the creation and use of the instrument.
Best regards,
Pjotr1010