Secret Light
![Secret Light - Testing](/proxy/?url=https://content.instructables.com/FK1/7DUK/IUKEOLJ6/FK17DUKIUKEOLJ6.jpg&filename=Secret Light - Testing)
![IMG_4422 2mod.JPG](/proxy/?url=https://content.instructables.com/FQ2/M5H9/IUKEOLNB/FQ2M5H9IUKEOLNB.jpg&filename=IMG_4422 2mod.JPG)
![IMG_4417 2mod.JPG](/proxy/?url=https://content.instructables.com/FR5/N2AG/IUKEOLMR/FR5N2AGIUKEOLMR.jpg&filename=IMG_4417 2mod.JPG)
"Secret Light" is an experimentation with soft sensors and circuits.
The visual represents a make, composed of several dots and lines: only by pressing at the same time the right 3 dots on the right line the light will light up, like a combination lock whose password is secret.
The whole project is composed by a copper fabric circuit, a soft touch sensor, an led stick and an Arduino Uno.
Designing the Maze
![FullSizeRender-3.jpg](/proxy/?url=https://content.instructables.com/FM4/SNKE/IUKEOPIY/FM4SNKEIUKEOPIY.jpg&filename=FullSizeRender-3.jpg)
![FullSizeRender-4.jpg](/proxy/?url=https://content.instructables.com/F0M/IQQZ/IUKEOPM6/F0MIQQZIUKEOPM6.jpg&filename=FullSizeRender-4.jpg)
![FullSizeRender-5.jpg](/proxy/?url=https://content.instructables.com/FW7/SOW3/IUKEOPM8/FW7SOW3IUKEOPM8.jpg&filename=FullSizeRender-5.jpg)
![IMG_4385.JPG](/proxy/?url=https://content.instructables.com/FXJ/YO6M/IUKEOLNC/FXJYO6MIUKEOLNC.jpg&filename=IMG_4385.JPG)
![Screen Shot 2016-10-22 at 18.45.34.png](/proxy/?url=https://content.instructables.com/FTK/261N/IUKEOQEG/FTK261NIUKEOQEG.png&filename=Screen Shot 2016-10-22 at 18.45.34.png)
![Screen Shot 2016-10-22 at 18.47.02.png](/proxy/?url=https://content.instructables.com/FG9/3T6Q/IUKEOQTN/FG93T6QIUKEOQTN.png&filename=Screen Shot 2016-10-22 at 18.47.02.png)
The first step consisted in planning the visual maze base on which the circuit is then shaped.
Design Circuit and Sensor
![580beb78937ddbddd8001233.jpeg](/proxy/?url=https://content.instructables.com/F1Y/D504/IUKEOP9Q/F1YD504IUKEOP9Q.jpg&filename=580beb78937ddbddd8001233.jpeg)
![IMG_4399mod.JPG](/proxy/?url=https://content.instructables.com/FDS/UFVV/IUKEOLM5/FDSUFVVIUKEOLM5.jpg&filename=IMG_4399mod.JPG)
![IMG_4402.JPG](/proxy/?url=https://content.instructables.com/F6N/NWYJ/IUKEOLNE/F6NNWYJIUKEOLNE.jpg&filename=IMG_4402.JPG)
![LockLight_bb.jpg](/proxy/?url=https://content.instructables.com/FHD/ZD91/IUKEOXJ2/FHDZD91IUKEOXJ2.jpg&filename=LockLight_bb.jpg)
Once the layout is set, I planned the path of the circuit and the position and shape of the touch sensor, based on the "lock combination" position I chose. I soldered the edges of the copper fabric paths for more stable connections. At last I added a layer of Velostat on the sensor position, between the 2 layers of copper, one on the top printed layer, one one the back foam board.
The Code
![Screen Shot 2016-10-22 at 18.56.29.png](/proxy/?url=https://content.instructables.com/FVK/0AXQ/IUKEOV6F/FVK0AXQIUKEOV6F.png&filename=Screen Shot 2016-10-22 at 18.56.29.png)
![Screen Shot 2016-10-22 at 18.56.43.png](/proxy/?url=https://content.instructables.com/FTN/7ULH/IUKEOV70/FTN7ULHIUKEOV70.png&filename=Screen Shot 2016-10-22 at 18.56.43.png)
![Screen Shot 2016-10-22 at 18.56.53.png](/proxy/?url=https://content.instructables.com/FQS/GWOK/IUKEOV71/FQSGWOKIUKEOV71.png&filename=Screen Shot 2016-10-22 at 18.56.53.png)
I first linked the Adafruit NeoPixel Library to my sketch to control the led Stick.
Then I check that the sensor was properly read by the Arduino by initialising the console read.
I create two functions:
displayOff: controls the state of the light by linking its brightness to the sensor value.
displayOn: keeps the light on at all time until pressure happens again. A new variable is created (newSensorValue) to detect whether the pressure sensor is activated again. In that case the light switches off and the state become false.
In the loop function I execute displayOff of displayOn based on the values received by the console: if the value higher then 30, displayOn is executed. else DisplayOff.