Arduino
Arduino
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.
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
Complete
Next Know your Arduino
Know your Arduino
What is a Micro-controller ?
What is an Arduino?
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.
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
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.
You’ll be able to program your Arduino with almost any computer using a
software called an integrated development environment (IDE).
Mac OS X or higher
Windows XP 32- or 64-bit, or higher
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
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.
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.
Example 1
Example 3
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 on LED 2
Turn on LED 3
Turn on LED 4
Repeat infinitely
What we need:
Four LEDs of any color
Four 220 Ω Resistors
Breadboard
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.
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
void loop()
}
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