2. Who am I?
Research Engineer by profession
Buildâs robots as a hobby
Playing with Arduino for more than 3 years
Blog about Arduino at http://hardwarefun.com
Moderator for Arduino India forum
http://hardwarefun.com 2
4. Objective
Introduce Arduino
Learn about robotics
Learn about sensors
Build a small bot
Make it autonomous
Fully hands on
Details at http://hardwarefun.com/arduino-workshop
http://hardwarefun.com 4
13. How to use a breadboard
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 13
15. Different Arduino types
Arduino Uno (The one used for this workshop)
Arduino Mega
Arduino Due
Lillypad
Arduino BT
Arduino Ethernet
.. and clones
http://hardwarefun.com 15
17. Identify these components in
Arduino
Microcontroller
Power jacket
USB jacket
Digital pins
Analog pins
Reset button
http://hardwarefun.com 17
18. Identify these components in
Arduino
Voltage Regulator
Power Pins (how many are there?)
Ground Pins (how many are there?)
Vin Pin
Rx and Tx Pins
ICSP Headers
http://hardwarefun.com 18
19. Identify these components in
Arduino
Power Led
Rx and Tx Ledâs
Test Led
Crystal
Anything else?
http://hardwarefun.com 19
21. Different ways to power up Arduino
Using USB cable
Using DC power jacket
Giving voltage directly into Vin pin
Giving regulated voltage directly into 5V pin
http://hardwarefun.com 21
25. Making a LED blink
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 25
26. Anatomy of an Arduino sketch
http://hardwarefun.com 26
27. Printing values through Serial
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
SoftwareSerial is also available
http://hardwarefun.com 27
32. Reading Analog values from sensors
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 32
33. 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);
}
}
35. Analog Output
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 35
48. Teaching robot to crawl
Move Forward
Both motors rotate in the forward direction
Move Backward
Both motors rotate in the reverse direction
Turn left
Left motor stops. Only right motor rotates forward
Turn Right
Left motor moves forward. Right motor stops
50. What we will see tomorrow
Varying the speed of the motor
How IR works
Making use of IR to find obstacles
Make the bot avoid strangers
Making it autonomous
Future ideas
http://hardwarefun.com 50
51. Links
ï Arduino â http://arduino.cc
ï Asimi â A simple bot using Arduino
http://hardwarefun.com/project/asimi
ï Getting started with hardware programming
http://hardwarefun.com/tutorials/getting-started-with-
hardware-programming
ï Getting started with Arduino
http://hardwarefun.com/tutorials/getting-started-with-
arduino-and-avr
ï Workshop Details http://hardwarefun.com/arduino-
workshop
52. Questions
Thank You
Sudar Muthu (@sudarmuthu)
http://hardwarefun.com/arduino-workshop
https://github.com/sudar/arduino-robotics-workshop