A very quick and dirty introduction to
Sensors, Microcontrollers, and 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
Microcontrollers can have a variety of input/output devices that either are or can be hooked up to transducers:
microphone: air pressure->mic element->magnet->electricity
speaker: electricity->magnet->speaker cone->air
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
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".
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.
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
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.
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...
LED: Light Emitting Diode. They come in lots of pretty colors and sizes.
motor: makes things spin
soleniod: pushes/pulls/wacks things
piezo element speaker: a special type of speaker.
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