How to make a touch control table lamp with Arduino

How to make a touch control table lamp with Arduino

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)

If you want to learn what’s touch sensor is and how to use it with Arduino, please use this link.

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

Disclosure: These Amazon links are Affiliate links. As an Amazon Associate, I earn from qualifying purchases.

Step 1

Firstly, identify these components.

Step 2

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

Step 3

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

Step 4

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

Step 5

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

Step 6

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

How to make a touch control table lamp with Arduino

Step 7

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.

Step 8

Now, paste the side parts on the base part.

Step 9

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

Step 10

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

How to make a touch control table lamp with Arduino
#define sensor 3
#define relay 2

bool value;
bool checkOne;
bool checkTwo = true;

void setup() {
  pinMode(sensor, INPUT);
  pinMode(relay, OUTPUT);

  digitalWrite(relay, HIGH);

void loop() {
  value = digitalRead(sensor);

  if (value == 1) {
    if (checkOne) {
      checkTwo = false;
    } else {
      checkTwo = true;
  } else if (value == 0) {
    if (checkTwo == true) {
      checkOne = true;
    } else {
      checkOne = false;

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

Step 11

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

Step 12

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

Step 13

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

Step 14

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.

How to make a touch control table lamp with Arduino

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *