Electronic – Making a electronic alphabet locker that lock gift to friends

circuit analysiscircuit-designlogic-gates

Imagine you are giving a gift to someone, but you want them to solve your question and enter your secrete password.

You want the password to be entered in order and if touch any other will fail.
For example if you want enter "dog", then we can use:

enter image description here

*from "make: electronics"

the user have to press button E,F,G,H in sequence without touching button B,C,D to get output from the last logic gate.

But what about when you want him enter a password like "hook"?
(with 2 same letter)

*In the current circuit if you push "hok" instead of "hook" it will also work.

but we only want the user press "hook"

I designed a circuit, but seems missing something:

enter image description here

anyone have any idea?

Best Answer

You'd need a machine that walks from "locked, no entry" through "all letters so far right, at the Nth letter" to "unlocked" (or returns to the original state if any entered letter wasn't right for the position you are), with only pre-defined state transitions.

We call such a machine a finite state machine (FSM).

Your FSM is a relatively complex one, so it's a hassle to design in discrete logic.

It's, however, only a few lines of computer code. (Computers really are just very complex FSMs that we can make behave like any FSM.)

Thus, the logical and time-economical way forward here is learning how to use a microcontroller and how to write software for it; luckily, projects like Arduino make that both easy and relatively affordable.

Related Topic