0% found this document useful (0 votes)
52 views1 page

Two Button Digital Lock

This document describes a two-button digital lock that uses pulsed button presses to enter a four-digit code. Button S1 is used to enter each digit by pressing it the corresponding number of times, and button S2 indicates the end of the digit. The code can be changed by entering the current code while a jumper is installed, then entering the new code. The lock uses an Attiny2313 microcontroller and can be programmed from a provided source code.

Uploaded by

tihomiho
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views1 page

Two Button Digital Lock

This document describes a two-button digital lock that uses pulsed button presses to enter a four-digit code. Button S1 is used to enter each digit by pressing it the corresponding number of times, and button S2 indicates the end of the digit. The code can be changed by entering the current code while a jumper is installed, then entering the new code. The lock uses an Attiny2313 microcontroller and can be programmed from a provided source code.

Uploaded by

tihomiho
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Two-button Digital Lock

Francis Perrenoud (Thailand) D1 lights for 2 seconds and the relay is ener- microcontroller’s EEPROM memory before
gised for 2 seconds. If the code is wrong, the programming it, so you can be sure that
Now here’s a digital lock unlike any other, as red LED D2 lights for 2 seconds, and the relay the default code is 1234 and not some-
it has only two buttons instead of the usual is not energised. thing unknown that was left behind in the
numeric keypad. The way it works is as simple To change the code, fit a jumper to J1 and EEPROM.
as its keypad. Button S1 is used to enter the enter the current code. When the green LED A little exercise for our readers: convert this
digits of the secret code in a pulsed fashion D1 has flashed twice, enter the new 4-digit project into a single-button digital lock — for
— i.e. the number of times you press the but- code. D1 will flash three times and you will example, by using a long press on S1 instead
ton is determined by the digit to be entered. need to confirm the new code. If this con- of pressing S2 to detect the end of a digit.
A dial telephone uses the same type of cod- firmation is correct, D1 will flash four times. (090127-I)
ing (now maybe there’s an idea?). Press four If the red LED D2 flashes four times, some- Internet Link
times for a 4, nine times for a 9, etc. Press- thing’s wrong and you’ll need to start all over [1] www.elektor.com/090127
ing button S2 indicates the end of a digit. again. To finish the operation, remove the
For example, to enter the code 4105, press jumper and turn the power off and on again
S1 four times, then press S2, then S1 once, S2 — the digital lock is now ready for use with Download
090127-11: Source codes and Hex file, from www.ele-
once, then without pressing S1 at all, press S2 the new code.
ktor.com/090127
again, then finally S1 five times and S2 once The software can be found on the webpage
to finish. If the code is correct, the green LED for the project [1]. Don’t forget to erase the

R1
470R

20
D1
5
PA0
4 19
PA1 IC1 PB7
1 18
PA2 PB6 D2 RE1
K2 ATTiny2313 PB5 17 6 7 8 K1
2
PD0 /V 16
+5V C1 C2 3 PB4
PD1 15
6 PB3
PD2 14
GND 10u 100n DIL20 PB2
7
PD3 13
8 PB1
PD4 12
9 PB0 2 1 14
PD5
J1 11
S1 S2 PD6
READ DIL 5V/1A
10

090127 - 11

78 elektor - 7-8/2009

You might also like