Introduction: Secret Light
"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.
Step 1: Designing the Maze
The first step consisted in planning the visual maze base on which the circuit is then shaped.
Step 2: Design Circuit and Sensor
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.
Step 3: The Code
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.
We have a be nice policy.
Please be positive and constructive.