Vous êtes sur la page 1sur 28

Along with the below components, you’ll get a keypad, shift register,

servomotor, LCD screen 16 * 2, and an ultrasonic sensor in this kit.

Arduino UNO
Arduino Uno is a microcontroller board based on the
ATmega328P. It has 14 digital input/output pins, 6
analog inputs, a 16 MHz quartz crystal, a USB
connection, a power jack, an ICSP header and a reset
button.

Push Buttons
A push-button (also spelled pushbutton) or simply
button is a simple switch mechanism for controlling
some aspect of a machine or a process.

LEDs
A light-emitting diode (LED) is a semiconductor
device that emits visible light when an electric
current passes through it.

DIODE 1N4007
A diode is a device which allows current flow through
only one direction. That is the current should always
flow from the Anode to cathode.

NPN TRANSISTORS
NPN Transistors are three-terminal, three-layer
devices that can function as either amplifiers or
electronic switches.
Arduino UNO
Arduino Uno is a microcontroller board based on the
ATmega328P. It has 14 digital input/output pins, 6
analog inputs, a 16 MHz quartz crystal, a USB
connection, a power jack, an ICSP header and a reset
button.

Resistors
The resistor is a passive electrical component to
create resistance in the flow of electric current.

Ceramic Capacitors
A ceramic capacitor is a fixed-value capacitor in
which ceramic material acts as the dielectric. It is
constructed of two or more alternating layers of
ceramic and a metal layer acting as the electrodes..

9V Battery
The nine-volt battery, or 9-volt battery, is a common
size of battery. It has a rectangular prism shape with
rounded edges and a polarized snap connector at
the top.

Male to Male Jumper Wires


Male to male jumper wire, used in connecting female
header pin of any development board (like arduino)
to other development board or breadboard.

Buzzer
A buzzer or beeper is an audio signalling device,
which may be mechanical, electromechanical, or
Arduino UNO
Arduino Uno is a microcontroller board based on the
ATmega328P. It has 14 digital input/output pins, 6
analog inputs, a 16 MHz quartz crystal, a USB
connection, a power jack, an ICSP header and a reset
button.

piezoelectric.

Photo transistor
Photo transistor is a semiconductor light sensor
formed from a basic transistor with a transparent
cover that provides much better sensitivity than a
photo diode.

Potentiometer
A potentiometer is a three terminal resistor in which
the resistance is manually varied to control the flow
of electric current. The potentiometer consists of
three terminals among which two are fixed and one
is variable.

Temperature Sensor
A temperature sensor is a device that provides
temperature measurement through an electrical
signal.

Seven Segment
Seven segment displays are the output display
devices that provide a way to display information in
the form of image or text.
Arduino UNO
Arduino Uno is a microcontroller board based on the
ATmega328P. It has 14 digital input/output pins, 6
analog inputs, a 16 MHz quartz crystal, a USB
connection, a power jack, an ICSP header and a reset
button.

DC Motors
A motor is an electrical machine which converts
electrical energy into mechanical energy. The
principle of working of a DC motor is that “whenever
a current carrying conductor is placed in a magnetic
field, it experiences a mechanical force”.

Breadboard
A breadboard is a reusable solder-less device used to
build a prototype of an electronic circuit and for
experimenting with circuit designs.

Servo Motor
A servomotor is a rotary actuator or linear actuator
that allows for precise control of angular or linear
position, velocity and acceleration. It consists of a
suitable motor coupled to a sensor for position
feedback.

Keypad
A keypad is a set of buttons arranged in a block or
“pad” which bear digits, symbols or alphabetical
letters. Pads mostly containing numbers are called a
numeric keypad.
Arduino UNO
Arduino Uno is a microcontroller board based on the
ATmega328P. It has 14 digital input/output pins, 6
analog inputs, a 16 MHz quartz crystal, a USB
connection, a power jack, an ICSP header and a reset
button.

Ultrasonic Sensor
An ultrasonic sensor uses a transducer to send and
receive ultrasonic pulses that relay back information
about an object’s proximity.

LCD
LCD. Stands for “Liquid Crystal Display.” LCD is a flat
panel display technology commonly used in TVs and
computer monitors. It is also used in screens for
mobile devices, such as laptops, tablets, and
smartphones.

Shift Register

Shift Registers are sequential logic circuits, capable


of storage and transfer of data. They are made up of
Flip Flops which are connected in such a way that
the output of one flip flop could serve as the input of
the other flip-flop

Complete
Next Know your Arduino
Know your Arduino
 What is a Micro-controller ?
 What is an Arduino?

 How to install the Arduino Software (IDE)

 Setting up the IDE

What is a Micro-controller ?
A microcontroller is a computer present in a single integrated circuit which is
dedicated to perform one task and execute one specific application.

It contains memory, programmable input/output peripherals as well a


processor. Microcontrollers are mostly designed for embedded applications and
are heavily used in automatically controlled electronic devices such as
cellphones, cameras, microwave ovens, washing machines, etc.

Different types of microcontrollers are shown in figure, they are characterized


by their bits, memory architecture, memory/devices and instruction set.
What is an Arduino?

How to install the Arduino Software (IDE)

Setting up the IDE


Arduino is a develpoment board based on the microcontroller ATmega328P. It is
an open source platform which is used for building digital devices and
interactive objects that can sense and control objects in the physical and
digital world.

The Arduino software is easy-to-use for beginners, yet flexible enough for
advanced users. It runs on Mac, Windows, and Linux. For example, teachers
and students have used it to build low cost scientific instruments, to prove
chemistry and physics principles, or to get started with programming and
robotics.

Arduinos come in all sorts of form factors! Here are some of them:
Keep in mind! An Arduino is not a microcontroller. It is a development
board

So what exactly is a development board?

Take a microcontoller and provide it with USB port, HDMI-port, power-input


port, display unit such as Alphanumeric-LCD or other meaningful ways to
display information (such as LEDs or Seven-Segment) and you’ll have a
development board. Arduino is one of the most famous (and very simple)
development boards and there are many versions and types of Arduinos, each
of which has different capabilities in terms of computing characteristics (type
of microcontroller, size of memories, max. clock speed…) as well as interface
functionalities (usb, hdmi, ethernet, number of Input/Output ports, LCD, LEDs).
The version of Arduino that we’ll be using in our Elecduino Kit is in an Arduino
Uno.

It has 14 digital input/output pins (of which 6 can be used as PWM outputs), 6
analog inputs, a 16 MHz quartz crystal, a USB connection, a power jack, an
ICSP header and a reset button.

Why you should learn it ?


Did you ever look at some gadget or machine and wondered how it really
worked? Maybe it was a TV remote control, the automatic fare collection(AFC)
gates at the metro stations, an ATM, or an electronic toy? Or did you want to
create your own robot or a RC car, or perhaps you’d like to control the lights
and fan of your room with your phone? Where and how to start?
Arduino to the rescue! The Arduino can help you reveal the mysteries of
electronics in a very easy and hands-on way. The original creation of Massimo
Banzi and David Cuartielles, the Arduino offers an inexpensive and a very easy
way to create interactive and innovative projects, such as remote-controlled
robots, GPS tracking systems, and electronic games. The Arduino community
has grown exponentially since its introduction in 2005. It’s now a worldwide
industry, supported by a community of people united with the common bond of
creating something new. You can find both individuals and groups, throughout
the globe, all interested in building something ingenious and inventive with the
Arduino.

You’ll be able to program your Arduino with almost any computer using a
software called an integrated development environment (IDE).

You can download it form here – https://www.arduino.cc/en/Main/Software


To run this IDE, your computer should have one of the following operating
systems installed:

 Mac OS X or higher
 Windows XP 32- or 64-bit, or higher

 Linux 32- or 64-bit (Ubuntu or similar)

For Windows, you can choose between the Installer (.exe) and the Zip
packages. We suggest you use the first one that installs directly everything you
need to use the Arduino Software (IDE), including the drivers. With the Zip
package you need to install the drivers manually.

When the download finishes, proceed with the installation and please allow
the driver installation process when you get a warning from the operating
system

Choose the components to install:


Choose the installation directory (we suggest to keep the default one):

The process will extract and install all the required files to execute properly the
Arduino Software (IDE)
The Arduino Integrated Development Environment – Arduino Software (IDE) –
consists of the following- a text editor for writing code, a message area, a text
console, a toolbar with buttons for common functions and a series of menu’s.
The Arduino Integrated Development Environment – Arduino Software (IDE) –
consists of the following- a text editor for writing code, a message area, a text
console, a toolbar with buttons for common functions and a series of menu’s. It
connects to the Arduino board to upload programs and communicate
with it.
Okay, we’re almost there—just two more things to do to finish setting up the
IDE.

1. Open the Arduino IDE. You need to tell the IDE which port the Arduino is
connected to, by selecting Tools -: Serial Port and choosing the appropriate
COM port number.
This is likely to be COM3 or higher (COM1 and COM2 are usually reserved for
hardware serial ports). To find out, you can disconnect your board and re-open
the menu; the entry that disappears should be the Arduino or Genuino board.
Reconnect the board and select that serial port.

2. The final step is to tell the IDE which Arduino board we are using. This is
important, as the Arduino boards come in different variants. For example, as
we are using the Uno, select Tools -: Board -: Arduino Uno.
For example, as we are using the Uno, select Tools -: Board -: Arduino Uno.

Blinking LED Code:


To test that everything is working fine, connect your Arduino board to your
computer, Select the Board and COM port.
Go to File – Examples – Basics – Blink and open this sketch
Once the sketch is opened, click the upload button at the top left.

A few seconds after the upload finishes, you should see the pin 13 (L) LED on
the board start to blink (in orange). If it does, congratulations! You’ve gotten
Arduino up-and-running.

// the setup function runs once when you press reset or power the board
void setup() {
pinMode(LED_BUILTIN, OUTPUT); // initialize digital pin LED_BUILTIN as an output.
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}

pinMode(LED_BUILTIN, OUTPUT);
digitalWrite(LED_BUILTIN, HIGH);
digitalWrite(LED_BUILTIN, LOW);

How it works?
Arduino Uno has an on-board LED you can control. It is attached to digital pin
13. LED_BUILTIN is set to the correct LED pin irrespective of the board, which is
pin 13 in the case of Arduino Uno.

After that we initialize led pin as an output pin with the following line of code:

pinMode(LED_BUILTIN, OUTPUT);

In the main loop, you turn the LED on with the following line of code:

digitalWrite(LED_BUILTIN, HIGH);

This supplies 5 volts to the LED anode. That creates a voltage difference across
the pins of the LED, and lights it up. Then you turn it off with this line:

digitalWrite(LED_BUILTIN, LOW);

That takes the led pin back to 0 volts, and turns the LED off. In between the on
and the off, you want enough time for a person to see the change, so
the delay() commands tell the board to do nothing for 1000 milliseconds, or
one second. When you use the delay () command, nothing else happens for
that amount of time.

You may find that your Arduino board’s LED already blinks when you connect it
to a USB plug. This is because Arduino boards are generally made with the
‘Blink’ sketch pre-installed.

As with any hobby or craft, it’s up to you to take care of yourself and those
around you. At no point while making, testing or using your project, you should
work with the mains current. Leave that to a licensed electrician who is trained
for such work. Remember that contacting the mains current can even kill you.

A breadboard is a simple device designed to let you create circuits without the
need for soldering. They come in various sizes, and the design can vary, but as
a general rule they look something like this:
If you’ve never seen one before, you might wonder how to tell which holes do
what. It becomes a little easier to understand what’s going on when you see
one from the bottom.
Seeing it from this perspective makes it easier to understand what is going on.
The two larger pieces of wire down each side are typically used to connect a
power source to the board. They are usually referred to as power rails. The
other smaller pieces of wire running perpendicular all the way across the board
are used for components in your circuit.

Resistor is a two terminal device which provides resistance (obstruction) to the


flow of current. Resistors can be used to reduce current flow, adjust signal
levels and to divide voltages.

A resistor’s resistance can be determined by the colors on it corresponding to a


color chart.
Let’s take a look at some examples

Example 1

A resistor colored Yellow-Violet-Orange-Gold would be 47 kΩ with a tolerance of


+/- 5%.
Example 2

A resistor colored Green-Red-Gold-Silver would be 5.2 Ω with a tolerance of +/-


10%.

Example 3

A resistor colored White-Violet-Black would be 97 Ω with a tolerance of +/-


20%.

LED is a two terminal semiconductor device which emits light when an electric
current is passed through it.

There are two terminals. The longer one is positive (anode) and the shorter link
is negative (cathode). Current flows anode to cathode. So, connect the larger
pin (anode) to the voltage source and connect shorter pin (cathode) to ground.

In this project, we will use FOUR LEDs and will switch them on/off one by one
creating a kind of wavelike light pattern which will help us know how to
interface LEDs with Arduino.
What we do:
 Turn on LED 1
 Wait for 100 milliseconds

 Turn off LED 1

 Turn on LED 2

 Wait for 100 milliseconds

 Turn off LED 2

 Turn on LED 3

 Wait for 100 milliseconds

 Turn off LED 3

 Turn on LED 4

 Wait for 100 milliseconds

 Repeat infinitely

What we need:
 Four LEDs of any color
 Four 220 Ω Resistors

 Breadboard

 Arduino and USB Cable

 Connecting Wires

Schematic Diagram

Breadboard Diagram
By comparing the wiring diagram to the functions in the sketch, you can begin
to get a sense of the circuit. For example, when we use digitalWrite(2, HIGH), a
high voltage of 5 V flows from digital pin 2, through current-limiting resistor,
through the LED via the anode and the cathode, and then finally back to the
Arduino’s GND socket to complete the circuit. Then digitalWrite(2, LOW) stops
the current and the LED turns off.

Running the sketch:

Now connect your Arduino using the USB cable and upload the sketch. After a
second or two, the LEDs will blink from right to left and then back again.
Success is a wonderful thing and should be embraced! If nothing happens,
then immediately remove the USB cable from the Arduino and re-check that
you typed the sketch correctly. If you find an error, correct it and upload your
sketch again. If your sketch matches exactly and the LEDs still don’t blink,
check the wiring on the breadboard.

You now know how to make an LED blink with your Arduino, but this sketch is
somewhat inefficient. For example, if you wanted to modify this sketch to make
the LEDs cycle more quickly, you would need to alter each delay(500). There is
a better way which we will discuss in the next project.

Code
//Project: Create a blinking LED Wave
void setup()
{
pinMode(2, OUTPUT); // Setting the pin 2 as output

pinMode(3, OUTPUT); // Setting the pin 3 as output

pinMode(4, OUTPUT); //Setting the pin 4 as output


pinMode(5, OUTPUT); // Setting the pin 5 as output

void loop()

digitalWrite(2, HIGH); // Turn on LED 1

delay(100); // Wait for 100ms

digitalWrite(2, LOW); // Turn off LED 1

digitalWrite(3, HIGH); // Turn on LED 2

delay(100); // Wait for 100ms

digitalWrite(3, LOW); // Turn off LED 2

digitalWrite(4, HIGH); // Turn on LED 3

delay(100); // Wait for 100ms

digitalWrite(4, LOW); // Turn off LED 3

digitalWrite(5, HIGH); // Turn on LED 4

delay(100); // Wait for 100 ms

digitalWrite(5, LOW); // Turn off LED 4

}
In the code above, in void setup() function, the digital I/O pins are set to
outputs, because we want them to send current to the LEDs. We specify when
to turn on each LED using the digitalWrite() function in the void loop() while the
delay() function is used to define time.

Experiment and play with the sketch, perhaps altering the delays and the
sequence of HIGH and LOW. Have some fun with it. Don’t disassemble the
circuit yet, though; we’ll use the same in the next project.

Complete

Vous aimerez peut-être aussi