Nov 9, 2009
Course materials for Designing Interaction with Electronics workshop 2009 at Mlab
Date: November 9 – 13, 2009
Location: Media lab Helsinki in Helsinki, Finland
Course materials:
Introduction: 9.00-11.00 – PDF, some final demos
Group discussion 11:10 – 14:00
Assembling electronics: 14.00-15.30
- Basic tools: you need following equipments to run example codes.
- Arduino board (microcontroller)
- USB Type A-B
- Breadboard
- Jumper wires
- Multimeter
- Understanding schematics
- Flow of positive charge
- Most popular components
- Markings in resistor (Resistulator dashboard widget)
- Markings in capacitor
- Exercise: Assemble electronics
- Checking your circuit
- Measuring voltage, resistance and conductivity
- Exercise: Assembling touch sensor – Video
Setting up Arduino environment: 15.30 – 16.00
Select following setting when you run Arduino software first time.
Tools > Board > Arduino NG or older w/ ATmega8
Mac: Serial Port > /dev/cu.usbserial-xxxxxxxx
Win: Serial Port > COM1
Tuesday
Programming microcontroller
Basics: 09:00-10.00
- Exercise: Hello world – Arduino code
- Exercise: Introduction (Flashing LED) – Arduino code
- Exercise: Sending data to your PC (Serial.print, println) – Arduino code
- Exercise: Understanding ASCII (American Standard Code for Information Interchange) – Arduino code
- Exercise: Type of Numbers (Binary, Hexadecimal, Decimal, Signed Decimal) – Arduino code
Architecture: 10.00-11.00
- Exercise: Variables type definitions – Arduino code
- Exercise: Arrays/Strings – Arduino code
- Exercise: Operators (+, -, *, /, %) – Arduino code
Controls: 11.00-12.00
- Exercise: Functions – Arduino code
- Exercise: Looping structure (For statement) – Arduino code
- Exercise: Branching (If statement) – Arduino code
- Exercise: Branching (Switch statement) – Arduino code
- Exercise: Data controls (ramdom) – Arduino code
IO Commands: 13.00-16.00
- Digital IO (digitalWrite)
- Exercise: Flashing LED – Schematic, Arduino code
- Digital IO (digitalRead)
- Exercise: QT113 touch sensor – Schematic, Arduino code
- Digital IO (pulseIn)
- Exercise: Memsic 2125 Accelerometer: Measuring tilt and motion – Schematic, Arduino code
- Exercise: Ping))) Ultrasonic Sensor: Measuring distance – Schematic, Arduino code
- Analog IO (analogWrite using PWM pins)
- Exercise: Dimming LED – Schematic, Arduino code
- Analog IO (analogRead)
- Exercise: Photoresistor: Measuring ambient light – Schematic, Arduino code
- Exercise: Flexiforce Sensor Demo Kit: Measuring pressure – Schematic, Arduino code
- Exercise: Piezo speaker: Detecting vibrations – Schematic, Arduino code
- Extend capability using libraries (#include)
- Exercise: Servo motor –Schematic, Arduino code
Wednesday
Serial communication: 9:00-12.00
- RS-232
- Baud rate : One baud is one electronic state change (one bit) per second. (e.g. Serial.begin(9600))
- Parity : odd, even, or none (e.g. none parity)
- Data bits : 5, 6, 7, or 8bits (e.g. 8bits)
- Stop bits : 1, 1.5, or 2 (often says true = 1 stop bits)
- Baud rate : One baud is one electronic state change (one bit) per second. (e.g. Serial.begin(9600))
Communicating to PC 10:00 – 12:00
Messenger library provides a simple protocol to send and receive values to PC using Serial communication.
Mac: Copy Messenger folder (messenger > Arduiono folder) to following location
Arduino.app > (Show package contents) > Contents > Resources > Java > hardware > libraries. After restarting Arduino.app
Import the library in your code by selecting Sketch > Import Library… > Messenger.
- Processing
- Demo: Schematic, Processing code, Arduino code
- Pure Data
- Demo: Schematic, Puredata patch, Arduino code
- Flash
- Demo: – Schematic , Serial server in Processing (written by Tom Igoe), Arduino code, Flash file
- S60 Python using Arduino BT
Group work : 13:00 – 16:00
Thursday
Group work: 9:00-16.00
Friday
Presentation: 13.00-15.00