Thread Pattern Locker

Have you ever thought of locking something not with a key or password, but with a pattern made from thread? That’s what I tried here: a simple, creative locker that opens only when you connect a thread across nails in the right pattern. It’s made from thermocol, a plywood nail pad, and powered by an Arduino Nano.
This is part electronic puzzle, part mechanical fun and perfect for beginners in Arduino, creative DIY, or even students looking for a unique mini project. I’ve built the box from scrap materials, and it’s controlled by a mini servo-motor setup that unscrews the lock bolt when the right pattern is detected.
FOR the circuit diagram and program https://github.com/DIYvolt/Thread-pattern-Locker
circuit diagram :-https://app.cirkitdesigner.com/project/ecbf1dba-1e97-4975-a87c-43df69e3c6b0
Downloads
Supplies
Supplies
Here’s what I used:
Electronics:
- Arduino Nano
- L293D Motor Driver IC
- Servo motor (or mini gear motor)
- Limit switches (x2)
- Enamel copper wire (for signal lines)
- Resistors 100 ohm
Mechanical & Construction:
- Thermocol sheet (25cm x 20cm x 15cm box)
- Plywood (0.5 cm thick, for nail pad)
- 9 Nails (for 3x3 grid)
- Pen pipe (cut, used as a locker)
- Nuts & bolts (for linear lock movement)
- Screws, glue
Tools:
- Soldering iron
- Cutter or craft knife
- Hot glue gun (iam using my soldering my hot glue gun repair)
- Small drill or hand tool
- Ruler & pencil
Locker Box










.gif)
- First, I glued the four side walls together, front, back, and two sides.
- Then I carefully placed and glued the bottom panel ( 25x20 cm) under the box frame.
- To keep everything aligned and stable while the glue dried, I inserted toothpicks through the edges where two sheets met. This worked like temporary dowels.
- Once the glue was dry and solid, I clipped off the extra parts of the toothpicks sticking out.
- Reinforced the inner joints with a bit more hot glue for added strength.
I built the enclosure using thermocol sheets. it’s lightweight, easy to work with, and good for testing. But if you're planning to use this in a real application. I highly recommend a metal or wooden enclosure for better durability and tamper resistance. If using metal or wood, consider using small screws.
Locker Door







I marked a 10x10 cm square on the front face of the thermocol box.
Using a sharp blade, I carefully cut out the door, but on one edge, I made a 25° bevel. This edge helps the door sit flush and tight when closed.
I set the cut-out aside to be used as the actual door piece.
About 2 cm from the top and bottom edges of the beveled side of the door, I inserted two toothpicks vertically.
Then see the last image, how it fits and is functioning.
Locker Mechanism





















.gif)
To make the locking mechanism functional, I added a servo motor directly to the door this acts like a mini bolt system. It pushes or pulls a bolt (or screw) to lock/unlock the door. For position sensing, I reused two limit switches salvaged from an old mouse cheap, effective, and satisfying to repurpose.
- I mounted a small servo motor (or mini gear motor) on the inner side of the door using hot glue.
- A bolt was fixed to the servo horn, acting as the locking rod. When the servo rotates, the bolt screws in or out.
- To convert the bolt’s rotation into linear motion, I placed two nuts inside a cut piece of pen tube.
- However, the pen tube was rotating with the bolt at first, so I added a small aluminum strip and glued it to the side of the pen tube. This locks the tube in place and prevents it from turning, ensuring smooth linear screw movement.
- The pen tube (now fixed) was mounted vertically on the inside of the door. When the motor turns, the bolt slides through this setup like a mini linear actuator.
- I placed two limit switches, one on each side of the bolt path to detect when the bolt is fully extended (locked) or fully retracted (unlocked).
- These switches were taken from an old computer mouse. They’re tiny but reliable. I glued them securely and connected their outputs to the Arduino analog pins.
- motor controller has been used here; this is just the mounting and wiring. Control logic will come in a later step.
you’ll need an L293D driver IC to manage direction and limits. you can find all the connections in the circuit diagram and program. https://github.com/DIYvolt/Thread-pattern-Locker
3x3 Nail Pad















- I took a square piece of 0.5 cm plywood, roughly 5x5 cm in size.
- Marked a 3x3 grid (3 rows × 3 columns) evenly spaced across the plywood using a pencil and ruler.
- At each grid point, I tightly twisted the nail to make holes. Then inserted all the nails and glued. These act as the pattern contact points.
- On the back side, I soldered enamel copper wire to each nail. Since enamel wire is coated.
- And added a simple push button and led.
Each nail functions like a button. When a thread connects two or more nails, it completes a circuit. You can detect this by scanning input combinations in code (we’ll handle that in the programming step).
Placing the Components on Locker Box















- With the 3x3 nail pad ready, it was time to integrate it into the locker system.
- I placed the nail pad on the top surface of the thermocol box, right where it’s visible and accessible for pattern drawing.
- I used hot glue to firmly attach the plywood to the thermocol.
- Then, I carefully pulled all 9 enamel copper wires down through the thermocol using a needle or pointed stick to make small channels.
- Once the wires were inside the box, I scraped off the enamel coating at the ends using a blade.
- I then soldered each wire to a female header pin this makes it easy to plug into the Arduino Nano without permanent joints.
Circuit Diagram





a Arduino nano and ld293 driver is connected as circuit diagram : https://app.cirkitdesigner.com/project/ecbf1dba-1e97-4975-a87c-43df69e3c6b0
I positioned the Arduino Nano, L293D motor driver, and limit switch wiring neatly along the inner walls of the box.
Used hot glue and small double-sided tape pieces to secure the components in place.
Then I uploaded the program into Arduino nano.
Making a Conductive Thread




To detect the thread pattern across the nail pad, I needed something that could carry an electrical signal when placed between nails. Since ready-made conductive thread wasn’t available to me locally, I decided to make my own.
- I took a stripped single strand of sliver wire (you can pull this from old multi-core cables).
- Then I twisted it tightly around a regular cotton thread, creating a flexible yet conductive strand.
- This thread was just conductive enough to close the circuit between the nails when drawn across them.
It’s not perfect , it works well for demos and prototypes, but it’s not very durable and may break or wear over time.
You can find it online or in electronics hobby stores under names like "conductive sewing thread" or "e-textile thread."
Power Supply



Instead of using a battery to power the locker, I decided to keep things simple and fail-proof — because if the battery dies, the locker stays locked! That’s a big risk in any access system.
SOLUTION
I used a USB power setup by connecting the Arduino Nano to a female USB connector, which is accessible outside the box.
- I connected the 5V and GND pins of the Arduino Nano to a female USB port using jumper wires.
- This female port was mounted on the side of the box using hot glue, making it easy to plug in power when needed.
- To plug in power, I used a male USB cable, which can be connected to:
- A laptop
- A USB power bank
- A 5V phone charger adapter
This way, the system can be powered anytime, anywhere, without worrying about battery drain or charging issues.
Result

The locker works just like I imagined — it only opens when the correct thread pattern is drawn across the nails. If the pattern is wrong, the bolt stays locked. The motor drives the bolt in and out, the limit switches handle end stops, and power can be connected from any USB source. It's a mix of electronics, mechanics, and a little bit of puzzle-solving — all packed into a DIY build.
If you liked this build, give it a favorite and follow. I’ve got more crazy ideas coming soon!