## Capacitance Meter

len17

Posts: 394
Joined: Sat Mar 14, 2009 7:20 pm

### Capacitance Meter

Thanks to johngineer for posting my capacitance meter project on the blog. Here are some more details.

This is the finished project mounted in an Adafruit enclosure:

More pics here

I got the basic idea from mikewitt here. It uses an oscillator circuit made from a 555 timer in astable mode. The frequency of the oscillator depends on the capacitor being measured. I have attached a schematic of the measurement circuit at the end of this post (LCD hookup not shown). Ladyada has a tutorial showing how to hook up the LCD and mount it in the enclosure.

Measuring the frequency is a bit tricky because it ranges from a couple of hertz up to a few hundred kilohertz. In the software I implemented two different methods to measure the frequency:
1. Count the number of cycles in one second. This works well when the frequency is high, but if itâ€™s low you have to wait many seconds to get enough cycles for an accurate estimate.
2. Measure the time for a single cycle, in microseconds. This works well when the frequency is low.
My sketch tries method 1 (using the AVR chipâ€™s Timer1 with an external clock) and if that doesnâ€™t give a good result it uses method 2. The result is displayed on the LCD character display.

I used a proto shield, with a small daughter-board mounted above it to hold a pushbutton and a socket for the capacitor, so they fit in the holes in the front of the enclosure. (Photo)

Now, I donâ€™t really know how accurate this capacitance meter is. I havenâ€™t tried to calibrate it against a â€śproperâ€ť meter. Itâ€™s good enough that I can use it to read ceramic caps, instead of a magnifying glass. The main drawback is that it doesnâ€™t work for values below about 1 nF. It can read smaller values if I use different resistors in the measurement circuit, but then it wouldnâ€™t work well for large values (100 uF). I had to pick a compromise.

Parts used:
• Diavolino Arduino clone from Evil Mad Scientist Laboratories
• DIY shield
• 16x2 character LCD
• Arduino enclosure
• LM555CN timer chip
• 1k ohm 1% resistors (2)
• Tactile pushbutton switch
• Socket strip to plug in the capacitor being measured
Attachments
CapMeter2_schem.png (47.08 KiB) Viewed 5691 times

len17

Posts: 394
Joined: Sat Mar 14, 2009 7:20 pm

### Re: Capacitance Meter

Here's the source code for the Arduino sketch.
Attachments
CapMeter.pde.txt