SlideShare a Scribd company logo
1 of 42
An Arduino
Workshop

By: Andrew Tuline
Overview
•
•
•
•
•
•

Introductions
Check out the kits
Do the drivers work?
Experiment time
Some reference material
Create your own project

If you like, you can go at your own pace
Introductions

Work on your own or work as a team, and help each other out.
Open ‘er Up
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
17.
18.
19.
20.
21.
22.
23.
24.
25.
26.
27.
28.
29.
30.

1 pcs x for Arduino UNO board
1 pcs x Development expansion board
1 pcs x Breadboard
5 pcs x LED kit (red / blue / yellow)
1 pcs x 74hc595
2 pcs x Buzzers
1 pcs x Seven-segment display (1-digit)
1 pcs x Seven-segment display (4-digit)
~10 pcs x Push button switches
3 pcs x Light dependent resistors
5 pcs x 10K resistors
5 pcs x 1K resistors
~8 pcs x 220R resistors
1 pcs x Adjustable resistor
1 pcs x LM35 temperature sensor
1 pcs x 1602 LCD display
1pcs x PS2 joystick
1 pcs x Stepping motor
1 pcs x Stepping motor driver board
1 pcs x Steering engine (servo)
1 pcs x RGB LED module
~30 pcs x Breadboard cables
~10 pcs x Dupont lines
1 pcs x 2.54mm pin header
2 pcs x Mercury switches
1 pcs x Flame sensor
1 pcs x Infrared receiver
1 pcs x USB cable (80cm)
1 pcs x Remote control
1 pcs x Battery case

Err . . most of it should be there.
The Official Arduino Robot
> $300
Or you can build
your own for less

Do a Google search for ‘Sumobot’.
Installing Arduino DE
• On Windows 7
• Installs to C:Program Files (x86)Arduino
• Your programs are in C:UsersuseridDocumentsArduino
• ‘Tools | Board’ should say ‘Arduino UNO’
• In Device Manager, see ‘Ports (COM & LPT)’
• Device drivers in C:Program Files (x86)ArduinodriversFTDI
USB Drivers

You running 32 bit or 64 bit?
Touring the IDE
• ‘File | Examples’ includes lots of examples
• ‘File | Upload’ is how we compile and upload our program to
the Arduino
• ‘Help | Reference’ includes a local copy of the Language
Reference
A Breadboard
Simple Schematic
Simple Layout

1) Connect the power bus first.
2) Add the LED and resistor.
3) Connect them to the power bus.
Ohm’s Law
Current = Volts / Resistance
or

I=E/R
If we have a 5 volt battery and a 200 ohm resistor.
5 volts / 200 ohms = .025 amps

The higher the resistance, the lower the current.
Don’t Blow It Up
•
•
•
•

An LED needs about 1.4 volts to light up.
An LED should run at around .02 amps.
If you put 5V into an LED, it could burn out.
We’ll need a resistor to reduce the voltage and
ensure adequate current.

5V - 1.4V = 3.6V
I = E / R is the same as R = E / I
R = 3.6 / .02 = 180 ohms
Blinky LED Layout

Move the red wire from 5V to pin 13.
Blinky LED Code

What happens if you move the red wire to 5V and the black to pin 13.
Button Schematic

We’ll light up the internal LED when the switch is pushed.
Button Layout

Why the 10K resistor?
Button Code
/* Button
*/
const int buttonPin = 2;
const int ledPin = 13;

// the number of the pushbutton pin
// the number of the LED pin

int buttonState = 0;

// variable for reading the pushbutton status

void setup() {
pinMode(ledPin, OUTPUT);
pinMode(buttonPin, INPUT);
}
void loop() {
buttonState = digitalRead(buttonPin);

// read the state of the pushbutton value

if (buttonState == HIGH) {
digitalWrite(ledPin, HIGH);
}
else {
digitalWrite(ledPin, LOW);
}
}

You can make this code a lot shorter!
Analog vs. Digital

Analog outputs are expensive!
Analog vs. PWM Signals

PWM is cheap to implement!
Fade Schematic
Fade Layout
Fade Code
/* Fade
*/
int led = 9;
int brightness = 0;
int fadeAmount = 5;

// the pin that the LED is attached to
// how bright the LED is
// how many points to fade the LED by

void setup() {
pinMode(led, OUTPUT);
}

// declare pin 9 to be an output

void loop() {
analogWrite(led, brightness);

// set the brightness of pin 9 (it’s not really analog)

brightness = brightness + fadeAmount;
if (brightness == 0 || brightness == 255) {
fadeAmount = -fadeAmount ;
}

// reverse the direction of the fading at the ends of the fade

delay(30);
}

// change the brightness for next time through the loop

// wait for 30 milliseconds to see the dimming effect
Analog Read Schematic

Try both the potentiometer
and the joystick for this
experiment.
Analog Read Layout
Analog Read Code
/* Analog Read
*/
void setup() {
Serial.begin(9600);
}

// initialize console output at 9600 bits per second
// Press ctrl-shift-m to bring up the console

void loop() {
int sensorValue = analogRead(A0);
Serial.println(sensorValue);
delay(10);
}

// read the input on analog pin 0
// print out the value you read
// delay in between reads for stability

The potentiometer is logarithmic while the joystick is linear.
Potentiometer Fader
• The joystick provides values between 0 – 1023
• The LED takes values between 0 – 255
• We need to scale to fit

ledValue = map(joystickValue, 0, 1023, 0, 255);

Either divide the sensor value by 4
OR
Use the ‘map’ command
Potentiometer Fader Schematic
Potentiometer Fader Code
/* Potentiometer Fader
*/

const int analogInPin = A0;
const int analogOutPin = 9;

// Analog input pin that the potentiometer is attached to
// Analog output pin that the LED is attached to

int sensorValue = 0;
int outputValue = 0;
void setup() {
Serial.begin(9600);
}
void loop() {
sensorValue = analogRead(analogInPin);
outputValue = map(sensorValue, 0, 1023, 0, 255);
analogWrite(analogOutPin, outputValue);
Serial.println(outputValue);
delay(2);
}

You could also use the joystick to change the frequency of the fade!
Fader Variations
• Hook up the RGB LED (common cathode)
• Use the x/y of the joystick to control
brightness and fade speed
• Use the button to change colours
• Adjust the map ranges
• Create a colour cycling fader
Light and Sound Schematic
Light and Sound Code
/* Light and Sound
*/
void setup() {
Serial.begin(9600);
}
void loop() {
int sensorReading = analogRead(A0);
Serial.println(sensorReading);
// map the analog input range (in this case, ~80 - 310 from the photo resistor)
// to the output pitch range (100 - 1000Hz)
int thisPitch = map(sensorReading, 80, 310, 100, 1000);

tone(9, thisPitch);
delay(1);

// play the pitch on pin 9
// delay in between reads for stability

}

Not quite the same value resistors as on the web site – so fudge it!
Additional Experiments
•
•
•
•
•
•
•

LCD display
Servo
Stepper motor
Temperature sensor
Tilt sensor
Shift register
IR sensor
There’s thousands online!
Now THIS Is A Breadboard
More Cool Parts and Kits
•
•
•
•
•
•
•
•

Ultrasonic Sensor
Motor driver board
Robot chassis
LED Strips
8x8 LED display
Color organ board
Electroluminescent wire
Ardupilot
You’ve still got to program it!
Tools
•
•
•
•
•
•
•
•

Needle nose pliers
Multi-meter
Wire strippers
Wire cutter
Soldering iron + solder + flux + wick
Vise
3rd hand
Oscilloscope (for those with $$$)
I need strong reading glasses and good light!
Arduino Tutorials
•
•
•
•
•

arduino.cc/tutorial
playground.arduino.cc
tronixstuff.com/tutorials
learn.sparkfun.com/tutorials
oomlout.com/a/products/ardx

Don’t forget the examples included with the Arduino software
Inspirational Web Sites
•
•
•
•

www.instructables.com
www.tindie.com
www.makershed.com
www.makezine.com
Sources for Parts
•
•
•
•
•
•
•

www.robotshop.ca
www.sparkfun.com
www.leeselectronics.com
www.adafruit.com
www.ebay.ca
www.amazon.com
www.dealextreme.com

A VISA card helps
University
Hardware Hacker

https://diy.org/skills/hardwarehacker
Make Something

More Related Content

What's hot

Introduction to arduino
Introduction to arduinoIntroduction to arduino
Introduction to arduino
Ahmed Sakr
 
Introduction to the Arduino
Introduction to the ArduinoIntroduction to the Arduino
Introduction to the Arduino
Wingston
 
Introduction to arduino ppt main
Introduction to  arduino ppt mainIntroduction to  arduino ppt main
Introduction to arduino ppt main
eddy royappa
 

What's hot (20)

Introduction to Arduino Hardware and Programming
Introduction to Arduino Hardware and ProgrammingIntroduction to Arduino Hardware and Programming
Introduction to Arduino Hardware and Programming
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
Arduino Workshop Day 2 - Advance Arduino & DIY
Arduino Workshop Day 2 - Advance Arduino & DIYArduino Workshop Day 2 - Advance Arduino & DIY
Arduino Workshop Day 2 - Advance Arduino & DIY
 
Arduino presentation by_warishusain
Arduino presentation by_warishusainArduino presentation by_warishusain
Arduino presentation by_warishusain
 
Introduction to arduino
Introduction to arduinoIntroduction to arduino
Introduction to arduino
 
Intro to Arduino
Intro to ArduinoIntro to Arduino
Intro to Arduino
 
Introduction to the Arduino
Introduction to the ArduinoIntroduction to the Arduino
Introduction to the Arduino
 
Arduino
ArduinoArduino
Arduino
 
Arduino IDE
Arduino IDE Arduino IDE
Arduino IDE
 
Arduino
ArduinoArduino
Arduino
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
Arduino Microcontroller
Arduino MicrocontrollerArduino Microcontroller
Arduino Microcontroller
 
Wi-Fi Esp8266 nodemcu
Wi-Fi Esp8266 nodemcu Wi-Fi Esp8266 nodemcu
Wi-Fi Esp8266 nodemcu
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
Arduino for beginners- Introduction to Arduino (presentation) - codewithgauri
Arduino for beginners- Introduction to Arduino (presentation) - codewithgauriArduino for beginners- Introduction to Arduino (presentation) - codewithgauri
Arduino for beginners- Introduction to Arduino (presentation) - codewithgauri
 
Arduino slides
Arduino slidesArduino slides
Arduino slides
 
Arduino
ArduinoArduino
Arduino
 
Arduino course
Arduino courseArduino course
Arduino course
 
Different Arduino Boards
Different Arduino BoardsDifferent Arduino Boards
Different Arduino Boards
 
Introduction to arduino ppt main
Introduction to  arduino ppt mainIntroduction to  arduino ppt main
Introduction to arduino ppt main
 

Viewers also liked (7)

Catalogo unitronics 2012_intrave
Catalogo unitronics 2012_intraveCatalogo unitronics 2012_intrave
Catalogo unitronics 2012_intrave
 
8x8 dot matrix(project)
8x8 dot matrix(project)8x8 dot matrix(project)
8x8 dot matrix(project)
 
Temperature Sensor with LED matrix Display BY ►iRFAN QADOOS◄ 9
Temperature Sensor with LED matrix Display BY ►iRFAN QADOOS◄ 9Temperature Sensor with LED matrix Display BY ►iRFAN QADOOS◄ 9
Temperature Sensor with LED matrix Display BY ►iRFAN QADOOS◄ 9
 
5x7 matrix led display
5x7 matrix led display 5x7 matrix led display
5x7 matrix led display
 
Temperature sensor with a led matrix display (arduino controlled)
Temperature sensor with a led matrix display (arduino controlled)Temperature sensor with a led matrix display (arduino controlled)
Temperature sensor with a led matrix display (arduino controlled)
 
Moving message display
Moving message displayMoving message display
Moving message display
 
Role of easy vr in Arduino Speech Processing
Role of easy vr in Arduino Speech ProcessingRole of easy vr in Arduino Speech Processing
Role of easy vr in Arduino Speech Processing
 

Similar to Arduino Workshop

Arduino Workshop (3).pptx
Arduino Workshop (3).pptxArduino Workshop (3).pptx
Arduino Workshop (3).pptx
HebaEng
 

Similar to Arduino Workshop (20)

Arduino Workshop (3).pptx
Arduino Workshop (3).pptxArduino Workshop (3).pptx
Arduino Workshop (3).pptx
 
Intro to Arduino
Intro to ArduinoIntro to Arduino
Intro to Arduino
 
Arduino Slides With Neopixels
Arduino Slides With NeopixelsArduino Slides With Neopixels
Arduino Slides With Neopixels
 
Physical prototyping lab2-analog_digital
Physical prototyping lab2-analog_digitalPhysical prototyping lab2-analog_digital
Physical prototyping lab2-analog_digital
 
Physical prototyping lab2-analog_digital
Physical prototyping lab2-analog_digitalPhysical prototyping lab2-analog_digital
Physical prototyping lab2-analog_digital
 
Fun with arduino
Fun with arduinoFun with arduino
Fun with arduino
 
Led fade
Led  fadeLed  fade
Led fade
 
Iot 101
Iot 101Iot 101
Iot 101
 
Arduino Workshop Slides
Arduino Workshop SlidesArduino Workshop Slides
Arduino Workshop Slides
 
publish manual
publish manualpublish manual
publish manual
 
Arduino programming
Arduino programmingArduino programming
Arduino programming
 
arduinoworkshop-160204051621.pdf
arduinoworkshop-160204051621.pdfarduinoworkshop-160204051621.pdf
arduinoworkshop-160204051621.pdf
 
Multi Sensory Communication 2/2
Multi Sensory Communication 2/2Multi Sensory Communication 2/2
Multi Sensory Communication 2/2
 
Cassiopeia Ltd - standard Arduino workshop
Cassiopeia Ltd - standard Arduino workshopCassiopeia Ltd - standard Arduino workshop
Cassiopeia Ltd - standard Arduino workshop
 
Neno Project.docx
Neno Project.docxNeno Project.docx
Neno Project.docx
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 
Introduction to Arduino Microcontroller
Introduction to Arduino MicrocontrollerIntroduction to Arduino Microcontroller
Introduction to Arduino Microcontroller
 
Intro_to_Arduino_-_v30.pptx
Intro_to_Arduino_-_v30.pptxIntro_to_Arduino_-_v30.pptx
Intro_to_Arduino_-_v30.pptx
 
Arduino intro.pptx
Arduino intro.pptxArduino intro.pptx
Arduino intro.pptx
 
Intro to Arduino Revision #2
Intro to Arduino Revision #2Intro to Arduino Revision #2
Intro to Arduino Revision #2
 

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 

Arduino Workshop

Editor's Notes

  1. I want to do that and more and I’m going to use the highly popular Arduino Microcontroller.
  2. Get programmers to team up with non-programmers. Helping out each other is critical to success.
  3. Let’s go through some menu items.
  4. An optional slide, depending on the audience.