Wiring Blink to +5v

Learning Goals

by completing this activity students will think about Arduino outputs as circuit components, having voltage current and polarity.

Students will learn to an alternative way to connect an Arduino output .

(this is an Electronics knowledge activity )

Theory

The blink tutorial shows how to connect an LED between the data pin and ground. This simple circuit allows current to flow (conventional current flow) from pin 13 to the Arduino ground (gnd) pin, when the pin is set HIGH (+5v) by the sketch and pin 13 on the Arduino with the cathode (-) side of the LED facing gnd. The circuit can be wired and work just as well when wired from the +5v pin to pin 13 on the Arduino with the cathode (-) side of the LED facing pin 13.

Instructions

Connect the following circuit which has one LED connected to the traditional Ground pin and a second connected to the +5v pin. Load the blink program and observe the operation. Trace the current flow through the circuit when pin 13 is HIGH and when pin 13 is LOW or gnd.

Which LED is on when the sketch makes pin 13 HIGH?

Why does the other LED go out when Pin 13 goes HIGH.

If you are having trouble seeing what is going on in the program and the circuit at the same time make the following changes to the sketch and try again. (Changes to blink marked in red. The changes will slow down the blink and output to the serial monitor when the pin is high and low. Click the looking glass icon in the upper right of the Arduino Screen to see the text. )

/*

Blink

Turns on an LED on for one second, then off for one second, repeatedly.

code changes will show on the serial monitor the voltage state at pin 13

This example code is in the public domain.

*/

// Pin 13 has an LED connected on most Arduino boards.

// give it a name:

int led = 13;

// the setup routine runs once when you press reset:

void setup() {

// initialize the digital pin as an output.

pinMode(led, OUTPUT);

Serial.begin(9600);

}

// the loop routine runs over and over again forever:

void loop() {

digitalWrite(led, HIGH); // turn the LED on (HIGH is the voltage level)

Serial.println(" Pin 13 is HIGH, +5 volts ");

delay(5000); // wait for a second

digitalWrite(led, LOW); // turn the LED off by making the voltage LOW

Serial.println(" Pin 13 is LOW, gnd or 0 volts");

delay(5000); // wait for a second

}

Adding a serial print lines to a sketch is a good technique for seeing what is going on in a program when it is difficult to tell from the normal circuit outputs.

Have the Teacher demonstrate the correct use of the of the multi-meter to take the following voltage readings, pay careful attention to voltage and polarity.

(copy this table into your Arduino Assignment)