making a light theremin with Arduino
Adapted from the Arduino Projects Book.
- For this project, you'll need:
- Let's start by downloading and installing Arduino. It's free!
build the circuit
- While that's downloading (it won't take very long), start putting your Arduino and Breadboard together. Check out this diagram. Some things to watch out for:
- Make sure the 5v wire is plugged into the Breadboard's power (+ positive) row.
- Make sure the Ground (GND) wire is plugged into the Breadboard's ground (- negative) row.
- Make sure your Piezo lines up horizontally with a negative charge and the wire from the 8 pin.
- Make sure your Photoresistor lines up horizontally with a positive charge and the wire from the A0 pin (which should also line up with the 10 Kilohm Resistor).
write some code
- Alright, let's write some code. Here's what you need to type into your Arduino sketch. When you're done, save it.
verify, compile, and transfer your code
- Plug the USB cable into your microcontroller and then into the computer.
- Hit the Upload button. That's the arrow at the top of the Arduino screen window (just below Edit).
- Did you get an error? That's okay! Click on Copy error to clip board, and then paste into a text editor. This error report will list which lines in your code have errors. Look closely and fix accordingly.
- Once your code has been verified, click the Upload button again. You'll then see some lights blink for a few seconds on your microcontroller as well as a progress bar at the bottom of your Arduino window move toward the right. That tells you it's compiling and transferring the code over to the Arduino.
calibrate your theremin
- Once the lights on the microcontroller and the progress bar stop, you'll have five seconds to calibrate your theremin. Move your hands around the photoresistor in the same manner that you'll use to play your theremin. TIP: the photoresistor may be tiny, but it's quite sensitive. Don't limit your hand movements to just a few inches--1-3 feet works like a charm!
play your theremin
- It's time to rock out. Go nuts on that thing and annoy the heck out of anyone within earshot.
fine "tune" your theremin
- You can adjust aspects of the theremin's sound by changing some of the source code. For instance, change the 500 value pitch variable to 1000 or even 4000. That will give a greater range to your sounds (i.e. the highs will be higher and the lows will be lower). Or change the delay() value to make the tones last longer or shorter.
other things you can do with your theremin
- This is a super simple introduction to making a theremin, so really it's just the beginning of stuff you can do with this circuit and code combo. Here are a few additional variations you can try:
- Piezo not loud enough? Of course it's not. Turn it into an mini amp! Just place it inside a condiment cup or create a cone from a paper towel tube.
- The feed doesn't have to be light based--it can be anything that sends a signal. Use a Flex Sensor to bend your sounds or, heck, set up a Temperature Sensor to have your sounds shift with the weather.
- Don't like the default Arduino 8-bit sound? Map to PureData and customize your own synth sounds.