SlideShare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our User Agreement and Privacy Policy.
SlideShare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our Privacy Policy and User Agreement for details.
Successfully reported this slideshow.
Activate your 14 day free trial to unlock unlimited reading.
6.
• The first two and the last two rows are
connected
• In all the other rows, columns are connected
• Connect the first and last row to power
• Connect the second and second last row to
ground
http://hardwarefun.com 6
How to use a breadboard
8.
• Using USB cable
• Using DC power jacket
• Giving voltage directly into Vin pin
• Giving regulated voltage directly into 5V pin
http://hardwarefun.com 8
Different ways to power up Arduino
12.
• Insert a LED in pin 13
• Open File->Examples->Basics->Blink
• Select Tools->Boards->Arduino Uno
• Select File->Upload (or press ctrl+u)
• You should get the message “Done upload”
• Your Led should blink
• Congrats you can program Arduino now
http://hardwarefun.com 12
Making a LED blink
13.
Anatomy Of An Arduino Sketch
http://hardwarefun.com 13
14.
Things you can try
• Vary the frequency at which the LED is
blinking
• Add more LED’s
15.
• Uno has one UART hardware port, using which
we can exchange information with computer
• Very useful for debugging
• Works at a specified baud rate
• Use Serial Monitor to read values (Tools ->
Serial Monitor)
• SoftwareSerial is also available
http://hardwarefun.com 15
Printing values through Serial
16.
Reading values from Serial
serial.read()
serial.print()
serial.println()
https://github.com/sudar/arduino-
sketches/blob/master/SerialPrint/SerialPrint.ino
17.
Digital Input And Output
http://hardwarefun.com 17
22.
• Connect the LDR on pin A0 and Gnd
• LDR’s resistance varies based on the amount
of light present
• Read the current value using analogRead()
• Print the value in Serial Monitor
http://hardwarefun.com 22
Reading Analog values from sensors
23.
Code
Open File->Examples->Basics->AnalogReadSerial
25.
• What is PWM?
• Analog like behavior using digital output
• Works by switching the LED on and off
regularly
• Changing the brightness of a Led
http://hardwarefun.com 25
Analog Output
27.
Combining Input and Output
http://hardwarefun.com 27
28.
Control an LED based on light
void setup()
{
pinMode(13, OUTPUT);
}
void loop()
{
int val = analogRead(A0);
if (val > 50) {
digitalWrite(13, HIGH);
} else {
digitalWrite(13, LOW);
}
}
29.
Things to try
• Control LED based on button press
• Alternate two LED’s based on button press
• Persist the status of button
30.
Moving Forward
• Connect to display devices like 7-segment
display or LCD
• Connect to motion sensors
• Connect to other components like shift
register etc
• Connect to a RTC chip
31.
Things which I have tried
• Connecting to mobile Android phones using
– Bluetooth
– Wired and wireless
– Audio Jacket
– NFC
– ADK
• Connected all sorts of display devices including VGA devices like projectors
• Connected external USB devices like keyboard, mouse and even USB Missile
launchers - http://hardwarefun.com/tutorials/controlling-usb-missile-launchers-
using-arduino
• Connected ez430 chronos watch
• Connected IR devices like TV Remotes etc
• Connected bluetooth devices like WiiRemote
• Created small autonomous bots that can be controlled by either a WiiRemote or
Android phones - http://hardwarefun.com/projects/asimi
• Detect motion using PIR, IR and ultrasound motion sensors
• More projects at http://hardwarefun.com