Combination Lock Question

Thread Starter

testedoido

Joined Dec 21, 2024
3
I'm doing a combination lock for a project, and I want to do a circuit that disables the password checker if its check the wrong password 3 times.
This is almost working, the problem is that if it's given the right password, the counter increses too, so it locks even if it's the correct password.
I think the problem is that the counter it's increasing before checking if the led is lit or not (if it's lit, the AND gateb
1735857518646.png
 

crutschow

Joined Mar 14, 2008
38,316
I think the problem is that the counter it's increasing before checking if the led is lit or not (if it's lit, the AND gateb
So the logical question is, why not change the logic so the counter increases only after checking that the LED is not lit (such as when the selected input switch signal is released?
 
Last edited:

Thread Starter

testedoido

Joined Dec 21, 2024
3
Thank you for your reply Zapper!
I tried incrementing the counter after the check, and I came up with this:
1735860919992.png
But it's now incrementing when the led turns up, and dont incrementing when the led is turned off, If i put a NOT before the AND gates, the logic is lost
 

panic mode

Joined Oct 10, 2011
4,864
what is the purpose for the AND gate between MATCH block and counter?
why you only compare counter with value 3? what if counter value is 4 or 5? (regardless how it got there)
 

MrAl

Joined Jun 17, 2014
13,667
I'm doing a combination lock for a project, and I want to do a circuit that disables the password checker if its check the wrong password 3 times.
This is almost working, the problem is that if it's given the right password, the counter increses too, so it locks even if it's the correct password.
I think the problem is that the counter it's increasing before checking if the led is lit or not (if it's lit, the AND gateb
View attachment 339474
Hi,

It's a little hard to see what that yellow block does, and your "Contador" block. It looks like you might be mixing 1 bit lines with multiple bit lines and that makes it harder to decipher what you are currently doing with the logic.
If you need to check the password 3 times, then you need a counter that can count up to at least 3 or 4. Do you at least have that?
 
Top