My Projects

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
arduino:capmeter [2023/03/12 07:31] – tonyarduino:capmeter [2026/10/20 08:39] (current) – tony
Line 1: Line 1:
 +{{: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>
Line 7: Line 8:
 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). 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 =====+===== 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. 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.
Line 17: Line 18:
 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. 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.
  
-{{:arduino:capmeter:cap_meter.png?600|Arduino capacitance meter circuit}}+<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 ===== +===== Parts list ===== 
-  * Arduino Duemilanove+  * [[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.   * [[:electronic:lcd:vlgem1021|LCD]], VLGEM1021-09 from a Siemens optiPoint 500 economy phone.
   * 20k pot   * 20k pot
Line 28: Line 36:
 {{ :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. 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.