650Views14Replies

Author Options:

One Transistor Based Code Lock Answered

Hello All, i have tried really hard to search for a Instructable based on the above topic, i do remember that i saw it in this site but now i cannot find it, the circuit is http://www.circuitstoday.com/one-transistor-code-lock, please link me to this Instructable, i would be really thankful to all of you. ALSO HOW CAN I ADD A BUZZER WHEN A WRONG CODE OR COMBINATION IS ENTERED.  ALSO WHAT TYPE OF SWITCH OR PUSH BUTTON SHOULD I USE PLEASE GUIDE ME.

14 Replies

user
gmoon (author)2013-03-19

If you can't find it, it is probably 'cause there isn't one...

But what do you need to know? It's really simple:

-- T1, D1, C1 are the power supply. You can substitute a wallwart or an pre-existing PS. Something around 6V.
-- S1 is the ON switch.
-- The transistor is turned on when switches S0 thru S4 connect the 2.2K resistor to the transistor's base (S0-S4 are closed), AND S5 - S9 are open.
-- If any one of S0-S4 are open, or any one of S5-S9 are close, the relay won't trip.
-- R1 is a pulldown resistor, and keeps the base at a solid ground state.
-- D1 protects the transistor from inductive surges originating in the relay.
-- the relay operates the lock -- or whatever.

Mix up the order of the switches to make up the "combination"--don't just connected them in-line like the schematic, that would defeat the purpose...

Select as Best AnswerUndo Best Answer

user
khan12 (author)gmoon2013-03-19

thanks for your reply please guide me as how can i attach a buzzer when an incorrect password is entered, also i want to drive a small dc motor, is using the buzzer possible !

Select as Best AnswerUndo Best Answer

user
gmoon (author)khan122013-03-19

Sure--use a DT (double throw) relay. Double-throw switches (relays as switches) make connections in both states, energized and non-energized. Actually, that schematic shows a SPDT relay (a DPDT relay would work, too).

Note with the circuit, as presented, the relay contacts will always be connected in one of the two "states." If you want the motor (or buzzer) to activate only when someone "keys in" the switch pattern (your "password"), you'll need another momentary button switch to act as an "enter" button. That button could just make/break the contacts leading from the relay. So long as the "code" is correct, and the "enter" button pressed, the "action" would happen...

It's a very simple circuit, with limited functionality.  If, for instance, you want the motor or buzzer to work for a specific amount of time, it will either require more complex analog circuitry, or a microcontroller...

Select as Best AnswerUndo Best Answer

user
khan12 (author)gmoon2013-03-19

thanks again, another question from me is that what type of switches should i use, should i use a Switch, or a push button, if switch which type and pushbutton which type

Select as Best AnswerUndo Best Answer

user
gmoon (author)khan122013-03-20

A SPST (Single Pole Single Throw) switch is what's shown on the schematic. As it's shown, that would work fine. Could be a toggle, or any other non-momentary switch.

For a pushbutton, a N.O. (Normally Open) momentary switch. Double Pole would be best for two devices, but you could make the Single Pole type work in a pinch.

Select as Best AnswerUndo Best Answer

user
gmoon (author)gmoon2013-03-20

Oops. S10, not S1 is the "ON" switch. From the first post, my bad...

Select as Best AnswerUndo Best Answer

user
khan12 (author)gmoon2013-03-21

PLEASE CHECK THIS CIRCUIT IS THIS THE CORRECT WAY, OF CONNECTING A REALY AND DRIVING A LOAD, PLEASE CHECK IT

Select as Best AnswerUndo Best Answer

user
gmoon (author)khan122013-03-22

It's essentially correct.

Caveats:

A speaker connected to DC won't do anything...unless that's your buzzer.

The relay shown is a DPST (double pole single throw) type. You need a DT (double throw) relay here, if you want to control devices in both the ON and OFF relay states...DTDP preferably.

As drawn, the relay breaks the circuit twice, which is unnecessary. The circuit need only be opened or closed in one spot, not two.

Note that the value of R1 depends on the current draw of the relay--BJ transistors are current devices. With an average 12V relay, 2.2K would probably work OK. Or start with 22K (on a breadboard) and substitute lower resistance values until the switching works reliably. Due to variations in the relay and transistor, this approach would lead to the least amount of base current to do the job.

You can also solve for R1 mathematically...

Low current devices would required much higher R1 resistance values.

Select as Best AnswerUndo Best Answer

user
khan12 (author)2013-03-21

The image of ckt with a DPDT Relay, is the operated in this way please tell me.

Select as Best AnswerUndo Best Answer

user
khan12 (author)2013-03-20

Everyone who sees this please reply

Select as Best AnswerUndo Best Answer

user
Josehf Murchison (author)2013-03-19

I found a number of Instructables by searching code lock.

Select as Best AnswerUndo Best Answer

user
khan12 (author)Josehf Murchison2013-03-19

thanks i am going to try that

Select as Best AnswerUndo Best Answer

user
caitlinsdad (author)2013-03-19

Maybe you were thinking of this one? https://www.instructables.com/id/The-Enigma-Puzzle-Box/ No transistor but even simpler.

Select as Best AnswerUndo Best Answer

user
khan12 (author)2013-03-19

please guys help me........

Select as Best AnswerUndo Best Answer