Touch to unlock: a servo opens the latch, then locks again after 3 seconds.
Built and tested by Shahan Fathima K · Industrial Robotics Institute

A simple touch-operated door lock. When you touch the TTP223 touch sensor, the Arduino turns a servo motor to open the lock, waits 3 seconds, and then turns it back to the locked position. It runs on two lithium-ion cells with an on/off switch.
| Component | Qty |
|---|---|
| Arduino Uno | 1 |
| Touch Sensor Module (TTP223) | 1 |
| Servo Motor (SG90) | 1 |
| Lithium-ion Batteries | 2 |
| Battery Case with Switch | 1 |
| Jumper Wires | As needed |
| From | Connect to |
|---|---|
| Touch sensor VCC | 5V |
| Touch sensor GND | GND |
| Touch sensor OUT | Pin 2 |
| Servo red | 5V |
| Servo brown | GND |
| Servo orange (signal) | Pin 9 |
| Battery + (via switch) | VIN |
| Battery − | GND |
Complete, tested Arduino C++ code for this project. Copy it into Arduino IDE and upload it to the Arduino Uno.
#include <Servo.h>
Servo lockServo;
int touchPin = 2;
void setup()
{
pinMode(touchPin, INPUT);
lockServo.attach(9);
lockServo.write(0); // Locked position
}
void loop()
{
int touchState = digitalRead(touchPin);
if (touchState == HIGH)
{
lockServo.write(90); // Open lock
delay(3000); // Wait 3 seconds
lockServo.write(0); // Close lock
}
}A simple touch-operated door lock. When you touch the TTP223 touch sensor, the Arduino turns a servo motor to open the lock, waits 3 seconds, and then turns it back to the locked position.
You need: Arduino Uno (1), Touch Sensor Module (TTP223) (1), Servo Motor (SG90) (1), Lithium-ion Batteries (2), Battery Case with Switch (1), Jumper Wires. Software: Arduino IDE, Servo library.
Yes. It is rated beginner and takes about 1–2 hours to build, using the Arduino Uno. The guide on this page explains every connection and step.
The complete, tested Arduino C++ code is free on this page. Copy it into Arduino IDE and upload it to the board.
Yes. IRI sells a kit with the parts for this project (PRJ-023). Message IRI on WhatsApp at +91 86060 82634 for the kit price and delivery details.