slides - HWS Department of Mathematics and Computer Science

1 downloads 54 Views 16MB Size Report
The cult of Arduino claims another victim ... with your laptop by downloading the Arduino. IDE from .... Practical Arduino by J. Oxer and H. Blemings. ○ Making ...
CCSCNE 2012

Hands-on Computing with Arduino John Vaughn Dept. of Math/Computer Science Hobart and William Smith Colleges [email protected] math.hws.edu/vaughn Quick start at www.arduino.cc

Road map for this session ●

What is embedded computing?



What is Arduino?



Demonstrations of Arduino, shields, etc.



The cult of Arduino claims another victim



How Arduino fits into a CS curriculum



Sample projects



Lessons learned



Questions, comments, etc

Preliminaries ●





The plan is to talk, demonstrate, answer questions for about 45 minutes then leave 20+ minutes for detailed questions, discussion, etc. You can follow along, reading or building code with your laptop by downloading the Arduino IDE from www.arduino.cc. For Mac, Windows, and Linux (apt-get). I have some Arduinos, cables, and shields if you want to experiment with them toward the end of this tutorial.

Embedded Computing ●

● ●





Traditionally microprocessors doing specialized tasks as part of a system Thermostats, factory controls, autopilots, etc. Micro suppliers: TI, Intel, Motorola, NEC, Microchip, Atmel, ARM, many more Timeline: Engineers rule, print journals, hobby web sites, robot contests, cheap sensors, free/open source tools, boom! Italian group offers a turn-key hardware and software toolkit for programming Atmel AVR

Arduino Family and Relations ●

Open source specification for a family of devices using Atmel AVR Mega 8-bit micros



Open source IDE (Mac, Windows, Linux)



Simplified C++ style programming language



Basic libraries for serial comm, sensors, PWM



Shields (add-on PCBs) for hardware expansion





Coordinator for contributed libraries: SPI, I2C, CAN,1-wire, IR remote, SD card, Zigbee, Ethernet, Bluetooth, PS/2, gyros, etc Clones: Boarduino, ChipKit, etc ( 70+)

Arduino Uno Hardware (CAD)

Image Courtesy Arduino.cc

Arduino Uno Hardware

Image Courtesy Arduino.cc

Arduino LilyPad Hardware

Image Courtesy Arduino.cc

Adafruit Prototyping Shield

Image Courtesy Adafruit Industries

Arduino Starter Demonstration ●

Start up Arduino IDE



Attach USB cable and Arduino



Choose serial port and board type



Open a (source code) sketch (.pde or .ico)



Compile, download, and reset board



Bootloader handles the download, code start



Communicate/debug via Serial Window (Processing Language programs, etc)

The Cult of Arduino Claims Another Victim ●

Call for embedded project ideas from faculty



Enthusiastic response from biology colleague



● ●



Idea: build and equip a bat house with sensors to monitor/log bat behavior Two students collaborated on the project Data: temperatures, ambient light, entry/exit detection, real time clock (RTC), and logging Future options: wireless downloads, video, etc

Bat House version 0.9 ●

Arduino Duemilanove



Adafruit industries prototyping shield



DS18B20 1-wire thermometers (3) 2



DS1307 RTC (real time clock) I C



IR break beam receiver and LEDs (4)



CdS photocells (2)



Serial EEPROM I2C



Serial comm menu for configuration/control



Photo-voltaic cell, A123 batteries, charger

Wiring Sensors

Construction/Testing

Electronics Prototyping

Bat House ● ●



version1.01

Added SD card storage, better UI, tweaks Custom shield designed using Eagle CAD, manufactured through BatchPCB Source code available through Creative Commons license



Write an article, submit to Circuit Cellar ink



Time to move on ...

Eagle CAD Design/Production

Step Away from the Arduino, sir! ●





Biology colleague: bird house monitoring project follows from bat house project! Why not data collection via Bluetooth or just phone the bird house (GSM Shield!) and ask for data? Why not indeed? Creates an accessible iPod player for his stepson using Arduino...



...and an Arduino scanner/digitizing project...



...GPS collar tracking project in the pipeline!



It goes on.

How does Arduino fit in the CS curriculum? ●









Easy on-ramp. Students knowing Java can begin coding in a single day using simplified C++ syntax Programming is combined with controlling/reading "real world" devices Sensors provide (noisy) inputs requiring different algorithms: Example: Sharp sensor lookups Students face holistic design problems: DS + algorithms, electronics, sensors, enclosures, power, filtering, HID, ad hoc protocols, etc. Cash and carry: students can literally own their projects such as clocks, robots, etc.

Sample Arduino Projects ●



● ●

Ideal prerequisites: Two semesters of programming (Java) and a computer architecture course. Electronics unlikely. Emphasis is on design first, solder later, and code last! Hard to enforce. Focus on useful, everyday objects for projects. Themes: communication, motion, display, and aesthetics.

Image Gallery of Projects 2012

Image Gallery Projects 2012

Some Lessons Learned ●

Students bring very different physical skills



Electronics is a challenge, takes time



Soldering, hands-on work is an acquired taste



Initial startup of a lab can be expensive



Half life of boards and software is limited



Debugging hardware (comm) is tedious



Literal ownership of projects is attractive



Thinkering is not a misspelling

Resources & References ●

www.arduino.cc



www.sparkfun.com



ww.adafruit.com



www.mouser.com



www.digikey.com



Arduino Cookbook by Michael Margolis



Practical Arduino by J. Oxer and H. Blemings



Making Things Talk by Tom Igoe



287 book entries listed on Amazon

Suggest Documents