Making an Arduino Touch Sensitive LED SignI love to work with electronics. In the near future I’m going work on a dedicated place for all the electronics work I do. To decorate this place I would like to build all kinds of cool stuff and gadgets. For starters I build this Arduino Touch Sensitive LED Sign.Some time ago I found the Arduino capacitive touch library. Immediately I could think of several cool applications. For this project I use an Arduino Nano to detect when the sign is touched. I programmed a ON/OFF function and when the sign is touched for a couple of seconds the colour changes. When releasing the sign the present colour is selected.A new experience with this Arduino Touch Sensitive LED Sign project, was polishing aluminium. I used five different grits of sanding paper and two polishing compounds. Getting this mirror finish took a good three hours. Maybe some good polishing equipment can help to speed thing up.Although the engraving isn’t spot on, I’m happy with the result of the Arduino Touch Sensitive LED Sign. I’m sure it will look great when the new workshop is finished !Arduino code#include <Adafruit_NeoPixel.h>
#include <CapacitiveSensor.h>
#define PIN 10
#define LEDS 1
int DELAY_TIME = 500;
int COUNTER = 0;
boolean LIGHT_STATE = false;
Adafruit_NeoPixel strip = Adafruit_NeoPixel(LEDS, PIN ,NEO_GRB + NEO_KHZ800);
CapacitiveSensor cs_4_2 = CapacitiveSensor(4,2); // 1 megohm resistor between pins 4 & 2, pin 2 is sensor pin, attach to metal body
void setup() {
Serial.begin(9600);
cs_4_2.set_CS_AutocaL_Millis(0xFFFFFFFF); // turn off autocalibrate on channel 1 - just as an example
Serial.begin(9600);
strip.begin();
strip.show(); //
strip.setPixelColor(0, 69, 255, 0); // ORANGE RED
strip.show();
}
void loop() {
long total1 = cs_4_2.capacitiveSensor(30);
if(total1>400)
{
COUNTER++ ;
}
else
{
COUNTER = 0;
}
if((total1>400) && (!LIGHT_STATE))
{
strip.setPixelColor(0, 69, 255, 0); // ORANGE RED
strip.show();
delay(400);
LIGHT_STATE = true;
}
total1 = cs_4_2.capacitiveSensor(30);
if((total1>400) && (LIGHT_STATE))
{
strip.setPixelColor(0, 0, 0, 0); // ORANGE RED
strip.show(); //.
delay(400);
LIGHT_STATE = false;
}
while(COUNTER>3) // while loop to sellect the led colour
{
strip.setPixelColor(0, 255, 0, 0); //GREEN
strip.show(); //.
delay(DELAY_TIME);
total1 = cs_4_2.capacitiveSensor(30);
if(total1<400)
{
break;
}
strip.setPixelColor(0,0, 255, 0); //RED
strip.show(); //.
delay(DELAY_TIME);
total1 = cs_4_2.capacitiveSensor(30);
if(total1<400)
{
break;
}
strip.setPixelColor(0, 0, 0, 255); //BLUE
strip.show(); //.
delay(DELAY_TIME);
total1 = cs_4_2.capacitiveSensor(30);
if(total1<400)
{
break;
}
strip.setPixelColor(0, 69, 255, 0); // ORANGE RED
strip.show(); //.
delay(DELAY_TIME);
total1 = cs_4_2.capacitiveSensor(30);
if(total1<400)
{
break;
}
strip.setPixelColor(0, 255, 255, 10); // YELLOW
strip.show(); //.
delay(DELAY_TIME);
total1 = cs_4_2.capacitiveSensor(30);
if(total1<400)
{
break;
}
strip.setPixelColor(0, 69, 139, 19); // BROWN
strip.show(); //.
delay(DELAY_TIME);
total1 = cs_4_2.capacitiveSensor(30);
if(total1<400)
{
break;
}
strip.setPixelColor(0, 0, 139, 139); // Purple
strip.show(); //. grb
delay(DELAY_TIME);
total1 = cs_4_2.capacitiveSensor(30);
if(total1<400)
{
break;
}
strip.setPixelColor(0, 165, 218, 32); // GOLD
strip.show(); //. grb
delay(DELAY_TIME);
total1 = cs_4_2.capacitiveSensor(30);
if(total1<400)
{
break;
}
}
}