Continue to Site

# A Riddle about an Electronic Door Lock

#### Kerim

##### Member
About 4 decades ago, I had to solve the following riddle (see [5]).
I needed to design an electronic door lock that satisfies the conditions below:
[1] Its external keypad is a conventional one, 4 rows x 3 columns.
[2] The passkey should be not more than 6 digits [of 0 to 9].
[3] The ‘Start’ key activates the lock system
[4] The ‘End’ key opens the door if the entered passkey is right.
So far, the conditions are expected.

[5] If someone watches the one who presses the passkey, he has to find hard to do the same and open the door. This applies even if the same person is allowed, several times, to see how the door could be opened.

Have fun.

Kerim

An extra condition which is irrelevant here is that the lock system should run by 4 AA batteries only. And the 4 batteries (6V) had to last not less than a year and be able to open, several times a day, a 12V/1A electrical door lock.

By the way, I produced this lock for sale, and I did one for my apartment till I moved to live in a small farm about 30 km far from the city center... till year 2011.

#### rjenkinsgb

##### Well-Known Member
I can think of some possibilities?

The "start" key could be an offset for the rest of the code numerically, either added to or subtracted from the rest of the code, or the code could be a pattern relative to whatever key is pressed as the start key.

Or, the code is based on relative values from each digit to the next rather than absolute values, so eg. 1,4 is the same as 5,9; three different.

#### Kerim

##### Member
I can think of some possibilities?

The "start" key could be an offset for the rest of the code numerically, either added to or subtracted from the rest of the code, or the code could be a pattern relative to whatever key is pressed as the start key.

Or, the code is based on relative values from each digit to the next rather than absolute values, so eg. 1,4 is the same as 5,9; three different.

Interesting ideas, but where is the difficulty for the one who watches to repeat exactly the sequence of the pressed keys he saw? But perhaps I couldn't get your ideas well.

#### Pommie

##### Well-Known Member
Just swap start and end keys.

Mike.

#### Kerim

##### Member
Just swap start and end keys.

Mike.

And the one who watches how the door could be opened won't notice this swap?!

#### rjenkinsgb

##### Well-Known Member
but where is the difficulty for the one who watches to repeat exactly the sequence of the pressed keys

You said for someone watching several times?

As different keys can be used each time to unlock, there would be no single sequence to be duplicated.

It could also store the last (or two last etc.) sequence used and ignore that, to prevent a "replay", as used with rolling code car remotes - OK for a single user, but confusing if there were to be more that one.

#### Kerim

##### Member
You said for someone watching several times?

As different keys can be used each time to unlock, there would be no single sequence to be duplicated.

It could also store the last (or two last etc.) sequence used and ignore that, to prevent a "replay", as used with rolling code car remotes - OK for a single user, but confusing if there were to be more that one.

Just to be sure, don't you mean that the last sequence of the pass keys (defined by 6 digits) won't open the door if repeated?

Edited:
But, as you said, this could work for one user and I am afraid this cannot be the case for a house or office door.
The protocol also needs to be simple for kids

In fact, I had to think about this door lock because the two kids, whom I was their teacher after school, used losing the house key, once a while. And I didn't like them stay on the street in case they came earlier (perhaps with a friend) and there was no one at home.

Last edited:

##### Well-Known Member
In my opinion RFID is a better solution, 1) no key pad to wear and show the worn code numbers, 2) you can bar selected codes , 3) restrict entry to certain times / days. Disadvantages, key fobs are required .(users paid for them ) I put a commercial one on an allotment toilet ( 12v solar power ) 17 years ago. still working ..

#### Kerim

##### Member
In my opinion RFID is a better solution, 1) no key pad to wear and show the worn code numbers, 2) you can bar selected codes , 3) restrict entry to certain times / days,

Indeed, it is a practical solution for those who don't lose things

In fact, I had to think about this door lock because the two kids, whom I was their teacher after school, used losing the house key, once a while.

And every time they lost their key, I had to renew the core of the mechanical lock.

##### Well-Known Member
lost their key, I had to renew the core of the mechanical lock.
The RFID lock i installed was programmable , we made money on lost fobs , as we charged for a replacement, and just blocked their old number . 'Blank' fob codes / numbers had to be activated into the controller memory.

#### rjenkinsgb

##### Well-Known Member
Another possibility is that the digits could require entry in a certain "rhythm", eg. longer or shorter pauses between button presses, or longer/shorter duration of press of each button.

#### Kerim

##### Member
The RFID lock i installed was programmable , we made money on lost fobs , as we charged for a replacement, and just blocked their old number . 'Blank' fob codes / numbers had to be activated into the controller memory.

For instance, the story of this lock was about 40 years ago and not in Europe or America in which RFID system were likely known

And, as far as I know, a user (hence the kids) needs to have an RFID remote unit which could be also lost (if not broken) instead of the mechanical key.

#### Kerim

##### Member
Another possibility is that the digits could require entry in a certain "rhythm", eg. longer or shorter pauses between button presses, or longer/shorter duration of press of each button.

You are in the right direction. I mean timing has a role.

If we forget that following the 'rhythm' may not be easy for all users (unless a relatively wide margin is allowed), I am afraid that the one who watches may not find hard to notice it (mainly if he has a musical ear )

#### Tony Stewart

##### Well-Known Member
Use a Morse Code with numbers
Dah-dit-dah

##### Well-Known Member
Interesting ideas, but where is the difficulty for the one who watches to repeat exactly the sequence of the pressed keys he saw? But perhaps I couldn't get your ideas well.
Used this design for years.

The keys are rocker switches center off numbered 0 through 9. This is a very common security design for cypher lock systems. We simply programmed in a 4 or 5 digit code sequence. From time of first key strike the user has a prescribed time to enter the complete code.

Upper Row:
1, 3, 5, 7, 9
Lower Row:
0, 2, 4, 6, 8

Additionally the system used an RFID reader so before I even entered the standard code for entry I had to enter my own personal code followed by the code for that particular point of entry. All codes were changed every 30 days or less on some entry points. All comings and goings were also logged.

Anyway using a key system like this it is about impossible to actually see someone enter the code.

Ron

#### Kerim

##### Member
Use a Morse Code with numbers
Dah-dit-dah

A possible solution, thank you, but doesn't it complicate things just to open a door

#### Kerim

##### Member
Used this design for years.
View attachment 140894

View attachment 140895

The keys are rocker switches center off numbered 0 through 9. This is a very common security design for cypher lock systems. We simply programmed in a 4 or 5 digit code sequence. From time of first key strike the user has a prescribed time to enter the complete code.

Upper Row:
1, 3, 5, 7, 9
Lower Row:
0, 2, 4, 6, 8

Additionally the system used an RFID reader so before I even entered the standard code for entry I had to enter my own personal code followed by the code for that particular point of entry. All codes were changed every 30 days or less on some entry points. All comings and goings were also logged.

Anyway using a key system like this it is about impossible to actually see someone enter the code.

Ron

It is surely a very good solution. Thank you.

But do you think I was able to build such a door lock 40 years ago (where I live)?
At best, I was able to use a conventional 4x3 keypad

##### Well-Known Member
But do you think I was able to build such a door lock 40 years ago (where I live)?
I guess that depends on where you live. I was using systems like this over 40 years ago. Both ashore and afloat. The early systems used more components but the newer stuff is all micro-controller driven for the most part. The entry keypad for my garage is just a simple flat matrix where security is not much of a concern. Then too my garage is not an area where I have any security concerns. Now in a secure area that has classified documents exposed we may want access a little more limited and controlled.

My days for all of that have long ended, actually 01 May will mark 10 years since I retired and left a great career but I do like this retired life.

So in the world of cypher locks and security codes I would guess we choose or build a system based on our intended applications. We also have a much wider of array of system solutions. Cool stuff we never dreamed of 40 or 50 years ago.

Ron

#### Tony Stewart

##### Well-Known Member
About 45 yrs ago my musician friends had the latest guitar soundbox with a dozen sounds from fuzz bass to wah-wah breakdown. It came from Silicon Valley and had about 20 ~ 25 IC's that all looked the same with 16-pin DIPs and the part number info all sanded off. I found it had a design problem converting 5V logic levels to drive the bipolar supply CMOS switches due to threshold tolerances and took me a couple of hours to fix.

My 1st design after graduating in 1975 was a 5 channel CMOS VLF Receiver for Doppler tracking our automated Weather Station powered by Wind Power on an ice flow in the Beaufort Sea north of Alaska where oil rigs had to know about moving icebergs.

#### Kerim

##### Member
By the way the MCU, I used under the keypad and in the in-door part, was AT89C2051 (in the 80's). The code was transmitted on 2 wires using an in-house serial protocol. The 'Start' key just shorts temporarily the two wires to activate the system since the supply was 4 AA batteries.

Back to the riddle solution, as we will see, it is simple (suitable even for kids) though it needed me to think out of the box

Replies
9
Views
13K
Replies
12
Views
3K
Replies
5
Views
2K
Replies
13
Views
1K
Replies
24
Views
6K