March 27
Microcontrollers & Electronics
part one: some basic definitions
why do i care about this?
if you're interested in building your own electronic instruments,
sculpture, interfaces, tools, etc., then you need to learn about sensors,
actuators, microcontrollers, ohms law and other fun things. what you
don't need is a degree in electrical engineering. while EE can be a giant
and scary field, most of what you need to know to start building things
is pretty un-mysterious.
what's a microcontroller?
a microcontroller is a tiny, mostly self-contained computer. they're
generally slow (~8Mhz) and have no monitor, no keyboard, little RAM, etc.
most microcontrollers have a number of digital inputs and outputs. some
have other types of i/o as well.
what's a microcontroller good for?
microcontrollers are good for getting signals from the "real world" into
a computer and conversely, for sending digital signals from the computer
out into the "real world". the soundcard or graphics card in your
computer, for instance, generally contains a microcontroller of some
sort. a computer mouse has a microcontroller in it, as does a keyboard, a
wacom tablet, a MIDI fader box, etc.
what's a transducer?
a transducer changes one form of energy or information into another form
of energy or information. you need to use some sort of transducer to make
use of the input/output capabilities of a microcontroller. some examples
of transducers:
ear: air pressure->ear drum->cochlea->brain
microphone: air pressure->mic element->magnet->electricity
speaker: electricity->magnet->speaker cone->air
ear: air pressure->ear drum->cochlea->brain
violin: arm motion->bow->strings->bridge->body->air pressure
computer keyboard: brain->finger motion->keys->computer
computer CRT monitor: computer->D/A converter->electron
gun->phosphors
microcontrollers can have a variety of input/output devices that either
are or can be hooked up to transducers:
digital input: a "high" voltage (~ +5v) on an input pin will be
read as a "1". a "low" voltage (~ ground/0v) will be read as a "0".
digital output: setting an output pin to "1" will put it at +5v,
while "0" will put it at ground.
A/D converter: converts a voltage to a proportional number
D/A converter: converts a number to a proportional voltage
counter: can be used to measure the frequency of a signal
comparator: can compare two voltages and tell you which is
higher
display driver: can be used to drive LED or other displays
as you can see, transducers are everywhere. information is also
everywhere. the trick to using all of this stuff together is to figure
out what kind of information you want to capture, how you're going to
capture it and move it between domains, and finally what you're going to
do with it once you've got it where you want it.
what's a sensor?
very generally, a sensor is any sort of transducer that helps you to get
information about the "real world" into a system. a mouse senses hand
movements and button clicks and transmits that information to your
computer. a light switch "senses" whether you want the lights to be on or
off and transmits that information to your lighting circuits. while there
are many types of sensors, most of the ones we'll be interested in are
into just a couple of categories. here are some of the general types of
sensors that are useful for art and music making:
button/switch: you know what these are. but there are different
types of buttons and switches. some only work while you're holding them
down (keyboard keys) while others are more like toggles (old skool light
switch). some even have more than one state (old skool television channel
selector). in addition to the common types, there are more exotic buttons
and switches like magnetic switches, tilt switches, proximity switches,
etc.
potentiometer: a simple knob, like the volume knob on a stereo
system. a potentiometer can tell you (more or less) how far something has
turned.
pressure sensor: these come in many shapes and sizes. you press on
them and they tell you (more or less) you hard you're pressing.
light sensor: aka photo-sensor, photo-transistor, photo-diode.
these all work in different ways, but the basic idea is that they tell
you how much light is falling on the sensor.
beam breaker: this is really a type of switch. you get a signal
when a beam of light is broken.
proximity sensor: tells you how far away an object is.
accelerometer: tells you how fast something is moving. sort of.
can also be used to find the spacial orientation of an object.
microphone: duh
contact mic: a special type of microphone that only responds to
physical contact (scraping, tapping, etc), not changes in air pressure.
contact mics are made from ceramic piezo elements.
what's an actuator?
an actuator is sort of the opposite of a sensor. think of a doorbell. the
button is a sensor that determines when someone wants to ring the bell.
the clacker is the actuator that does the ringing. generally we'll say
that an actuator is a transducer that helps you get information from a
system out into the "real world." actuator sort of implies physical
motion, but you could also say that an LED that lights up when you want
it to is an actuator of a sort...
some actuators:
LED: Light Emitting Diode. they come in lots of pretty colors and
sizes.
motor: makes things spin
soleniod: pushes/pulls/wacks things
speaker: duh
piezo element speaker: a special type of speaker made from a
ceramic element. may also be used as a contact mic (see above).
what's next?
in a minute we'll take a look at how some of these sensors and actuators
work. but first we need to look at some basic ideas in electronics.
part two: super basic electronics