Hamlet
Published © GPL3+

Hand Glove Light Theremin

Homemade theremin for a glove using Arduino Nano, light sensor and piezo.

BeginnerProtip1 hour5,216
Hand Glove Light Theremin

Things used in this project

Hardware components

Arduino Nano R3
Arduino Nano R3
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)

Story

Read more

Custom parts and enclosures

light Theremin for glove

Schematics

light theremin

fit it in a glove

Code

light theremin

C/C++
using light sensor and piezo in D5 and A0 for creating music with light. Piezo can only create one tone at a time.
//sensor value and its limits
int sensorValue;
int sensorLow = 1023;
int sensorHigh = 0;

//for connection checking, no need to put the led in the actual circuit
const int ledPin= 13;

void setup() {
  pinMode(ledPin, OUTPUT);
  digitalWrite(ledPin, HIGH);
  while (millis() < 5000) {
    sensorValue = analogRead(A0);
          if (sensorValue > sensorHigh) {
                    sensorHigh = sensorValue;
          }
          if (sensorValue < sensorLow) {
                    sensorLow = sensorValue;
          }
  }//end of while.
  digitalWrite(ledPin, LOW);
 }

void loop() { 
  sensorValue = analogRead(A0);

  int pitch = map(sensorValue, sensorLow, sensorHigh, 50, 4000);
  // I connected the piezo in digital 5
  tone(5,pitch,20);
  delay(10);

}

Credits

Hamlet

Hamlet

2 projects • 4 followers
23 years old cybersecurity analyst, into investigative journalism, privacy and digital rights.

Comments