0% found this document useful (0 votes)
71 views9 pages

LED Blink V2.0

This document describes how to make an LED blink using an Arduino board. It requires an LED, resistor, breadboard, jumper wires, and an Arduino UNO board. The code uses the digitalWrite() function to turn the LED on for 1 second and off for 1 second by writing HIGH and LOW to the digital pin connected to the LED. Connecting the components based on the schematic and loading the sample code causes the LED to continuously blink on and off.

Uploaded by

testscribd
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
71 views9 pages

LED Blink V2.0

This document describes how to make an LED blink using an Arduino board. It requires an LED, resistor, breadboard, jumper wires, and an Arduino UNO board. The code uses the digitalWrite() function to turn the LED on for 1 second and off for 1 second by writing HIGH and LOW to the digital pin connected to the LED. Connecting the components based on the schematic and loading the sample code causes the LED to continuously blink on and off.

Uploaded by

testscribd
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

LED blink

Overview

This example shows the simplest thing you can do with an Arduino to see physical
output: it blinks an LED.

Specification

za
ra

Hardware required
sm

Material diagram Material name Number


220/330Ω resistor 1
LED 1

USB Cable 1

UNO R3 1

Breadboard 1

Jumper wires Several

1
Component Introduction

LED:

LEDs make great indicator lights. They use very little electricity and they
pretty much last forever.
In this lesson, you will use perhaps the most common of all LEDs: a 5mm
red LED. 5mm refers to the diameter of the LED. Other common sizes are
3mm and 10mm. You cannot directly connect an LED to a battery or
voltage source because 1) the LED has a positive and a negative lead and
will not light if placed the wrong way and 2) an LED must be used with a
resistor to limit or 'choke' the amount of current flowing through it;
otherwise, it will burn out!
If you do not use a resistor with an LED, then it may well be destroyed
almost immediately, as too much current will flow through, heating it
and destroying the 'junction' where the light is produced.
There are two ways to tell which is the positive lead of the LED and which
za
the negative.
Firstly, the positive lead is longer.
ra

Secondly, where the negative lead enters the body of the LED, there is a
sm

flat edge to the case of the LED.


If you happen to have an LED that has a flat side next to the longer lead,
you should assume that the longer lead is positive.

2
RESISTORS:

za
ra

As the name suggests, resistors resist the flow of electricity. The higher
sm

the value of the resistor, the more it resists and the less electrical current
will flow through it.
We are going to use this to control how much electricity flows through
the LED and therefore, how brightly it shines.
But first, more about resistors...
The unit of resistance is called the Ohm, which is usually shortened to Ω
the Greek letter Omega. Because an Ohm is a low value of resistance (it
doesn't resist much at all), we also denote the values of resistors in kΩ
(1,000 Ω) and MΩ (1,000,000 Ω).
These are called kilo-ohms and mega-ohms.
In this lesson, we are going to use three different values of resistor: 220
Ω, 1kΩ and 10kΩ. These resistors all look the same, except that they
have different colored stripes on them. These stripes tell you the value of
the resistor.
The resistor color code has three colored stripes and then a gold stripe

3
at one end.
Unlike LEDs, resistors do not have a positive and negative lead. They can
be connected either way around.
If you find this approach method too complicated, you can read the
color ring flag on our resistors directly to determine its resistance value.
Or you may use a digital multimeter instead.

BREADBOARD MB-102:
A breadboard enables you to prototype circuits quickly, without having
to solder the connections. Below is an example.

za
ra

Breadboards come in various sizes and configurations. The simplest kind


sm

is just a grid of holes in a plastic block. Inside are strips of metal that
provide electrical connection between holes in the shorter rows. Pushing
the legs of two different components into the same row joins them
together electrically. A deep channel running down the middle indicates
that there is a break in connections there, meaning, you can push a chip
in with the legs at either side of the channel without connecting them
together. Some breadboards have two strips of holes running along the
long edges of the board that are separated from the main grid. These
have strips running down the length of the board inside and provide a
way to connect a common voltage. They are usually in pairs for +5 volts
and ground. These strips are referred to as rails and they enable you to
connect power to many components or points in the board.
While breadboards are great for prototyping, they have some limitations.
Because the connections are push-fit and temporary, they are not as
reliable as soldered connections. If you are having intermittent problems

4
with a circuit, it could be due to a poor connection on a breadboard.

Connection

Schematic

za
ra
sm

5
Connection diagram

za
ra
sm

Note:The longest LED of the pin is connected to the digital signal port 13(D13).

6
Sample code
Note: sample code under the Sample code folder
// 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);
}

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


void loop()
{
digitalWrite(led, HIGH);
delay(1000); // wait for a second
digitalWrite(led, LOW);
delay(1000);
za
}
ra
sm

7
Example picture

za
ra
sm

8
Language reference
Tips:click on the following name to jump to the web page.
If you fail to open, use the Adobe reader to open this document.
int
setup()
pinMode()
OUTPUT
loop()
HIGH
LOW
digitalWrite()
digitalRead()
delay()
; (semicolon)
{} (curly braces)
= (assign)
// (comment)
za
Application effect

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

******************************************************************************************
* About Smraza:
* We are a leading manufacturer of electronic components for Arduino and Raspberry
Pi.
* Official website: http://www.smraza.com/
* We have a professional engineering team dedicated to providing tutorials and
support to help you get started.
* If you have any technical questions, please feel free to contact our support staff via
email at support@smraza.com
* We truly hope you enjoy the product, for more great products please visit our
Amazon US store: http://www.amazon.com/shops/smraza
Amazon CA store: https://www.amazon.ca/shops/AMIHZKLK542FQ
Amazon UK store: http://www.amazon.co.uk/shops/AVEAJYX3AHG8Q
Amazon DE store: http://www.amazon.de/shops/AVEAJYX3AHG8Q
Amazon FR store: http://www.amazon.fr/shops/AVEAJYX3AHG8Q
Amazon IT store: http://www.amazon.it/shops/AVEAJYX3AHG8Q
Amazon ES store: https://www.amazon.es/shops/AVEAJYX3AHG8Q
******************************************************************************************

You might also like