


Detail of the glasses


Inspiration
Circuit

Circuit Composition
- Motion sensor
- Gemma board
- Small lipoly battery
- Transistor
- 100 Ω resistance
- Diode
- 5 V cool white LED strip
Other tools
- Tape
- Hot glue
- Wire (for structure)
- Chipboard (for eye protection)
Notes
- Choose the motion sensor that is relatively more sensitive in order to trigger the light with small gestures.
- Pre-design how the curcuit attach on the glasses. As the space for curcuit on glasses in limited, the sensor location needs to be combined with glasses’s structure fittingly. Also, for the wires and battery.
Code
// constants won’t change. They’re used here to set pin numbers:
const int buttonPin = D0; // the number of the pushbutton pin
const int ledPin = vout; // the number of the LED pin
// variables will change:
int buttonState = D1; // variable for reading the pushbutton status
void setup() {
// initialize the LED pin as an output:
pinMode(ledPin, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(buttonPin, INPUT_PULLUP);
Serial.begin(9600);
}
void loop() {
// read the state of the pushbutton value:
buttonState = digitalRead(buttonPin);
// check if the pushbutton is pressed. If it is, the buttonState is HIGH:
if (buttonState == LOW) {
// turn LED on:
digitalWrite(ledPin, HIGH);
Serial.println(“switch has been triggered”);
delay(3000);
}