Fork me on GitHub

Project Notes

#012 Capacitorial - Graphing Capacitor Discharge

Use an Arduino to charge a capacitor and graph the discharge with Processing.

Here’s a quick video of the circuit in action:

Capacitor discharge graphs with Arduino and Processing

Notes

The circuit uses a digital output pin to charge the capacitor. When the pin is brought low, the LED will be powered by the capacitor discharge (through a current-limiting resistor). A diode prevents the discharge from being fed back into the digital output pin.

The voltage at the positive terminal of the capacitor is read with an analog input pin, with the value echoed to the Arduino serial port.

Grapher (a simple Processing sketch) reads the data from the serial port and plots the value over time, with some coloration effects thrown in for good measure. In other words, we’re using Arduino and Processing as a basic oscilloscope! And it kind of works, mainly because the frequency is so low.

The Breadboard Schematic

The Build

Varying the capacitance

Varying the capacitance will affect the storage potential and discharge rate.

47uF

At 47uF, the capacitor is given enough time to fully charge (note the plateau), and discharge is very rapid. 47uF

470uF

470uF

1000uF

1000uF

Credits and References

About LEAP#12 RC

This page is a web-friendly rendering of my project notes shared in the LEAP GitHub repository.

Project Source on GitHub Return to the LEAP Catalog
About LEAP

LEAP is my personal collection of electronics projects - usually involving an Arduino or other microprocessor in one way or another. Some are full-blown projects, while many are trivial breadboard experiments, intended to learn and explore something interesting.

Projects are often inspired by things found wild on the net, or ideas from the many great electronics podcasts and YouTube channels. Feel free to borrow liberally, and if you spot any issues do let me know or send a pull-request.

NOTE: For a while I included various scale modelling projects here too, but I've now split them off into a new repository: check out LittleModelArt if you are looking for these projects.

Project Gallery view the projects as an image gallery Notebook reference materials and other notes Follow the Blog follow projects and notes as they are published in your favourite feed reader