Photocell Sensor Garment
![IMG_8054.jpg](/proxy/?url=https://content.instructables.com/FXC/100T/IO8L7A9U/FXC100TIO8L7A9U.jpg&filename=IMG_8054.jpg)
Photocell sensor garment connected to sewable LEDs // Coded with Arduino UNO
Create the Garment
![13242056_10208469020835102_100207371_o.jpg](/proxy/?url=https://content.instructables.com/FCE/ESTP/IO8L7A4E/FCEESTPIO8L7A4E.jpg&filename=13242056_10208469020835102_100207371_o.jpg)
![13223554_10208469020795101_891621994_o.jpg](/proxy/?url=https://content.instructables.com/FUH/BFAK/IO8L7A1I/FUHBFAKIO8L7A1I.jpg&filename=13223554_10208469020795101_891621994_o.jpg)
![13235009_10208469020675098_676281162_o.jpg](/proxy/?url=https://content.instructables.com/FII/IGE7/IO8L7A4C/FIIIGE7IO8L7A4C.jpg&filename=13235009_10208469020675098_676281162_o.jpg)
![13223520_10208469021075108_13454526_o.jpg](/proxy/?url=https://content.instructables.com/F3Z/SCIG/IO8L7A1H/F3ZSCIGIO8L7A1H.jpg&filename=13223520_10208469021075108_13454526_o.jpg)
![13112682_10208469020555095_1692726378_o.jpg](/proxy/?url=https://content.instructables.com/FBW/CP1V/IO8L79Z3/FBWCP1VIO8L79Z3.jpg&filename=13112682_10208469020555095_1692726378_o.jpg)
![13224321_10208469020995106_495954621_o.jpg](/proxy/?url=https://content.instructables.com/F5E/T6KJ/IO8L7A3S/F5ET6KJIO8L7A3S.jpg&filename=13224321_10208469020995106_495954621_o.jpg)
![13223693_10208469021035107_1680580119_o.jpg](/proxy/?url=https://content.instructables.com/FKF/CU29/IO8L7A3Q/FKFCU29IO8L7A3Q.jpg&filename=13223693_10208469021035107_1680580119_o.jpg)
![13223609_10208469021155110_1297276053_o.jpg](/proxy/?url=https://content.instructables.com/F5U/RQTC/IO8L7A3K/F5URQTCIO8L7A3K.jpg&filename=13223609_10208469021155110_1297276053_o.jpg)
![13230678_10208469021275113_1323901569_o.jpg](/proxy/?url=https://content.instructables.com/F8G/46TS/IO8L7A3V/F8G46TSIO8L7A3V.jpg&filename=13230678_10208469021275113_1323901569_o.jpg)
![IMG_8077.jpg](/proxy/?url=https://content.instructables.com/FBH/SSEL/IO8L7AC4/FBHSSELIO8L7AC4.jpg&filename=IMG_8077.jpg)
For my garment I used:
- Organza, wool roving (felted on tulle), and polyester lining with a ribbon to tie the back
Code the Photocell With Arduino + Test It Out
![13214617_10208469021595121_215479932_o.jpg](/proxy/?url=https://content.instructables.com/F0L/CZW4/IO8L79ZA/F0LCZW4IO8L79ZA.jpg&filename=13214617_10208469021595121_215479932_o.jpg)
![13230819_10208469021555120_997566652_o.jpg](/proxy/?url=https://content.instructables.com/FL7/2RQ9/IO8L7A41/FL72RQ9IO8L7A41.jpg&filename=13230819_10208469021555120_997566652_o.jpg)
![13223663_10208469021475118_564853359_o.jpg](/proxy/?url=https://content.instructables.com/FY9/R5S5/IO8L7A3M/FY9R5S5IO8L7A3M.jpg&filename=13223663_10208469021475118_564853359_o.jpg)
This is the code I used:
// Pins
int sensorPin = A0; int lightPin = 3;
// Variables int lightState = 0; int lowThreshold = 70; int highTreshold = 250;
void setup() { // Start Serial & set pin to output Serial.begin(9600); pinMode(lightPin,OUTPUT); }
void loop() {
// read the sensor: int sensorValue = analogRead(sensorPin);
// If light level is low is detected, switch light on if (sensorValue < lowThreshold){ digitalWrite(lightPin, HIGH); } // If light level goes up again, switch the lights off if (sensorValue > highTreshold){ digitalWrite(lightPin, LOW); }
// read the sensor: sensorValue = analogRead(sensorPin);
// apply the calibration to the sensor reading sensorValue = map(lightState, lowThreshold, highTreshold, 0, 255);
// in case the sensor value is outside the range seen during calibration sensorValue = constrain(sensorValue, 0, 255);
// fade the LED using the calibrated value: analogWrite(lightPin, sensorValue);
}
Sew the LEDs on With the Circuit + the Photocell
![13223461_10208469021675123_430740453_o.jpg](/proxy/?url=https://content.instructables.com/FTG/SE6F/IO8L79ZD/FTGSE6FIO8L79ZD.jpg&filename=13223461_10208469021675123_430740453_o.jpg)
![IMG_8066.jpg](/proxy/?url=https://content.instructables.com/FL3/B9NN/IO8L7A9Z/FL3B9NNIO8L7A9Z.jpg&filename=IMG_8066.jpg)
Light It Up!
![IMG_8043.jpg](/proxy/?url=https://content.instructables.com/F7W/VL9T/IO8L7A6X/F7WVL9TIO8L7A6X.jpg&filename=IMG_8043.jpg)
![IMG_8046.jpg](/proxy/?url=https://content.instructables.com/FNH/4VUH/IO8L7A9T/FNH4VUHIO8L7A9T.jpg&filename=IMG_8046.jpg)
![IMG_8084.jpg](/proxy/?url=https://content.instructables.com/FH6/HWPI/IO8L7ACU/FH6HWPIIO8L7ACU.jpg&filename=IMG_8084.jpg)
Video:
https://vimeo.com/166504763