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
Project Source on GitHub Return to the LEAP Catalog

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

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 (IMHO!).

The projects are usually inspired by things found wild on the net, or ideas from the sources such as:

Feel free to borrow liberally, and if you spot any issues do let me know. See the individual projects for credits where due. There are even now a few projects contributed by others - send your own over in a pull request if you would also like to add to this collection.