Arduino at CCEMX July 2007


home - people - contents - location


 Mon, Jul 30thTue, Jul 31stWed, Aug 1stThu, Aug 2ndFri, Aug 3rd
10.00arrivalsession 2session 3session 4session 5
|     
11.00intro    
|     
12.00session 1    
|     
13.00  Processing intro  
|     
14.00 PD intro lunchlunch
|     
15.00lunchlunchlunchsession 4session 5
|     
16.00     
|     
17.00     
|     
18.00     
|    talk
19.00     
|     
20.00     

Introduction

link: slideshow used for the presentation

[click on the pictures to see the information]

Session 1

  • Introduction to Arduino
  • Install party: get the software running
  • Basic Output examples: LED Blink
  • Knight Rider exercise
  • Using the breadboard
  • Components: LED (polarity), resistor (ohms, no polarity)
  • Software commands: pinMode(pin, INPUT/OUTPUT), digitalWrite(pin, HIGH/LOW), delay(time)
  • Software structures: variable declaration, void setup(), void loop()
  • Color coding: Red (voltage), Black (ground), others (signals)
  • Digital values: HIGH - ON - 5V - 1 - TRUE // LOW - OFF - 0V - 0 - FALSE
  • Recommended materials: Evan's programming booklet, Banzi's arduino booklet, installing arduino on Mac

Session 2

  • digital inputs: using a wire, using a button, using a pull-up resistor
  • Software commands: digitalRead(pin), if (statement) {} else {}
  • difference between assigning (=) and comparing (==)
  • Serial library: Serial.begin(speed), Serial.print(data), Serial.println(data), Serial.print(data,BYTE), Serial.available(), Serial.read()
  • using puredata: objects, messages, numbers, events, sliders, netsend, netreceive
  • Serial monitors: Zterm for Mac, BrayTerminal for Windows, GTKTerm for Linux

Session 3

  • analog input: analog digital conversion (ADC), more info
  • Software commands: val = analogRead(pin), analogWrite(pin, value), delayMicroseconds(time), for(init;until;increment)
  • MCU's way of reading analog signals: reading voltage
  • Components: potentiometer, piezo, LDR
  • Circuits: basic resistive sensor connection, piezo as a speaker
  • analog output: Pulse Width Modulation (PWM), fading control with Potentiometer
  • Sound production: period = 1/frequency, generating tones
  • Software commands: creating functions, using parameters

Session 4

  • complex sensors: measuring the environment requires the use of intelligent sensors that include their own microprocessors to handle data. Examples of this are accelerometers, ultrasound, infrarred, etc.
  • it is good to consider what we are measuring from an abstract point of view and then see which tools will make it possible afterwards. E.g. if we want to measure presence, we should consider different types of sensors to do that: LDRs for close distances (<10cms), IR for intermediate distances (10-80cms), US for long distances (30cm-10m)
  • using the ultrasound sensor PING from Parallax: the trick is to use one pin both as input and output during the loop. The way to do this goes through changing a pin's configuration interactively in the process using pinmode(pin,INPUT/OUTPUT). The sensor acts very much like a sonar, sending one US signal when requested, and listening to the echo coming back. The result is expressed by the sensor as a pulse which width denotes the distance to the object in front of it. The US sensor is very accurate, but has to be placed at the object's nose
  • Example with the PING sensor
  • components: transistor, US sensor, DC motor
  • types of motors: DC, stepper, servo
  • DC motors: run freely, hard to control their position/speed, can use as less as 2,5Volts, speed can be controlled using PWM, we use relays, transistors or H-bridges to control them from Arduino
  • Stepper motors: unipolar or bipolar, rotate a certain amount of degrees at each pulse. Typical values of angles are 1,8 - 3,6 - 7,2 ... we use transistors or transistor chips to control them. They have 4 or more wires!
  • Servo motors: they will rotate to a certain angle depending on a PWM value we push into them. Servo motors are used in car models to control the direction, model-planes for hte flaps, etc.
  • moving DC motors using a transistor: use a power transistor (IRFZ24N) and a 10K resistor to control a DC motor's speed
  • as a final exercise, people had to control a DC motor from PD

Session 5

  • people worked with their own ideas, however it is relevant to take a look at:
  • controlling an LCD screen
  • Arduino.burningBootloader
  • the workshop ends with a whole collection of small try-outs: sensors talking to software packages, Pd controlling motors, etc.

PD intro

  • created by M. Puckette, distribution maintained by H.C. Steiner
  • native (C) software package, multiplatform
  • allows the creation of code through visual commands
  • used for handling flows of data, mainly in sound production, but also video, 3D, etc
  • there is an object called comport that allows reading data from a serial device, it has two parameters: port number, and communication speed
  • thanks to that object we can both send and receive data into/from Arduino
  • there is an Arduino program called Firmata by H.C. Steiner that allows to read/write all the pins from/to Arduino from yet another PD object called arduino

Processing intro

  • created by C. Reas and B. Fry with support among others from the MIT Medialab
  • Java software package, multiplatform
  • simplifies the creation of code-made animations
  • used for interactive installations, motion capture, web production, video postproduction, etc
  • there is a library called Serial that includes a whole series of commands to read/write data from/to the serial port
  • print(Serial.list()) will print a list of all the available ports in the system, together with a number that will identify them
  • the port is created as a software object: myPort = new Serial(this, Serial.list()[number], 9600)

Talk

  • this was a talk held at CCEMX on behalf of the workshop's organizers. The aim was to bring the concepts behind the workshop to a broader audience. We used the first slideshow, plus a whole selection of examples of people doing things with Arduino

Funky examples

During the workshop we found some funky examples of things made with Arduino:

  • automatic picture shooting: someone made a camera to shoot pictures of a dead pig's decomposition and animated it