Day 2 Arduino Advent Calendar
First published at Saturday, December 02 2017
Arduino Advent Calendar Day 02 - Fade, Flicker and Twinkle
I hope you conquered yesterday's installation of the Arduino software and got your onboard LED blinking. Again, if you need help, hit us up on the forums.
In our Day Two baggie you should find:
- 3x LEDs (Light Emitting Diodes)
- 1x 220 Ohm resistor, with stripes that are red, red, black, black, and gold
- 1x mini breadboard
Today we're going to take this a step further an do the "Hello World!" of electronics.
What is a "Hello World!"?
In the world of programming a "Hello, World!" program is an easy computer program that outputs or displays "Hello, World!" to a user. It's used to illustrate the basic syntax of a programming language for a working program. In the world of electronics, the "Hello, World!" is blinking an LED.
LED stands for light emitting diode, and they're used in nearly every gadget you own, from your tail lights to your TV or even toothbrush! Ok, but what is a diode? A diode is a component that lets electricity pass in only one direction, just like a one-way valve. LEDs are just a type of diode that converts electrical energy into light.
The first thing you need to know about LEDs is that polarity matters?
The LED we're using today has two legs one of which is positive (called the anode) and the negative (called the cathode).
Which LED leg is which?
The long leg is the anode (+) and the short leg is the cathode (-).
Electrical current only flows from the anode to the cathode, as such if we get our wiring backwards, the LED will not light up.
What is this "current" thing? Current is the flow of electronics through a circuit and it's measured in "Amperes".
We can control the brightness of our LED by controlling the amount of current that flows through it. More current equals more brightness.
LEDs are greedy and will attempt to dissipate as much power as they can get from our Arduino's pins to the point where they'll have an untimely death! To prevent this untimely death we need another component called a resistor to limit the amount of current that can go through the circuit.
A resistor is a component that has an electrical resistance. Resistance is anything that impedes the flow of electrons through a circuit. We measure resistance in Ohms.
Today we're going to place a resistor in our circuit so we can protect our LED from drawing too much current.
On the Day 2 Guide you'll find a hookup guide which will show you how to build the circuit and three programs you can run on the Arduino that will take advantage of the circuit.
Without further ado, let's get on with the Day 2 Guide!
We're happy to help!
If you find you're getting stuck with today's guide, hit up our team of highly trained Arduino ninjas on this forum thread.