Project 1: Introduction To Arduino and LED Blink Description
Project 1: Introduction To Arduino and LED Blink Description
Description:
1. Build and wire a device with one LED, resistor, and Arduino board.
2. Program the device to “Blink the Light”
3. Identify the flow of electricity / signal in this computing unit.
4. Use the Blockly Programming system to control speed of Blink.
3. Red Wire
4. White Wire
5. Black (Or dark colored Wire)
Process:
1. Run a red Wire from the 5V Pin to the Red Rail on the Breadboard. This will connect the current side
of the circuit.
2. Run a black (or dark colored wire) from the Gnd Pin of the Arduino to the Blue Rail on the far side of
the Breadboard.
3. Plug an LED bulb into the circuit. Note that the longer pin will face the Arduino Board and the pins
should cross the “gap” in the breadboard. (Plug the Long Pin into F5 and the Short Pin into E5).
4. This step is VERY IMPORTANT!!! Plug a 330 OHM resistor from Port B5 to Ground (The blue rail). An
LED bulb must ALWAYS have a Resistor in the circuit. If we do not use a Resistor, we will burn out the
bulb or the Arduino Board.
5. Now we will run the signal wire. Wire Pin 9 on the Arduino to H5 on the Breadboard. This will carry
the current from the Arduino Pin to the LED and allow the Arduino to switch on and off the LED.
2. We want to define a procedure (write directions) for our Arduino Blinky to switch the light. Click on
”Procedures” and drag a procedure block to the screen.
3. We need to name our ‘procedure’. Click on the title block and name the block ‘blink’. (Note that we
will always start procedures with a lower case letter).
4. Click on ‘In/Out’ and drag a ‘DigitalWrite PIN#’ block and place it inside the ‘blink’ block.
5. Our Arduino device has the LED plugged in to Pin 9. So we will change the PIN# to 9:
6. ‘HIGH’ means to turn the current on for the Pin. We will leave this set to HIGH. Next, click on
‘Control’ and drag a ‘Delay’ block into the ‘blink’ function.
7. We want the LED to blink on for ½ second and off for ½ second. The Delay takes in numbers
measuring in milliseconds. That means 1000 milliseconds equals 1 second. For ½ a second, we will
place the number 500 in the delay block. Click on ‘Math’ and drag a number block inside the ‘Delay’
block.
8. Now type ‘500’ in the Delay block.
9. This will turn the LED on. Add the following blocks to have the LED turn off. Note that we set the
value of ‘Stat’ to ‘LOW’ and place another Delay 500 block.
10. We are almost done! We have defined the procedure ‘blink’ and told the Arduino what to do. Now
we need to tell the Arduino when to run this function. Drag a ‘do blink’ block from the Procedures
menu and place it on the screen.
11. You are done! Click “Save XML” to save your work. (It will download on your computer.)
12. Follow the steps in the next section to download and run your code.
Downloading the Blockly Program to the Arduino
Arduino Micro-Processor: A mini computer with memory, processing, input, and output. We can
program this computer to control electrical current and signals to control electric powered devices.
Breadboard: Where we can wire electrical circuits and make connections without permanently
soldering the connections. A test platform for developing electronic devices.
Signal: A pulse or pulses of electrical current to carry information. The Arduino uses signals to control
LED’s, speakers, motors, and other devices.
Current: A steady state of charge from the positive side of the circuit
Volts: The measure of potential energy difference between the positive and negative side of a circuit.
Amps: The measure of how much current passes through the circuit in a given length of time.
LED: Light Emitting Diode. Acts as a one way gate for current and will emit a light when current is
passed through the LED. LED’s use very little power and are very common in electronic devices. Any
light you see on an electronic device most likely is created by an LED.
Resistor: Resists the flow of current and electrons in a circuit. Measured in Ohms.