Arduino CAP-ESR-FREQ Meter

Introduction: Arduino CAP-ESR-FREQ Meter

About: my inventions

CAP-ESR-FREQ meter with an Arduino Duemilanove.

In this instructable you can find all neccessary information about a metering instrument based on an Arduino Duemilanove. With this instrument you can measure three things: capacitor values in nanofarads and microfarads, the equivalent serie resistance (ESR value) of a capacitor and last but not least frequencies between 1 Herz an 3 MegaHerz. All three designs are based upon descriptions I found on the Arduino forum and on Hackerstore. After adding some updates I combined them into one instrument, controlled with just one Arduino ino program. The different meters are selected via a three position selector switch S2, connected to pins A1, A2 and A3. ESR zeroing and meter selection reset is done via a single pushbutton S3 on A4. Switch S1 is the power ON/OFF switch, needed for 9 V DC battery power when the meter is not connected to a PC via USB.
These pins are used for input:
A0: esr value input.
A5: capacitor input.
D5: frequency input.

The meter uses a Liquid Crystal Display (LCD) based on the Hitachi HD44780 (or a compatible) chipset, which is found on most text-based LCDs. The library works in 4- bit mode (i.e. using 4 data lines in addition to the rs, enable, and rw control lines). I started this project with an lcd with only 2 datalines the (SDA and SCL I2C connections) but unfortunally this conflicted with the other software I used for the meters. First I will explain he three different meters and finally the assembly instructions. With each type of meter you can also download the separate Arduino ino file, if you want to only install that specific type of meter.

Step 1: The Capacitor Meter

The digital capacitor meter is based on a design from Hackerstore.
Measuring the value of a capacitor:

Capacitance is a measure of the ability of a capacitor to store electrical charge. The Arduino meter relies on the same basic property of capacitors: the time constant. This time constant is defined as the time it takes for the voltage across the capacitor to reach 63.2% of its voltage when fully charged. An Arduino can measure capacitance because the time a capacitor takes to charge is directly related to its capacitance by the equation TC = R x C. TC is the time constant of the capacitor (in seconds). R is the resistance of the circuit (in Ohms). C is the capacitance of the capacitor (in Farads). The formula to get the capacitance value in Farads is C = TC/R.

In this meter the R value can be set for calibration between 15kOhm and 25 kOhm via potmeter P1. The capacitor is charged via pin D12 and discharged for a next metering via pin D7. The charged voltage value is measured via pin A5. The full analog value on this pin is 1023, so 63.2% is represented by a value of 647. When this value is reached, the program calculates the capacitor value based on the above mentioned formula.

Step 2: The ESR Meter

See for definition of ESR https://en.wikipedia.org/wiki/Equivalent_series_resistance.

See for the original Arduino forum topic https://forum.arduino.cc/index.php?topic=80357.0
Thanks to szmeu for the start of this topic and mikanb for his esr50_AutoRange design. I used this design including most of the comments and improvements for my esr meter design.

UPDATE May 2021:
My ESR meter behaves strangely sometimes. I spent a lot of time finding the reason(s) but did not find it. Checking the original Arduino forum pages as mentioned above could be the solution....

Equivalent Series Resistance (ESR) is the internal resistance that appears in series with the device's capacitance. It can be used to find faulty capacitors during repair sessions. No capacitor is perfect and the ESR comes from the resistance of the leads, the aluminium foil and the electrolyte. It is often an important parameter in power supply design where the ESR of an output capacitor can affect the stability of the regulator (ie, causing it to oscillate or over react to transients in the load). It is one of the non-ideal characteristics of a capacitor which may cause a variety of performance issues in electronic circuits. A high ESR value degrades the performance due to power losses, noise, and a higher voltage drop.

During the test, a known current is passed through the capacitor for a very short time so the capacitor doesn’t charge completely. The current produces a voltage across the capacitor. This voltage will be the product of the current and the ESR of the capacitor plus a negligible voltage due to the small charge in the capacitor. Since the current is known, the ESR value is calculated by dividing the measured voltage by the current. The results are then displayed on the meter display. The test currents are generated via transistors Q1 and Q2, their values are 5mA (high range setting) and 50mA, (low range setting) via R4 and R6. Discharching is done via transistor Q3. The capacitor voltage is measured via analog input A0.

Step 3: The Frequency Meter

See for the original data the Arduino forum:
https://forum.arduino.cc/index.php?topic=324796.0#main_content_section.
Thanks to arduinoaleman for his great frequency meter design.

The frequency counter works as follows:
The 16bit Timer/Counter1 will add up all clocks coming in from pin D5. Timer/Counter2 will generate an interrupt every millisecond (1000 times per second). If there is an overflow in Timer/Counter1, the overflow_counter will be increased by one. After 1000 interrupts (= exactly one second) the number of overflows will be multiplied by 65536 (this is when the counter flows over). In cycle 1000 the current value of the counter will be added, giving you the total number of clock ticks that came in during the last second. And this is equivalent of the frequency you wanted to measure (frequency = clocks per second). The procedure measurement(1000) will set up the counters and initialise them. After that a WHILE loop will wait until the interrupt servive routine sets measurement_ready to TRUE. This is exactly after 1 second (1000ms or 1000 interrupts). For hobbyists this frequency counter works very well (apart from lower frequencies you can get 4 or 5 digit accuracy). Especially with higher frequencies the counter gets very acurate. I have decided to display only 4 digits. However, you can adjust that in the LCD output section. You must use D5 pin of the Arduino as the frequency input. This is a prerequirement for using the 16bit Timer/Counter1 of the ATmega chip. (please check the Arduino pin for other boards). To measure analog signals or low-voltage signals a preamplifier is added with a pre-amplifier transistor BC547 and a block pulse shaper (Schmitt trigger) with a 74HC14N IC.

Step 4: The Components Assembly

The ESR and CAP circuits are mounted on a piece of perfboard with holes 0.1 inch distance. The FREQ circuit is mounted on a separate perfboard (this circuit was added later). For the wired connections male headers are used. The lcd screen is mounted in the top cover of the box, together with the ON/OFF switch. (And one spare switch for future updates). The layout was made on paper (much easier than using Fritzing or other design programs). This paper layout was later also used to check the real circuit.

Step 5: The Box Assembly

A black plastic box (dimensions WxDxH 120x120x60 mm) was used to mount all components and both circuit boards. The Arduino, the perfboard circuits and the battery holder are mounted on a 6mm wooden mounting plate for easy assembly and soldering. In this way everything can be assembled and when finished it can be placed inside the box.
Under the circuit boards and the Arduino nylon spacers were used to prevend the boards from bending.

Step 6: The Final Wiring

Finally all internal wired connections are soldered. When this was completed, I tested the esr switching transistors, via the test connections T1, T2 and T3 in the wiring diagram. I wrote a small test program to change the connected outputs D8, D9 and D10 from HIGH to LOW every second and checked this on the connections T1, T2 and T3 with an oscilloscope.
To connect the capacitors under test a pair of short test wires were made with crocodile clip connections.

For frequency metering longer test wires can be used.

Happy testing!

Be the First to Share

    Recommendations

    • Stone, Concrete, Cement Challenge

      Stone, Concrete, Cement Challenge
    • Pets Challenge

      Pets Challenge
    • Water Speed Challenge

      Water Speed Challenge

    9 Comments

    0
    bartejmir
    bartejmir

    Question 2 months ago on Step 2

    Hello,
    First of all, thank you for the project. I've got a problem with the ESR meter. I think I did everything according to the schematics, but I can't get it to measure correctly. I'm not very advanced in electronics, but I'm eager to learn. I seem to be unable to add the video in the comment. I would be very grateful If you got in touch with me at bart.jonca95@gmail.com Take care, Bartek

    IMG_20210501_164544.jpg
    0
    alexpikkert
    alexpikkert

    Answer 2 months ago

    Hi Bartejmir,
    I ran into the same problem after finishing my project. I noticed that both the frequency meter and the capacitor meter work exellent and the ESR part failed sometimes for unknown reasons I could not detect. I had on my wishlist to split the design into three separate parts and focus again on the ESR part. I made this part based on a very complicated forum topic on the arduino website, see https://forum.arduino.cc/index.php?topic=80357.0
    This forum has contributions from many guys jumping from one subject to another which makes it very difficult to analyse. But I stopped everything and archived the whole project since then and forgot to update the ESR part. Sorry for that...I hope you can read the Arduino forum pages and try to find where the failure comes from... I think for myself it could be in the rather complex software or in the protecting diodes D1,D2,D3 and D4. My last written notes were about removing these diodes and split the software into three parts, for frequency, capacitance and esr metering...
    I have demolished my meter in 2020 because I did not really need an ESR meter and did not continue... Hope you can find it....
    Take care,
    Alex

    0
    bartejmir
    bartejmir

    Reply 2 months ago

    Thank you, for the response. Take care!

    0
    burakkustundag97
    burakkustundag97

    5 months ago

    Hello sir
    I would like to talk about a problem I encountered while drawing the propy in the protein. I am using Arduino Uno, but I cannot remove cables from GND and VCC integrations under the Reset button.

    0
    burakkustundag97
    burakkustundag97

    Reply 5 months ago

    I draw in proteus.

    0
    matteobauz
    matteobauz

    Question 9 months ago

    thanks a lot for the project. I'm missing a part list to be sure of every component specification (sorry I'm quite a newbie). Is it possible to add it? Thanks again

    1
    alexpikkert
    alexpikkert

    Answer 9 months ago

    Hi Matteobauz,
    I have added a parts list on the first page.
    Alex

    0
    matteobauz
    matteobauz

    Reply 9 months ago

    that's great! I still cannot see it on the first page. Do it need some approval from Instructables before publishing? Or is it just because is late and I should go to bed? :)

    0
    alexpikkert
    alexpikkert

    Reply 9 months ago

    Hi Matteobauz,
    You must clear the cache of your browser, then you will see the updated instructables page.