Capacitance Meter

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
len17
 
Posts: 394
Joined: Sat Mar 14, 2009 7:20 pm

Capacitance Meter

Post by len17 »

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:
Image

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
CapMeter2_schem.png (47.08 KiB) Viewed 5825 times

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

Re: Capacitance Meter

Post by len17 »

Here's the source code for the Arduino sketch.
Attachments
CapMeter.pde.txt
(7.95 KiB) Downloaded 730 times

User avatar
didier
 
Posts: 115
Joined: Mon Nov 17, 2008 6:14 am

Re: Capacitance Meter

Post by didier »


Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”