Experiment 9 from the Inventors Kit for Arduino. In which we explore a capacitor charge circuit. Included in this resource are code downloads, a description of the experiment, and also a video walkthrough. It provides additional help and is not meant to replace the documentation that ships with the kit. Arduino is an open-source code-able electronics platform. The boards can process inputs from many sensors, and also control outputs such as LEDs and motors. The Arduino is controlled by the code with which it is programmed. This code is written in the Arduino programming language, using the Integrated Development Environment (IDE). Once complete, the code is easily transferred to the board using a simple USB lead.
Kitronik Inventors Kit for Arduino Exp 9 Capacitor Charge Circuit:
In this experiment, one of the analog inputs on the Arduino will be used to measure the voltage on a capacitor. A circuit will be created that allows the capacitor to charge. The Arduino will then be programmed to display the charge level of the capacitor. The aims of this experiment are:- To charge an electrolytic capacitor through a potentiometer.
- And to measure the charge of a capacitor by using an analog input.
- To display the charge percentage on the LED display.
- Also, to create a colour coded scale to show capacitor charge level.
Video Walkthrough:
Exp 9 Code:
Either open a new Sketch (File > New) then create the following code by typing in the editor window. Or, click the open code button in the editor to open the code in the online editor.Inventors Kit Extra Resources:
Each of the ten experiments has been designed to ease you into coding and also physical computing for the Arduino. The experiments have been chosen to cover the key concepts of physical computing and they also increase in difficulty as you progress. If you are new to this, even the least complex examples can be quite challenging. With this in mind, we created walkthrough videos for each of the experiments. Our presenter talks you through the circuit in a way that backs up the information given in the booklet but in a style that some might find easier to absorb. As well as having a video walkthrough, each page also contains the code. Although it is always good to tackle the code yourself, it can be handy for testing your circuit. The code has been heavily commented as an extra learning resource. To get the most out of the experiment, once you've tested your circuit have a go at coding the experiment from scratch. Follow the links in the table below:Exp No#. | Experiment Name. |
---|---|
Digital Inputs & Outputs. | |
Light Sensor & Analog Inputs. | |
Dimming an LED using a potentiometer. | |
Using a transistor to drive a motor. | |
Control a servo with a potentiometer. | |
Setting the tone with a piezo buzzer. | |
Using a seven segment display. | |
Exploring wind power. | |
Capacitor charge circuit. | |
Using an RGB LED. |
©Kitronik Ltd – You may print this page & link to it, but must not copy the page or part thereof without Kitronik's prior written consent.
2 comments
Mark Donnison
Hi Anthony, thanks for the heads up and sorry for the mistake. I will follow this up. I'm glad you were able to get to the bottom of it, apologies again for the error.
Anthony
Hi, I recently purchased the Kitronik Inventors Kit for Arduino, which came with a tutorial book. Rather than just copying the code directly from the website, I encouraged my 11 year old son to type the code directly from the book as this would help him to better understand the coding language and to allow him to identify typing errors in his code when manually typing it. So it was disappointing when on experiment #9 that the code provided in the book does not match the code on the website i.e. use of brackets at the 'else if' statements. After establishing that the compiler error as not being related to any typo's in my son's code versus the code supplied in the book, I debugged it and identified the error in the code provided in the book. We corrected them and then the program compiled successfully. After looking at the code on the website I see it is correctly written. The book is version is 1.0, I just wanted to highlight this code difference and to suggest that perhaps the website should highlight this error. Regards, Anthony