Arduino Workshop 2

Light Theremin

A theremin is an electronic musical instrument that makes eerie sounds. We’re going to make a version of a theremin that uses light to change the pitch of the tones.

  • Components
    • Four wires
    • 1K ohm resistor (if you have the Arduino kit from CS4ALL, the 1K ohm resistors have a red stripe on the paper strip they are attached to)
    • Photoresistor (the element with the squiggly line on top)
    • Active piezo buzzer (this is a black cylinder with a plus sign on top)
  • Connections
    • Wire from the 5V pin on the Arduino Uno to a row on the breadboard (red wire in the photo)
    • Photoresistor from that row on the breadboard to another row
    • Resistor from that row on the breadboard to another row
    • Wire from the row that the photoresistor and resistor share to Arduino pin A0 (green wire in the photo)
    • Buzzer – look on the top of the buzzer for a plus (+) sign – the lead on that side underneath is the positive lead
      • negative lead in the row of the breadboard that right now only has the resistor connected to it
      • positive lead in another row
    • Wire from the row that the buzzer’s positive lead is in to pin 12 on the Arduino Uno (white wire in the photo)
  • Software
    • The code for the light theremin is below the photo. Copy it and paste it into a new Arduino sketch.
  • Plug the Arduino Uno into your computer. The buzzer should start making noise. Put your finger on top of the photoresistor and not how the buzzer’s pitch changes. Shine a light directly





One of the LEDs in your kit has four leads instead of two. This LED can show almost any color! The longest lead on this RGB (Red Green Blue) LED is the negative/ground lead. The other three pins control the red, green, and blue portions of the color of the LED. There will be one shorter lead (that controls the Red) to one side of the longest lead and two shorter leads on the other side that control the Green and Blue.

Take four wires and three resistors (220 ohm or 330 ohm). Connect the longest lead on the LED directly to a GND pin on the Arduino. Connect the other three leads to the Arduino with a resistor.