Arduino Microcontroller Workshop - ecology labfaculty.cse.tamu.edu/slupoli/notes/Robotics... ·...

Post on 20-Jun-2020

43 views 7 download

Transcript of Arduino Microcontroller Workshop - ecology labfaculty.cse.tamu.edu/slupoli/notes/Robotics... ·...

Arduino Microcontroller Workshop UMBC Institute of Electrical and Electronics Engineers

Sekar Kulandaivel

sekark1@umbc.edu

Week 1: Arduino Basics with LEDs

Technical Skills Series Presentation

April 1st – 2nd, 2014 Arduino

UMBC IEEE

Topics to Cover

Circuits and Microcontroller Basics

Transducers (Sensors and Actuators)

Arduino’s Analog-to-Digital Converter

Pulse Width Modulation

Connecting the Arduino

1. Plug in your Arduino and open Arduino IDE

2. Select Tools > Board > Arduino Leonardo

3. Select Tools > Port > COM#

4. Select Files > Examples > 01.Basics > Blink

5. Code should compile and upload to Arduino

– if RX and TX LEDs start blinking rapidly, then

upload is successful …

L LED should blink every second

Troubleshooting

COM port doesn’t appear

– Unplug cable and try again

Upload fails

– Press Reset button when “Uploading…” appears

Anything else?

– RAISE YOUR HAND!

Introduction to Circuits

Power Source and Loads

Current, Voltage, and Resistance (Ohm’s Law)

Series vs. Parallel Circuits

Utilizing a Multimeter

+5V

Sourc

e

1K Resistor

GRO

UN

D

2K Resistor

5 0.015 15330

v iR

v iR

V A mA

Color 1st Digit 2nd Digit Multiplier

Black 0 0 100

Brown 1 1 101

Red 2 2 102

Orange 3 3 103

Yellow 4 4 104

Green 5 5 105

Blue 6 6 106

Violet 7 7 107

Gray 8 8 108

White 9 9 109

L R 4th band is Tolerance.

330Ω

10kΩ

2kΩ

1MΩ

3 3 x 101 =

1 0 x 103 =

2 0 x 102 =

1 0 x 105 =

Made with Fritzing.org

Circuit Building Tips

Light-emitting diodes (LEDs) have polarity

– longer lead is + and shorter lead is –

Pushbuttons contains switches

– switch connects top two pins to bottom two pins

Potentiometer is large and chunky

– position it so that you have space to turn it

TRACE YOUR CIRCUIT!

– if you see smoke, unplug your USB cable

Made with Fritzing.org

Made with Fritzing.org

Made with Fritzing.org

Challenge!

Try building same circuit using three

potentiometers instead of the photoresistors!

Use the same setup from single potentiometer.

Focus on placement of analog wire.