You are on page 1of 45

Workshop on Arduino

By
Sri Vignan Technologies
Products & Services
Workshops/Certificate Lab setup/ Center of
Courses Excellence

Sri
Vignan
Real time Projects Technologies Industrial Solutions
We are expertise in

Robotics and Embedded PCB Design& IOT Drones


3D printers systems Fabrication & Design

Image VLSI Power Mecha- Cloud


Processing Design Electronics tronics Computing
What is Arduino?

Arduino is an open-source platform used for building electronics


projects. Arduino consists of both a physical programmable circuit board
(often referred to as a microcontroller) and a piece of software, or IDE
(Integrated Development Environment) that runs on your computer, used to
write and upload computer code to the physical board.
Arduino boards description

1. Power USB
2. Power (Barrel Jack)
3.  Voltage Regulator
The function of the voltage regulator is to
control the voltage given to the Arduino board
and stabilize the DC voltages used by the
processor and other elements.
4. Crystal Oscillator
5, 17. Arduino Reset
6,7,8,9. Pins (3.3, 5, GND, Vin)
Arduino boards description
10. Analog pins
15. Digital I/O
13. Power LED indicator
16. AREF
AREF stands for Analog Reference. It is sometimes, used to set an external
reference voltage (between 0 and 5 Volts) as the upper limit for the analog
input pins.
Arduino boards description
14. TX and RX LEDs
On your board, you will find two labels: TX (transmit) and RX (receive).
They appear in two places on the Arduino UNO board. First, at the digital
pins 0 and 1, to indicate the pins responsible for serial communication.
Second, the TX and RX led (13). The TX led flashes with different speed
while sending the serial data. The speed of flashing depends on the baud
rate used by the board. RX flashes during the receiving process.
Arduino boards description
11. Main microcontroller
Each Arduino board has its own microcontroller (11). You can assume it as
the brain of your board. The main IC (integrated circuit) on the Arduino is
slightly different from board to board. The microcontrollers are usually of
the ATMEL Company. You must know what IC your board has before loading
up a new program from the Arduino IDE. This information is available on the
top of the IC. For more details about the IC construction and functions, you
can refer to the data sheet.
Arduino boards description
12. ICSP pin
Mostly, ICSP (12) is an AVR, a tiny programming header for the Arduino
consisting of MOSI, MISO, SCK, RESET, VCC, and GND. It is often referred to
as an SPI (Serial Peripheral Interface), which could be considered as an
"expansion" of the output. Actually, you are slaving the output device to the
master of the SPI bus.
Arduino references
• Functions
• Variables
• structures
Functions
• Digital I/O
 digitalRead( )
Description: Read the value from a specified digital pin , either high or low.
syntax : digitalRead(pin)
 digitalWrite( )
Description: write a HIGH or a LOW value to a digital pin.
syntax : digitalwrite(pin,value)
 pinMode( )
Description: The pinMode() method sets the specified digital I/O pin as INPUT or OUTPUT. A digital or binary I/O pin can
have two possible values: HIGH or LOW.
syntax : pinMode( pin, mode)
Functions
• Analog I/O
analogRead( )
syntax : analogRead(pin)
analogWrite( )
syntax : analogWrite( pin, value )
Functions
• time
 delay( )
Syntax : delay( ms )
 delayMicroseconds( )
Syntax : delayMicroseconds( us )
 micros( )
Syntax : time = micros( )
 millis( )
Syntax : time = millis( )
Variables
• Constants
HIGH | LOW
INPUT | OUTPUT | INPUT_PULLUP
LED_BUILTIN
true|false
Variables
• Conversion
byte( )
char( )
float( )
int( )
long( )
word( )
Variables
• Data Types
String() array
Bool boolean
Byte char
Double float
Int long
Short string
unsigned char unsigned int
unsigned long void
word
Structure
• Sketch
loop( )
setup( )
Structure
• Control structure:
 Break
 Continue
 Do- while
 Else
 For
 Goto
 If-else
 Return
 Switch…case
 While
Structrue
• Further syntax
#define(define)
#include(include
/**/(block comment)
// (single line comment)
; (semicolon)
{}( curly braces)
Structure
• Arithmetic operators
* ( multiplication)
+ (addition)
 - (subtraction)
 / (division)
 = (assignment operator)
Structure
• Comparison operators
!=(not equal to)
<(less than)
<=less than or equal to)
==(equal to)
>(greater than)
>=(greater than or equal to)
Structure
• Boolean operators
!(logical not)
&&(logical and)
||(logical or)
LED
• (Light Emitting Diode) LED is a PN-junction
diode that mainly
used as a replacement of incandescent
lights. A process
where diode converts electric
current to

light
when electrons change their state
inside
the LED semiconductors.
Circuit diagram for LED
• CODE:
void setup( )
{ pinMode ( 13, OUTPUT); }
void Loop( )
{ digitalWrite (13, HIGH);
delay(1000);
digitalWrite (13, LOW);
delay(1000);
}
RGB
• RGB is called an additive color system
because the combinations of red, green, and
blue light create the colors that we perceive
by stimulating the different types of cone cells
simultaneously. The combinations of red,
green, and blue light will cause us to perceive
different colors.
CODE
voidsetup( )

{ Listen to your Trainer}


Buzzers

• Active Buzzer & Passive Buzzer:


An active buzzer will generate a tone using an
internal oscillator, so all that is needed is a DC voltage. A
passive buzzer requires an AC signal to make a sound. It
is like an electromagnetic speaker, where a changing
input signal produces the sound, rather than producing a
tone automatically.
Circuit diagram for Buzzer
LCD
• The 16×2 translates o a display 16 characters per
line in 2 such
lines. In this LCD each character is
displayed in a 5×7 pixel matrix.
Circuit diagram for LCD
LDR
• A photo resistor or light dependent resistor
is a component that is sensitive to light.
When light falls upon it then the resistance
changes. Values of the resistance of
the LDR may change over many orders of
magnitude the value of the resistance
falling as the level of light increases.
Circuit diagram for LDR
Ultrasonic Sensor
• An Ultrasonic sensor is a device that can
measure the distance to an object by using
sound waves. It measures distance by sending
out a sound wave at a specific frequency and
listening for that sound wave to bounce back.
Circuit diagram for Ultrasonic Sensor
L293D
• L293D is a typical Motor driver or Motor Driver IC
which allows DC motor to drive on either
direction. L293D is a 16-pin IC which can control a
set of two DC motors simultaneously in any
direction. It means that you can control two DC
motor with a single L293D IC. Dual H-bridge Motor
Driver integrated circuit (IC).
Circuit diagram for L293D
Temperature sensor LM35
• LM35 is an integrated analog temperature
sensor whose electrical output is proportional to
Degree Centigrade. LM35 Sensor does not
require any external calibration or trimming to
provide typical accuracies.
Circuit diagram for LM35
Servo
• Servo motor is an electrical device which can
be used to rotate objects (like robotic arm)
precisely. Servo motor consists of DC motor
with error sensing negative feedback
mechanism. It is a closed loop system where it
uses negative feedback to control motion and
final position of the shaft.
Circuit diagram for Servo Motor
IR Sensor
• An infrared sensor is an electronic device,
that emits in order to sense some aspects of
the surroundings. An IR sensor can measure
the heat of an object as well as detects the
motion. These types of sensors measures
only infrared radiation, rather than emitting it
that is called as a passive IR sensor.
Circuit diagram for IR Sensor
Tasks conducted
• Finding distance using ultrasonic sensor displayed in LCD
• Finding temperature using LM35 displayed in LCD
• Working with LDR that control LED & Servo
• Working with IR Sensors which switches the motor using L293D
• Working with Passive & Active Buzzer on IR sensor & LDR detections
• Obstacle avoidance robot
ANY QUERIES
?
THANK YOU

You might also like