catmbryan
Published © GPL3+

Light Sensing Masquerade Mask

This decorated mask will light up when it senses a lower level of light. Create your own for a Halloween costume or mask party!

IntermediateFull instructions provided208
Light Sensing Masquerade Mask

Things used in this project

Hardware components

LilyPad ProtoSnap Plus
SparkFun LilyPad ProtoSnap Plus
×1
Alligator Clips
Alligator Clips
×1
Sewable Conductive Thread
Sewable Conductive Thread
×1
Battery, 3.7 V
Battery, 3.7 V
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Paper mask
Scissors
Felt
Hot glue gun
Sewing Needle
Regular sewing thread

Story

Read more

Schematics

Front view schematic

For sewing the LEDs to the felt

Code

Light Sensing Masquerade Mask

Arduino
//variable for sensor pin
int sensorPin = A2;

//variable for light value
int lightValue;

//variable for LEDPin
int LEDPin = 6; 
int greenPin = A7;
int bluePin = A8;


void setup()
{
  int x;

    // Set sensorPin as an INPUT
    pinMode(sensorPin, INPUT);

    // set LEDPins as OUTPUT
    pinMode(LEDPin, OUTPUT);
    pinMode(greenPin, OUTPUT);
    pinMode(bluePin, OUTPUT);


}

void loop()
{

    // Get the current light level
    lightValue = analogRead(sensorPin);


    // if light level is low, turn LEDs on
    if (lightValue <= 15)
    {
      digitalWrite(LEDPin, HIGH);
      digitalWrite(greenPin, HIGH);
      digitalWrite(bluePin, HIGH); 
      }
    
    // if light level is high, turn LEDs off 
    else {
      digitalWrite(LEDPin, LOW);
      digitalWrite(greenPin, LOW);
      digitalWrite(bluePin, LOW);
      }

}

Credits

catmbryan

catmbryan

1 project • 1 follower

Comments