How to Make a Touch Control Table Lamp With Arduino

by Webotricks in Circuits > Arduino

2 Views, 0 Favorites, 0 Comments

How to Make a Touch Control Table Lamp With Arduino

Untitled design (57).png

Hello and welcome back. In this project, we will learn how to make a touch-control table lamp with Arduino. For that, I have mainly used the touch sensor, relay module, and Arduino UNO R4 MIMINA board. But, you can use any other Arduino board. Also, I used the 5mm foam board for making the lamp body. If you want to do this project low cost, please use cardboard.

In this project, I have used an AC bulb for this lamp. Therefore, an AC 230v has to be given to the relay module. If you use AC voltage, you need to be careful. Also, You can use a 12v LED strip or bulb instead of the 230V AC bulb. Also, I used a 5VDC power supply to power this circuit. But, you can also use USB power for that. (I recommend using an external 5VDC power supply to power this lamp)

Supplies

OK, let’s do this project step by step. The required components are given below.


Touch Sensor - BUY NOW


Relay Module - BUY NOW


Jumper-Wires - BUY NOW


Arduino UNO R4 MINIMA


AC Bulb holder


AC bulb


AC Plug top


TT wires


5mm Foam Board


Firstly, identify these components.

Secondly, cut the foam board pieces using the following sizes.

Thirdly, cut off 5mm pieces from two pieces on both sides.

Now, let’s install the Arduino UNO board on the base part. For that, prepare the side piece using the picture below.

Next, install it on the base plate. Then. glue the Arduino UNO board.

Now, paste the relay module and connect it to the Arduino board.


Next, connect the TT wires to the relay module. For that, use the circuit diagram above. I used the COM and NO terminals in the relay module. Then, drill a hole and put the wires through this hole.

Now, paste the side parts on the base part.

Now, let’s install the touch sensor. For that, follow the picture below. Then, connect this sensor to the Arduino board.

Next, connect the Arduino board to the computer. Then, copy and paste the following program to the Arduino IDE.

Now, select the board and port. After, click the upload button.

#define sensor 3
#define relay 2
bool value;
bool checkOne;
bool checkTwo = true;
void setup() {
Serial.begin(9600);
pinMode(sensor, INPUT);
pinMode(relay, OUTPUT);
digitalWrite(relay, HIGH);
}
void loop() {
value = digitalRead(sensor);
if (value == 1) {
if (checkOne) {
Serial.println("ON");
digitalWrite(relay,LOW);
checkTwo = false;
} else {
Serial.println("OFF");
digitalWrite(relay,HIGH);
checkTwo = true;
}
} else if (value == 0) {
if (checkTwo == true) {
checkOne = true;
} else {
checkOne = false;
}
}
}

Next, drill a hole on the top piece and put the bulb wires through this hole. Then, glue the top part.

Now, connect the bulb holder and install it at the top.

Finally, connect the Plug top to the end of the TT wires.

OK, now put the bulb into the holder. Then, provide a 5v power supply to the Arduino board. For that, use a DC power connector. Finally, connect the plug top to the 230v AC socket.

OK, now you can test this project. The full video guide is below. So, we hope to see you in the next project. Have a good day.