For this project you will need:
- Arduino UNO and USB cable
- A few basic electronic components, as found in most Arduino starter kits: a breadboard, some jumper wires, a piezo, a 10k resistor, and a photoresister.
- Arduino Software IDE installed on a computer, http://www.arduino.cc/ed/Main/Software or use Codebender on Chromebook, http://condebender.cc
Plus the sketches to program the theremin, which can be downloaded from Github:
- Download the ZIP package from the repository, https://github.com/evanwill/arduinoTeaching/archive/master.zip
- Unzip the file (“arduinoTeaching-master.zip”)
- Move the contents of the unzipped folder to your Arduino directory (found in Documents)
Before we begin
Start with these parts from an Arduino Starter Kit: UNO, breadboard, jumper wires, piezo, 10k resistor, and photoresistor:
Connect the piezo.
1. Gently insert the pins of your Piezo into row one and five.
2. Connect row one to the Ground (-) rail with a wire jumper. (i.e. piezo to GND)
3. Connect row five to Pin 8 on the UNO using a wire jumper. (i.e. piezo to digital pin)
Connect the photoresistor.
4. Insert the pins from the photoresistor in rows twenty-five and twenty-eight.
5. Connect row twenty-five to the Power (+) rail with a jumper wire. (i.e. photoresistor to 5V).
6. Use the 10k resistor to connect row twenty-eight to Ground (-) rail. (i.e. photoresistor to GND)
7. Connect row twenty-eight to Pin A0 on the UNO. (i.e. photoresistor to analog input)
Connect the power.
9. Connect the Ground (-) rail to a GND pin on the UNO with a power jumper wire.
10. Connect the Power (+) rail to the 5V Pin on the UNO with a power jumper wire.
The circuit is complete!
Load the sketch
1. Open the Arduino Software (IDE). IDE = Integrated Development Environment = an application that allows you to edit/write code, compile it, and send it to Arduino devices.
2. Connect your UNO. Connect the UNO to your computer using the USB cable. Some LEDs on the board should light up, and the board should automatically be detected. To make sure the IDE knows which board to use, in the Tools menu:
- Under Board, select Arduino/Genuino Uno
- Under Port, select the one that says “Uno”
3. Open the sketch. Sketches are programs written using the Arduino IDE. Each is saved in its own folder and has the extension .ino. Choose File then Open to navigate to the sketch you want to load, for example “lightThereminBasic.ino”
4. Upload the sketch. Click the Upload button (a right arrow) and the IDE will compile the code, then send it to the connected Arduino board. If there are any errors, a message will appear in the terminal at the bottom.
5. Edit! In the text editor window, try changing a few things at the bottom of the loop, such as range of pitch, tone length, and loop delay. There are lots of comments in the code (marked by //) to explain what each line is doing. Try loading one of the other lightTheremin examples! (They all work with the same circuit setup)
Official Arduino site, https://www.arduino.cc/
- get Arduino IDE.
- purchase official kits.
- learning and reference materials.
- watch Arduino Starter Kit videos, https://www.youtube.com/playlist?list=PLT6rF_I5kknPf2qlVFlvH47qHvqvzkknd
- online Arduino code editor that works with Chromebook / Android
16 Hertz, http://www.16hertz.com/
- cheaper non-official kits.
- great graphic novel style intro book, bit.ly/16hzguide
- good source for purchasing electronics, including specialized Arduino based boards and accessories.
- lots of projects and learning resources.
Sketches used in this workshop, https://github.com/evanwill/arduinoTeaching
Based on Arduino Starter Kit, Project 06 (http://www.arduino.cc/starterKit) Workshop for The MILL @ UI Library CC-BY-SA 2016 Evan Williamson