# Need help trying to understand a personel padlock project (not a schoolwork)

#### RoyCone

Joined Jul 15, 2022
21
I don't know if it's the right palce to post but it seemed right
I'm following a book 'make electronic' and experiment 21 is a combination lock with and gates. In the book they suggest putting this lock on your computer between the power on and the motherboard, so that you're the only one who knows the code to use it( I simply put an red led with a switch and a resistance, but i'll be referencing it as 'the computer'). I have trouble understing how it works. Here are the schematics

From what I understand, you press button A for power then you enter the combination with e, f, g, h and if you press b,c,d it resets. When it's done you can flick the switch of your'computer' . I made the circuit and it works well, but there are a couple of problems. First, there's a time limit , like 3 minutes and then everything shuts off. So even if i'm still using the 'computer' it turns off. Second, once everything is 'on' and i switch the 'computer' off, then the lock is still 'open' so anyone can use the 'computer', but then after the time limit averything shuts off.
I have a feeling this isn't normal and I made a mistake. Someone once told me to put pictures of my circuits even if it's not difficult to see ( i did my best but i'm still trying to get the hang of being 'clean'). So here they are (i have three diode hanging on the side, sorry i forgot to remove them)
*Note this is not a homework and it's not for school. Please tell me the answer i only put this in homework because it was educational

I pressed the b, c, d button and it resets the e, f,g,h button but i can still open and close the 'computer' (red led) as long as the timer is still 'on'

And i can't shut it 'off'

#### crutschow

Joined Mar 14, 2008
31,585
I suppose this is an obvious question, but why not just add a password to logon the computer?

#### dl324

Joined Mar 30, 2015
15,511
I'm following a book 'make electronic' and experiment 21 is a combination lock with and gates.
I dislike just about everything about that book. Does it give a description of how the circuit works?

Are you supposed to press switches e, f, g, and h at the same time. If they guy would just draw a schematic, we could probably tell...

#### RoyCone

Joined Jul 15, 2022
21
I dislike just about everything about that book. Does it give a description of how the circuit works?

Are you supposed to press switches e, f, g, and h at the same time. If they guy would just draw a schematic, we could probably tell...
Yes there is a lot of explanations but they don't seem to answer the questions I have just asked. There's always something that happens that is not explained. In this circuit you have to press button a first and keep it pushed while you press e, then f, g, and h in order. A powers up the and chip with the gates. Then when you press e the output of the gate locks the gate by providing current to the inputs. Once all gates are locks that activates the relay and you can activate 'the computer'. The b, c, d buttons are just there to complicate the 'code' and they reset the gates if presses. There is an an explanation that i have trouble understanding though. It's about how once the circuit is activate, it's supposed to consumbe very little power? Aren't the schematics that I have given you good enough? I could take a picture of the explication if you want?

#### RoyCone

Joined Jul 15, 2022
21
I suppose this is an obvious question, but why not just add a password to logon the computer?
It's not really about locking the computer. It's more an exercise on how to use logic gates.

#### crutschow

Joined Mar 14, 2008
31,585
Aren't the schematics that I have given you good enough?
If's very difficult to follow that wiring diagram (which is not a normal schematic).
Standard schematic drawings are much easier to follow and determine the signal flow.
Others may have the patience to wade through the diagram but I don't.

Last edited:

#### dl324

Joined Mar 30, 2015
15,511
Aren't the schematics that I have given you good enough?
Nothing that you posted would be considered a schematic. What the book calls a schematic is just a wiring diagram. As is the colorful wiring diagram on the breadboard (that I assume came from the book).
I could take a picture of the explication if you want?
I think I understand circuit operation from your description, but the actual description could still be helpful.
First, there's a time limit , like 3 minutes and then everything shuts off.
I take it that this isn't supposed to be a feature of the circuit.

Did the text say anything about switch H? Switches E, F, and G cause the other AND gates to latch, but H doesn't have a feedback diode.
Second, once everything is 'on' and i switch the 'computer' off, then the lock is still 'open' so anyone can use the 'computer', but then after the time limit averything shuts off.

Last edited:

#### RoyCone

Joined Jul 15, 2022
21
Nothing that you posted would be considered a schematic. What the book calls a schematic is just a wiring diagram. As is the colorful wiring diagram on the breadboard (that I assume came from the book).
I think I understand circuit operation from your description, but the actual description could still be helpful.
I take it that this isn't supposed to be a feature of the circuit.

Did the text say anything about switch H? Switches E, F, and G cause the other AND gates to latch, but H doesn't have a feedback diode.
For the pictures everything came from the book and i'm too much of a beginner to appreciate the difference, sorry.
I placed the pictures of the explanation below. It does say that the timer switches off after 30 seconds, but I have the impression the 'computer' (my red LED) should stay on, because it kind of defeats stupid if you can only use your 'computer' 30 seconds. Isn't the whole point of the circuit to enable you to press power and once it's done the computer still operates and the circuit is turn off? I expect the yellow light to shut off but the red light to remain on???
For the H button, there's no latch. It's better explained in the explanation.
And i kind of forgot that that was normal, sorry.

The big problem here is that everything shuts down after 30 seconds. From what I understood, the red light should still be on since it has it's own power supply.

#### dl324

Joined Mar 30, 2015
15,511
The big problem here is that everything shuts down after 30 seconds. From what I understood, the red light should still be on since it has it's own power supply.
That's what the circuit was designed to do.

Figure 104 makes it much easier to understand circuit intent. You could have posted that in your original post instead all of the pictures of your breadboard. We only need to see your breadboard if we think you're not wiring things correctly. Anyone who can't follow the breadboards from the book should find a different hobby.

The red LED (which wasn't indicated in the "schematic") is only on when the 5V regulator is receiving power. When the timer times out, the relay isn't energized, so the regulator is unpowered and the LED will be off.

If you don't want the timer to time out, you can put a diode on the 4th AND gate. Anode to pin 8, cathode to pin 10. If you do that, you need to use one of the B, C, or D switches to reset the circuit.

EDIT: The 330 ohm base resistor is much smaller than it needs to be. It's going to try to draw 14mA from the AND gate and that's unnecessarily high. The collector current needs to be 9mA, so:

$$\large R=\frac{V}{I}=\frac{V_{OH}-V_{BE}}{I_B}=\frac{5.0V-0.7V}{0.1*9mA}=4.77k\Omega$$
Use 4.7k

The 1k collector resistor is also smaller than it needs to be. Could easily be 10k which would let you use a 47k base resistor. If you're using a BC547 or similar, the base resistor could be twice as large.

Last edited:

#### RoyCone

Joined Jul 15, 2022
21
That's what the circuit was designed to do.

Figure 104 makes it much easier to understand circuit intent. You could have posted that in your original post instead all of the pictures of your breadboard. We only need to see your breadboard if we think you're not wiring things correctly. Anyone who can't follow the breadboards from the book should find a different hobby.

The red LED (which wasn't indicated in the "schematic") is only on when the 5V regulator is receiving power. When the timer times out, the relay isn't energized, so the regulator is unpowered and the LED will be off.

If you don't want the timer to time out, you can put a diode on the 4th AND gate. Anode to pin 8, cathode to pin 10. If you do that, you need to use one of the B, C, or D switches to reset the circuit.

EDIT: The 330 ohm base resistor is much smaller than it needs to be. It's going to try to draw 14mA from the AND gate and that's unnecessarily high. The collector current needs to be 9mA, so:

$$\large R=\frac{V}{I}=\frac{V_{OH}-V_{BE}}{I_B}=\frac{5.0V-0.7V}{0.1*9mA}=4.77k\Omega$$
Use 4.7k

The 1k collector resistor is also smaller than it needs to be. Could easily be 10k which would let you use a 47k base resistor. If you're using a BC547 or similar, the base resistor could be twice as large.
That's what does the circuit is supposed to do" But if you cut the power to a computer switch, the computer shuts down. I'm sure that if i put that padlock on my computer, my computer wouldn't be on for more than 30 seconds?
The led that you suggest makes more sense. You activate the padlock, use your computer and then when you're done, you turn it off. But if you put the diode you suggested, then you don't really need the 555 relay no?

#### dl324

Joined Mar 30, 2015
15,511
That's what does the circuit is supposed to do" But if you cut the power to a computer switch, the computer shuts down. I'm sure that if i put that padlock on my computer, my computer wouldn't be on for more than 30 seconds?
That's because you're not using the circuit the way the author intended. The power switch you're supposed to interrupt is used by the motherboard to turn the computer on. Once the computer is on opening the line on that switch won't turn the computer off.
But if you put the diode you suggested, then you don't really need the 555 relay no?
The author said the 555 is needed to be able to energize the relay and it's still needed because it also powers the circuit until the timer times out.

#### djsfantasi

Joined Apr 11, 2010
8,792
That's what does the circuit is supposed to do" But if you cut the power to a computer switch, the computer shuts down. I'm sure that if i put that padlock on my computer, my computer wouldn't be on for more than 30 seconds?
The led that you suggest makes more sense. You activate the padlock, use your computer and then when you're done, you turn it off. But if you put the diode you suggested, then you don't really need the 555 relay no?
Not a serious technical comment, but rather an observation. Which other(s) have made.

It appears that this circuit is merely a logic exercise and NOT a practical circuit to lock a computer or any device. IMHO, the 30 second timeout was implemented so various experiments could be performed using the circuit. As such, it is (again) not a practical lock circuit.

Once this is understood, then you can try to modify the circuit so that it is useful.

#### dl324

Joined Mar 30, 2015
15,511
my computer wouldn't be on for more than 30 seconds?
BTW, I don't know how the author arrived at 30 seconds. The time period is 1.1RC. With the component values used, that would be closer to 11 seconds than 30. It was convenient that he used 1M and 10uF so you could do the arithmetic in your head; M cancels u, so 1.1 * 10 = 11.

Also using a 10uF cap for the timer power on reset was overkill.

#### RoyCone

Joined Jul 15, 2022
21
That's because you're not using the circuit the way the author intended. The power switch you're supposed to interrupt is used by the motherboard to turn the computer on. Once the computer is on opening the line on that switch won't turn the computer off.
The author said the 555 is needed to be able to energize the relay and it's still needed because it also powers the circuit until the timer times out.
But if you put your diode on button h then the logic chip stays on and it goes off when you press the b, c or d button, so if we connected the output of the logic chip to the relays solenoid, then why the timer needed? I'm sorry but how does it power the circuit until the timer times out? Isn't it hte 3rd pin the outpin of the timer?

#### dl324

Joined Mar 30, 2015
15,511
so if we connected the output of the logic chip to the relays solenoid, then why the timer needed?
That's the rub. In the text it says that the "timer output should be sufficient to activate the relay". The reason it can do that is that the bipolar version of the 555 timer can sink or source 200mA. No logic gate is going to be able to do that.

I'm sorry but how does it power the circuit until the timer times out?
In addition to closing the "on" switch for the computer, the relay also powers the logic. That last point is what makes the circuit "consumes no power at all" when it isn't active. When the relay isn't energized, power is disconnected from the circuit.

Last edited: