| Both sides previous revisionPrevious revisionNext revision | Previous revision |
| arduino:capmeter [2023/03/10 03:49] – tony | arduino:capmeter [2026/10/20 08:39] (current) – tony |
|---|
| | {{:pilone.png |Cone icon by Fornax, CC-BY-SA 3.0, wikimedia commons}} ((PAGE UNDER CONSTRUCTION)) |
| <html><p style="text-align:right;">Published 12 Dec 2022</p></html> | <html><p style="text-align:right;">Published 12 Dec 2022</p></html> |
| <html><p style="text-align:center;"><b><font size="6">Capacitance Meter</font></b></p></html> | <html><p style="text-align:center;"><b><font size="6">Capacitance Meter</font></b></p></html> |
| ===== Overview ===== | ===== Overview ===== |
| |
| There are many articles about measuring capacitance using an Arduino. In the simplest form they just measure the time to charge or discharge the capacitor with known voltage through a resistor. But some are elegant, requiring no additional components at all!. This concept seems a little ridiculous, but see the articles on Codewrite.co.uk by Jonathan Nethercott, linked to in the references section below. With a bit of inspired thinking and ideas from others an elegant solution to capacitance measurement was born. | There are many articles about measuring capacitance using an Arduino. In the simplest form they just measure the time to charge or discharge the capacitor with known voltage through a resistor. But some are elegant, requiring no additional components at all!. This concept seems a little ridiculous, but see the articles on Codewrite.co.uk by Jonathan Nethercott, linked to in the references section below. With a bit of inspired thinking and ideas from others an elegant solution to capacitance measurement was born. This approach needs some calibration as it depends upon values of internal stray capacitance and pull-up resistors in the Arduino, and may not even work for some types of Arduino (and clones). |
| | |
| | ===== Circuit description ===== |
| | |
| | It hardly needs a hardware description in the respect that it just consists of an Arduino and a display. The only other component needed is anything that the display needs, in this case a 20k potentiometer for adjusting contrast of the LCD. |
| | |
| | This design uses two different methods for measuring capacitance, and auto ranges between them depending upon the size capacitor that it encounters. |
| | |
| | The first method is for small capacitors up to 1000pF (1nF), and measures the ratio between the unknown capacitor and a known one in series. The elegant part of this is that it uses the inbuilt stray capacitance of the Arduino as the "known" capacitor - this has the disadvantage of requiring calibration for the particular Arduino type used, but the advantage of not needing an external reference capacitor. |
| | |
| | The second method, for larger capacitors 1nF to at least 10µF, is to charge up the capacitor under test through the Arduino's output's pull-up resistor and evaluate the time to charge it. And thereby calculate the capacitor's capacity. Again this needs calibration, but has the advantage of not needing additional components. |
| | |
| | <HTML> |
| | <div class="shadows" style="text-align:center; margin-left: auto; margin-right: auto; "> |
| | <a href="/dokuwiki/_media/arduino/capmeter/cap_meter.png" class="media"><img src="/dokuwiki/_media/arduino/capmeter/cap_meter.png" width="70%" class="media" title="Capacitance meter circuit" alt="Capacitance meter circuit schematic" /></a> |
| | <div class="container"> |
| | Capacitance meter circuit schematic |
| | </div> |
| | </div> |
| | </HTML> |
| | |
| | ===== Parts list ===== |
| | * [[https://docs.arduino.cc/retired/boards/arduino-duemilanove|Arduino Duemilanove]] (essentially the Uno with a different USB interface). |
| | * [[:electronic:lcd:vlgem1021|LCD]], VLGEM1021-09 from a Siemens optiPoint 500 economy phone. |
| | * 20k pot |
| |
| To test out the viability of this approach I constructed a basic implementation using an Arduino Duemilanove. | To test out the viability of this approach I constructed a basic implementation using an Arduino Duemilanove. |
| {{ :arduino:capmeter:p3100601a.jpg?600 |Test setup, with no additional external components (the potentiometer is for the LCD contrast)}} | {{ :arduino:capmeter:p3100601a.jpg?600 |Test setup, with no additional external components (the potentiometer is for the LCD contrast)}} |
| |
| Here is my initial program using Jonathan's code and a driver for a serial LCD :\\ | Here is my initial program cobbled together from Jonathan's code and a driver for a serial LCD (not elegant!) :\\ |
| {{:arduino:capmeter:v1.00:measurecapacitor_uno_ks0073a.ino|Capacitor meter code for Arduino UNO and KS0073 display.}} | {{:arduino:capmeter:v1.00:measurecapacitor_uno_ks0073a.ino|Capacitor meter code for Arduino Uno and KS0073 display.}} |
| | |
| | The meter is auto-ranging from a few pF to about 100µF. I've made the output routine a little more complicated than really needed by displaying values in micro Farads from 0.1µF to 100µF, nano Farads from 1nF to 100nF, and pico Farads from 1pF to 1000pF. |
| |
| {{arduino:capmeter:p3100604a.jpg?300|Example output for a 0.22µF capacitor}} | {{arduino:capmeter:p3100604a.jpg?300|Example output for a 0.22µF capacitor}} |
| So that's proof of concept. A pretty simple project, but very useful as I've never had a meter to measure capacitance. Many of the LCD display modules have external capacitors, mainly for the negative charge pump circuits for the LCD drive, now I'll have a way to find out what value they are. | So that's proof of concept. A pretty simple project, but very useful as I've never had a meter to measure capacitance. Many of the LCD display modules have external capacitors, mainly for the negative charge pump circuits for the LCD drive, now I'll have a way to find out what value they are. |
| |
| Next will be to mount this in an enclosure, perhaps an old multi-meter body, to make it a bit more rugged than a testbench circuit. | Next will be to mount this in an enclosure, perhaps an old multi-meter body, to make it a bit more rugged than a test-bench circuit. |
| | |
| ===== Hardware description ===== | |
| |
| ====== References and Additional Resources ====== | ====== References and Additional Resources ====== |
| * [[https://wordpress.codewrite.co.uk/pic/2014/01/21/cap-meter-with-arduino-uno|Capacitance measurement with the Arduino Uno by Jonathan Nethercott]] | * [[https://wordpress.codewrite.co.uk/pic/2014/01/21/cap-meter-with-arduino-uno|Capacitance measurement with the Arduino Uno by Jonathan Nethercott]] |
| * [[https://hackaday.com/2014/01/22/capacitance-measurement-with-the-arduino-uno|Capacitance measurement with the Arduino Uno by Jonathan Nethercott]] | * [[https://hackaday.com/2014/01/22/capacitance-measurement-with-the-arduino-uno|Capacitance measurement with the Arduino Uno by Jonathan Nethercott]] |
| * [[https://github.com/codewrite/arduino-capacitor|Arduino capacitor]] | * [[https://github.com/codewrite/arduino-capacitor|Arduino capacitor code by Jonathan Nethercott]] |
| * [[https://github.com/gavinlyonsrepo/Cap_meter_arduino|Cap meter Arduino]] | |
| |
| | * [[https://github.com/gavinlyonsrepo/Cap_meter_arduino|Cap meter Arduino by Gavin Lyons]] |
| * [[https://create.arduino.cc/projecthub/mircemk/diy-simple-autorange-capacitance-meter-10pf-10000microf-e6e797|Autorange Capacitance Meter]] | * [[https://create.arduino.cc/projecthub/mircemk/diy-simple-autorange-capacitance-meter-10pf-10000microf-e6e797|Autorange Capacitance Meter]] |
| * [[https://electronoobs.com/eng_arduino_tut10_1.php|Arduino multimeter]] | * [[https://electronoobs.com/eng_arduino_tut10_1.php|Arduino multimeter]] |