Robots and Sensors Workshop: Instructor notes
An all day workshop by Akkana Peck,
for high school senior girls,
as part of GetSET Summer Week 2012 and 2013
This is a longer version of the basic program
page including more discussion for instructors.
- Set up Arduinos and breadboards. Discuss what a microcontroller is,
programming, what we'll be doing in the workshop.
Here's a bigger
picture of an Arduino.
- Discuss what a breadboard is.
Discuss LEDs and resistors: wire up an LED so that it's ON,
using the Arduino as a power source.
Wire an LED and resistor to pin 13.
Learn how to run Arduino software.
Get the LED blinking with "blink" sample sketch.
- Discuss the structure of the blink.pde program.
Experiment with changing delay times.
Discussion, e.g. what if you wanted a short blink then a long delay?
- Add another LED. How do you do that?
What if you wanted one off while the other is on?
- Read a pushbutton:
make it so the light only comes on with the button.
Discuss pull-down resistors.
- Discuss debouncing buttons (maybe).
- Control knobs!
Reading analog input from a potentiometer dial.
Show how to print values with Serial.println.
- How would you make your LED flash faster as you turned the knob?
- Sensors: wire up a photoresistor. Use it just like the potentiometer.
Can you make the LED come on when it's dark, go off when it's light?
(Bump this to the afternoon if we're running out of time.)
- Analog output (PWM): LED fading.
- Making music! Piezo speakers (sometimes called
(Time things so that the buzzer segment happens just before lunch,
when it's getting hard to concentrate anyway.)
(There typically isn't time to do all of these in the morning --
which ones are best to drop? It's probably best to drop pushbuttons
and light sensors but keep potentiometers. Definitely make sure
there's enough time before lunch to cover making sounds.)
Concepts to get across during the morning:
- Fiddling with breadboards, power and ground.
- Analytical thinking and debugging: I've tried not to make the
instructions too cookbook, so students have to think and figure
things out at least a little bit.
- Variables -- set up a global variable, e.g. to control blink rate,
and a local variable to calculate something, e.g. blink rate
as a function of pot input.
There's a separate page with
some ideas for afternoon projects.
Discuss options for team projects for the rest of the afternoon.
- Cylon eyes or other light patterns with multiple LEDs.
- Something with a contact sensor or tilt
switch and piezo buzzer,
to make a door or cupboard alarm.
- Making music: a light Theremin
with a piezo speaker and
- IR motion sensors.
Make a burglar alarm that makes noise or lights up when
sometime walks in front of it.
- Sonar rangefinder.
You could add some LED lights or a speaker, and change the
lights or make more noise depending on the distance you read.
- Robot cars.
If you get one working, you can try adding a motion sensor or
rangefinder so it stops before it hits the wall.
(There's also an older page on
Motor control in general.)
- Or make your car even smarter: line following with two photoresistors.
Find out who's interested in working on what (if everybody wants to hear
about something, can do that in front of the class; there's a lot of
variety, then teams can all work separately).
It's also fine for teams to join up and do a bigger project: like one team
build a moving car while another team works on a sensor that will sit
on the car.
End of day: show & tell! What did you build, how does it work,
what parts were hard to figure out, what did you learn?
For each team:
- 1 Arduino and USB cable
- 1-2 red, 1 green LEDs with resistors
- pushbutton (and pulldown resistor)
- photoresistor (and pulldown resistor)
- piezo buzzer
- extra red and (a few) green LEDs
- lots of 50 Ω and 10 kΩ resistors
- Some 200Ω and 1kΩ resistors
- lots of multicolored stripped wire segments, at least 10-15 per team.
- 4 mini joysticks (analog)
- 2 infrared proximity sensors
- 6 slide on/off switches
- 6 tilt switches
- batteries (AA and 9v), clips, holders, and Arduino barrel plugs.
- 5 dual motor driver circuits, pre-wired up
- 5 cannibalized R/C cars for motor driving
- alligator clips
- a few extra breadboards
- tools: voltmeters, soldering iron?
I have some sample code in my
github Arduino repository
plus lots more Arduino