{"id":1969,"date":"2014-02-05T22:40:11","date_gmt":"2014-02-06T06:40:11","guid":{"rendered":"http:\/\/pididu.com\/wordpress\/?p=1969"},"modified":"2017-10-16T14:12:36","modified_gmt":"2017-10-16T22:12:36","slug":"measure-large-capacitance-with-a-picaxe","status":"publish","type":"post","link":"http:\/\/pididu.com\/wordpress\/blog\/measure-large-capacitance-with-a-picaxe\/","title":{"rendered":"Measure Large Capacitance with a PICAXE"},"content":{"rendered":"<p>On a recent <a title=\"PTC breadboard #4\" href=\"http:\/\/pididu.com\/wordpress\/solarbike\/proof-of-concept\/\">breadboard for the power transfer controller<\/a>, I was getting puzzling results. One explanation for the discrepancy might have been that the electrolytic capacitor actually had much more than the label value of 1000 \u03bcF. That seemed possible, as usually no one complains if a bulk bypass capacitor has more capacitance than advertised. It&#8217;s like getting a 16 ounce box of cereal, and finding out that it really has 20 ounces in it. All the better.<\/p>\n<figure id=\"attachment_1971\" aria-describedby=\"caption-attachment-1971\" style=\"width: 640px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/pididu.com\/wordpress\/wp-content\/uploads\/2014\/02\/MeasureCapPicaxe.jpg\"><img decoding=\"async\" loading=\"lazy\" class=\"size-full wp-image-1971\" alt=\"Not many components at all in this circuit.  If the program was rewritten for fully automatic operation, even the two pushbuttons at the bottom could be omitted.\" src=\"http:\/\/pididu.com\/wordpress\/wp-content\/uploads\/2014\/02\/MeasureCapPicaxe.jpg\" width=\"640\" height=\"836\" srcset=\"http:\/\/pididu.com\/wordpress\/wp-content\/uploads\/2014\/02\/MeasureCapPicaxe.jpg 640w, http:\/\/pididu.com\/wordpress\/wp-content\/uploads\/2014\/02\/MeasureCapPicaxe-76x100.jpg 76w, http:\/\/pididu.com\/wordpress\/wp-content\/uploads\/2014\/02\/MeasureCapPicaxe-229x300.jpg 229w\" sizes=\"(max-width: 640px) 100vw, 640px\" \/><\/a><figcaption id=\"caption-attachment-1971\" class=\"wp-caption-text\">Not many components at all in this circuit. If the program was rewritten for fully automatic operation, even the two pushbuttons at the bottom could be omitted.<\/figcaption><\/figure>\n<p>But how to measure capacitance? For a smaller capacitor, I could build a resonant circuit and measure the frequency. But for 1000 \u03bcF, there was a simpler way, and it was easy to make from parts already on hand.<\/p>\n<figure id=\"attachment_1972\" aria-describedby=\"caption-attachment-1972\" style=\"width: 610px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/pididu.com\/wordpress\/wp-content\/uploads\/2014\/02\/measure_capacitance.gif\"><img decoding=\"async\" loading=\"lazy\" class=\"size-full wp-image-1972\" alt=\"Very simple concept - charge the capacitor up, then discharge it through a known resistance and watch how quickly the voltage drops.\" src=\"http:\/\/pididu.com\/wordpress\/wp-content\/uploads\/2014\/02\/measure_capacitance.gif\" width=\"610\" height=\"788\" \/><\/a><figcaption id=\"caption-attachment-1972\" class=\"wp-caption-text\">Very simple concept &#8211; charge the capacitor up, then discharge it through a known resistance and watch how quickly the voltage drops.<\/figcaption><\/figure>\n<p>Above is the circuit I used. The PICAXE processor is a powerful controller, amazing for its $1.50 price tag. It has multiple 10-bit A\/D converters on board, and an embedded serial port.<\/p>\n<p>At the start of the program, the controller brings pin C.2 high. \u00a0C1, the unit under test (UUT), begins to charge through R3. \u00a0D1 is not strictly needed, but provides for quicker charging. \u00a0While this is going on, the A\/D input on pin C.1 is watching the capacitor voltage. \u00a0The A\/D range is 0 to 1023 units, with 1023 being the full supply voltage. \u00a0When the voltage reaches at least 1020 units, the program waits for me to push the start button.<\/p>\n<p>When I push the start button, pin C.2 goes to 0 volts, and the UUT starts discharging through R3. \u00a0(Fortunately, the A\/D converter input has very high impedance compared to 100k, and does not significantly disturb results.) \u00a0The controller then reports the time it takes for the voltage to decay from 1000 units to 368 units. \u00a0These numbers are a very intentional choice, because they represent a decay from 100% to 36.8%, or 1\/e. \u00a0Electrical engineers will recognize it as one time-constant,\u00a0\u03c4, and remember that\u00a0\u03c4 = RC. \u00a0Since\u00a0\u03c4 is reported in mS, and R is 100 k\u03a9, it works out that every 100 mS elapsed translates into 1.0\u00a0\u03bcF. \u00a0In fact, I tried a 105 (1\u00a0\u03bcF) ceramic capacitor, and it read 1.12\u00a0\u03bcF.<\/p>\n<p>In order to read a capacitor as large as the electrolytic, I had to use a smaller value (10 k\u03a9) for R3 so that the timer wouldn&#8217;t overflow. \u00a0So, what was the actual value of my brand-new 50 volt, 1000\u00a0\u03bcF, 105 \u00baC,\u00a0aluminum electrolytic capacitor? \u00a01048 \u03bcF.<\/p>\n<p>Design Notes are <a href=\"http:\/\/pididu.com\/wordpress\/wp-content\/uploads\/2014\/02\/Cap-Measure-Note.pdf\">here<\/a>.<\/p>\n<p>The controller program in BASIC is <a href=\"http:\/\/pididu.com\/wordpress\/wp-content\/uploads\/2014\/02\/measure_capacitance.txt\">here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>On a recent breadboard for the power transfer controller, I was getting puzzling results. One explanation for the discrepancy might have been that the electrolytic capacitor actually had much more than the label value of 1000 \u03bcF. That seemed possible, as usually no one complains if a bulk bypass capacitor has more capacitance than advertised. &hellip; <a href=\"http:\/\/pididu.com\/wordpress\/blog\/measure-large-capacitance-with-a-picaxe\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Measure Large Capacitance with a PICAXE<\/span> <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[204],"tags":[81,65,83,82,56],"_links":{"self":[{"href":"http:\/\/pididu.com\/wordpress\/wp-json\/wp\/v2\/posts\/1969"}],"collection":[{"href":"http:\/\/pididu.com\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/pididu.com\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/pididu.com\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/pididu.com\/wordpress\/wp-json\/wp\/v2\/comments?post=1969"}],"version-history":[{"count":0,"href":"http:\/\/pididu.com\/wordpress\/wp-json\/wp\/v2\/posts\/1969\/revisions"}],"wp:attachment":[{"href":"http:\/\/pididu.com\/wordpress\/wp-json\/wp\/v2\/media?parent=1969"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/pididu.com\/wordpress\/wp-json\/wp\/v2\/categories?post=1969"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/pididu.com\/wordpress\/wp-json\/wp\/v2\/tags?post=1969"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}