Housekeeping
- How have you been? VOLCANOES.
- Next few sessions will be special topics in ‘extending’ the existing tools we’ve already looked (networks, wireless interfaces, interfacing to other production paths and programs)
Rationale
So far in this module we’ve looked at the capabilities of a couple of in-computer systems for multimedia (Max/MSP and Processing). These are powerful environments for the manipulation of data, and as we’ve seen we can use them to get input from the real world.
The device we’ve been using for this (the Arduino board) is actually capable of a whole host of other things… on it’s own!
Why do we care about the physical world?
The uses of the Arduino and other microcontroller platforms like it (e.g.: PIC microcontrollers, ATMEL) are replete – they are in everything from your car to your dishwasher to your alarm clock and can control or interpret very slight/small scale actions (LEDs turning on) as well as interconnect to larger, more complex systems (networks, motors, etc.).
Electronics!
- Voltage, Current and Resistance
- Components:
- Breadboard
- Resistors
- Capacitors
- LEDs
- Relays
- Transistor
- Voltage Regulator
- Microcontrollers
- Datasheets (e.g.: for a sparkfun accelerometer)
- Chip, IC, integrated circuit (these have different packages – DIP is our fav, TSOP requires a breakout board – there are many others)
- PCB -
- Schematic (what’s connected to what) –> Layout –> Printed board
- Perf Board
- DIY single sided boards
- Eagle CAD
- fritzing!
Arduino – The Project
- Atmel chip based mini-computer – ATmega328
- Made in Italy (check out the source map project, by the way)
- Open Source Hardware project – Free as in speech, not as in beer
- Openness has resulted in a panoply of various designs – “variations on a theme”
- Listing here
- Arduino on a breadboard – howto here
- LadyAda is amazing, and this instructable isn’t bad
- Basic system is dependent on
- A bootloader – a small program that comes on the Arduino board when you buy it. It is a communication enabler that lets you program the chip without any weird hardware.
- The specification of a common chip (ATMEL in this case) on which the bootloader is installed and…
- … software on your computer to program the things (The Arduino IDE)
- It is actively being developed, which is always good
- Parts and pieces (image)

- Also can be used…
- “Directly”
- Hacking other interfaces
- Hacking other outputs
- As well as for… timing, triggers, remote control
Resolutions(!) and ADCs
So far – we’ve looked at examples where we were not always using the full 10bit serial ouput from the Arduino. This will not do! (Why?)
- Problem:
- Arduino ADCs converts 0-5V signals into 10bit values
- The serial port only lets us send 8bit values AT A TIME
- Solution:
- ‘Encode’ the numbers coming down the Arduino pipe as ‘ASCII values’
- Decode it on the other end. I.e.: As “the-character-1″, followed by “the-character-0″, etc.
- Speed up the baud rate (just because we can)
- Example – 10 bit ADC readings into Max/MSP
Input: Sensors
We’ve talked about sensors a good amount – but perhaps worth revisiting ‘what’s out there’… Note that many sensors (and electronics in general) are now ‘surface mount’ parts – so you have to be careful about what you order, and make sure you either know how to make or know how to get a break-out board if you want to use these things with the Arduino.
- Switches!
- Types of Switches:
- Mechanical switches – Knife, pushbutton, slide, tilt, DIP
- Magnetic reed switches
- Relays
- Hall effect sensors
- Other Properties
- Pole & Throw (SPST, SPDT, DPST, DPDT)
- Number of ‘positions’ and number of independent conductors that get ‘thrown’ when switch changes Momentary/Toggle
- “Normal” position (open, closed)
- Momentary or toggle
- Types of Switches:
- Potentiometers!
- Staggering applicability…
- Types of Potentiometers:
- Slide potentiometers
- Yo-yo (“string”) potentiometers
- Rotary potentiometers
- Geared, levered, pulley-actuated, etc.
- Other Properties
- Linear vs. Non-linear – Refers to the property of whether or not a given of ‘turn’ gives an equal change in resistance across the entire scale of the potentiometer (more on this later)
- Dampened, notched, sprung, etc.
- Detent (e.g.: variable detent potentiometer)
- Continuous sensors of physical properties
- Thermal – Bimetals (thermo-mechanical) – Thermocouple – Thermistor
- Electromagnetic – Current sensors – Metal detectors – Hall effect sensors
- Mechanical – Pressure:
- altimeter
- barometer
- air-speed – flow? temperature? ultrasonic
- Flow:
- mass flow
- pressure derived
- anemometer
- Tilt:
- accelerometer
- ball&groove
- mercury
- Chemical
- Olfactory
- Gas sensors (volatile organics)
- pH
- Optical and radiation – Geiger counter, photoresistors
- IR & Visible Light
Output: Control
Control, for the most part, comes down to separating the microcontroller system from the power system. This is true because microcontrollers use voltages and currents as ‘signals’ whereas lights and motors and toasters and such use voltages and currents to DO THINGS in the world. It’s a bit like a ‘preamp’ for signals and a ‘power amp’ for moving speakers to create sound.
- DC Lights LEDs
- Small incandescents
- LEDs (lots of shapes and sizes!)
- PWM – analogWrite(pin)
- DC Motors – same same
- AC Motors
- Turning anything AC on and off – disconnect and connect the BROWN WIRE
- Solid State Relays are one way
- AC Lights Incandescent lamps (‘normal’ bulbs) -
- Simple, as they can be directly hooked up to AC current (inefficient, hot, etc.)
- Dimming an AC system is difficult, but possible with a TRIAC circuit (like an AC PWM)
- Fluorescent lamps – Require a ballast to regulate the current into the bulb (i.e.: cannot be hooked up to the wall current!)
- To control the light you need to control the ballast
- Dimming can be accomplished with dimmable ballasts (DSI, switchDIM, DALI
- EL Wire & El Panels
- Servo Motors – good precision, used to be they had no torque – getting better
- Stepper Motors – good torque but a tad more complex (there’s an arduino library)
- EXAMPLES:
- AC motor and AC light triggering with a sensor
- We might want to directly measure one properly and have it effect another… analog input mapping onto some analog output… e.g.: Breath to light
- Also of interest is using the computer to trigger a physical – you can do this with serial command outputs from softwares (as we saw with Ben Freeth’s mist project recently). E.g.: Max/MSP outputs a serial character that is detected by the Arduino, and Arduino launches a control sequence…
Midi / OSC
- Midi – simple serial protocol (i.e.: a specified sequence of data)
- Arduino can output this protocol, as a way of interfacing directly to audio software, etc.
- Good tutorial here
- Another one here is here
- Outputting MIDI from Arduino requires the use of a (for PC) hardware interface or an synth that supports the MIDI protocol
- Inputting MIDI to Arduino requires the use of the same (for PC) hardware interface or a MIDI controller
- Note that MIDI can and is used as a general control protocol for other things – e.g.: for lights
- As for OSC (remember we used this to talk to Processing from Max/MSP?)
- Seems to be a little stalled, but it is possible
- Need to output to UDP (which is possible via the XPORT/Arduino shield)
- EXAMPLE – controlling LIVE from Arduino
Networking
- How does a network work?
- Addresses are addressed with a PORT (or ‘subchannel’) -
- Ports allow for multiple parallel connections to a device
- Any device with a valid IP address can be ‘on the network’ – so
- There are a number of reasons you might want to feed data into/out of Arduino
- You want to make something like this (i.e.: a ‘networked object’)
- You want to talk via network hardware like switches and routers
- You have a long way to go – ETHERNET vs. USB
- Other ideas in “Ubiquitous Computing“
- Other ideas in ambient computing
- Controll motors from the web, shooting an Iraqi
- Interface with projects/platforms like Pachube
- As we know, the Arduino is a serial device – so we need a serial-to-ethernet converter!
- Lantronix Serial to USB converter
- Xport for which there is a shield by Adafruit. Tom Igoe’s now classic email-clock is a good example
- Xport-Direct , Xport-Direct+ , etc … there are others
- We’ll do an example of the XPORT next class
- “Embedded Ethernet Device Server”- model XP1001001-03R
- Basically: Serial to Ethernet Converter – 300 bps to 921,600 bps
- Needs 3.3 VDC supply voltage
- Standard serial Tx, Rx hardware (level conversion using resistors)
- Breakout board from Sparkfun
- Can send emails, run web scripts based on user defined ‘triggers’
- Buy one if you think it’s interesting – shield and xport
- (this is not the actual device we’ll be using in class – but it’s a library-support ethernet shield, available in the UK)
Wireless
- IR serial transfer
- Bluetooth Modules (serial-to-bluetooth) – there is also a Bluetooth Arduino
- 2.4 GHz RF Transceivers (serial-to-radio converters)
- We’ll do an example next meeting with the SENA Bluetooth ESD200:
- 30 Meters range
- 1200~230 Kbps (we use 19200 bps = 19.2 Kbps)
- Buy one here if you want to do hardware<–>computer (arduino <–> maxmsp/processing) wirelessly
- (probably the one to go with)
- (older model)
- (broken website but apparently they sell them)
- (this one is inexplicably double the price of the above…)
Readings
- A few readings to hopefully inspire you along the path to a great project in a month:
To Do
- Control a real-world movement, system or output with an analog sensor
- Think about how this might be thought of as extending yourself
- Think about how it would feel to have that extension occur wirelessly, over the network, online
- Post pictures of your sketch and thoughts on the above online before next class
- Next (and last) exhibition – Extensions of Man – either May 26th or June 2nd (up to you – VOTE!)
- Respond to the theme however you like – BUT RESPOND TO THE THEME
- Please read the marking criteria and present what’s required
