CD4017 code lock with wrong code detection

Sdílet
Vložit
  • čas přidán 24. 07. 2024
  • Learn how to build an advanced six-digit code lock with built-in wrong code detection, using the CD4017 decimal counter, the CD4081 AND gate IC, and the NE555 timer. In this project we will go through the basics of the schematic and build it together, step by step. Let me know if you have any questions in the comments, and I will do my best to get back to you. Thanks for tuning in!
    More details and an up-to-date list of all components:
    www.friendlywire.com/projects/...
    Monthly email list:
    www.friendlywire.com/email
    Thanks for tuning in, and let me know in the comments if you have any questions!
    Website: www.friendlywire.com
    Twitter: / friendlywire
    Reddit: / friendlywire
    Facebook: / friendlywire
    Instagram: / friendlywire
    Timestamps:
    00:00 Introduction
    00:44 What you need
    02:01 Code lock schematic & explanation
    10:19 Building the code lock
    18:02 Finished code lock
    18:25 How many combinations are there?
    18:48 Final thoughts

Komentáře • 97

  • @ryanwilliams271
    @ryanwilliams271 Před měsícem +1

    This is a gem 100% haven't seen any of your videos of late

    • @FriendlyWire
      @FriendlyWire  Před měsícem +1

      Thank you so much, Ryan, I am glad you like them! I just settled into a new place, and I am still re-building my studio there, but I already have a new project in the works. Stay tuned :)

  • @AndrewKiethBoggs
    @AndrewKiethBoggs Před 2 lety +2

    Fantastic videos. Thanks for the content.

  • @Mr_Motor
    @Mr_Motor Před 2 lety +2

    Man! Again Im impressed with your quality content. keep making it, and I also need a suggestion.

    • @FriendlyWire
      @FriendlyWire  Před 2 lety

      Thanks so much :) What suggestion are you looking for?

  • @ScottWalshWoodworking
    @ScottWalshWoodworking Před 3 lety +2

    Hi Jens! I discovered your channel a little while back and I was inspired enough to build your binary clock. Now I'm making some simple changes to turn it into a Nixie tube clock! I'm very excited about this and I'll be making a video to document this project too.
    I enjoyed this video and perhaps I'll find more applications for discrete logic in place of microcontrollers in the future as well.

    • @FriendlyWire
      @FriendlyWire  Před 3 lety +1

      Hey Scott, thank you so much, that's fantastic! I like your shop, it's incredible how much you put in there! And what kind of Nixie tubes did you end up using? I love Nixie tubes :)
      If you have a picture of the binary clock please let me know on Instagram @FriendlyWire, I would love to see it!

    • @ScottWalshWoodworking
      @ScottWalshWoodworking Před 3 lety +1

      @@FriendlyWire Thanks for checking it out! I ordered IN-14 tubes, and, in fact, they are the only component that I'm waiting for unfortunately. They seem to be taking their sweet time, while making their way from Russia to Canada. Cheers!

    • @FriendlyWire
      @FriendlyWire  Před 3 lety

      @@ScottWalshWoodworking Nice! My first Nixie clock also used IN-14 tubes! Hope they will arrive soon. I bought most of my IN-14 tubes from Russia, and some of them were in the mail for a few months (but all arrived eventually). Hope yours will get there faster :)

  • @notenoughtech
    @notenoughtech Před 3 lety +1

    Love your presentation!

  • @md.mahbuburrahman9104
    @md.mahbuburrahman9104 Před 2 lety +1

    YOUR VIDEO STYLE IS WOASAM 🌻🌻

    • @FriendlyWire
      @FriendlyWire  Před 2 lety

      Ha, thank you very much, I am glad you enjoy them!! :)

  • @johnnyw66
    @johnnyw66 Před 2 lety +5

    I'm a little puzzled why your videos are not 'liked' and 'viewed' as much as they deserve. They are very good. I'm hoping that it's just a problem with the Key Words you've chosen - and you're not going to change your presentation style (which is excellent). I've liked and subscribed. Thank you.

    • @FriendlyWire
      @FriendlyWire  Před 2 lety

      Thank you so much, Johnny, this means a lot, have a fantastic week! :) PS: Can I ask, are you an electronics beginner? And how did you come across my channel?

    • @johnnyw66
      @johnnyw66 Před 2 lety +1

      @@FriendlyWire Thank you. Your channel just popped up as recommended on my CZcams list. I'm not a complete beginner. I've dabbled with home brew radio in the past. I'm now interested in FPGAs. I've recently 'designed' a LogiSim microprocessor which I've put up on github (search for my username and 'SAP2'). Best wishes.

    • @FriendlyWire
      @FriendlyWire  Před 2 lety

      @@johnnyw66 FPGA's are super interesting, I was thinking of maybe getting into them some time ago, but then I stuck with PIC microcontrollers for my videos. There is so much cool stuff to explore out there, thank you for sharing!

    • @Every_thing717
      @Every_thing717 Před 3 měsíci

      @@johnnyw66do u have an instagram account I want to get matched with u

  • @ernestfowler2418
    @ernestfowler2418 Před 2 lety +2

    Jens, I like your idea of using a 555 chip to provide anti-bounce for keystrokes. It solves a problem I found with a counting circuit I was trying to build a while back. Now I do the counting with microcontrollers and such. The circuit you did could be done with a 7-seg display, couldn't it? With leading and / or trailing decimals you'd have 9 LEDs to play with.
    PS: Keep up the fine work!

    • @FriendlyWire
      @FriendlyWire  Před 2 lety +1

      Thank you for your kind words, Ernest! Technically the 555 debounces the reset line, but you could use it for switches, too! In my experience, for usual switches that are actuated 1-2 times per second, a 1uF capacitor in parallel does wonders. Oh yeah, totally, you could connect LED's to the CD4017 outputs. Now, if you wanted to show the digit that was pressed this would require a bunch of more logic to do it, and at that point it would probably be more economic to use a microcontroller :)

    • @aadhithyapasuparthi5642
      @aadhithyapasuparthi5642 Před rokem +1

      @FriendlyWire hii! I'm a massive fan! I was wondering how you would show the digit that is pressed in a 7seg display?

    • @FriendlyWire
      @FriendlyWire  Před rokem

      @@aadhithyapasuparthi5642 Thank you, Aadhithya :) I am actually not sure. You could use diodes to decode the button into a BCD-signal, and then use the CD4511 to drive a 7-segment display. But if you want all digits next to each other in a multi-digit 7-segment display it would be much harder to do.

    • @FriendlyWire
      @FriendlyWire  Před rokem

      @@aadhithyapasuparthi5642 I'd love to help, but this is really no small project to do, and needs quite some time to plan. Have you ever worked with 7-segment displays? And can you get your hands on a CD4511 chip?

    • @FriendlyWire
      @FriendlyWire  Před rokem

      @@aadhithyapasuparthi5642 You can always use the CD4026 as a simple counter of wrong code attempts, I even have a video on that: czcams.com/video/SQddveiff1k/video.html
      Yeah of course, you can contact me on social media @FriendlyWire (preferably Twitter) or also via email which you can find on my website www.friendlywire.com all the way at the bottom,

  • @rafiahaider7861
    @rafiahaider7861 Před 8 měsíci +1

    Hey jens! I was wondering if we could somehow use a keypad in this project? I'm not very acquainted with electronics and it's my first time building an electronic project for my digital logic designs class so i don't really know much but wanted to like make it look more presentable maybe? Do you have any tips please?

    • @FriendlyWire
      @FriendlyWire  Před 8 měsíci

      Thank you for your question! Yes, there are keypads that are called 1x12 keypads, they have one common pin and 12 separate outputs for each key. There are also 3x4 keypads, and those are multiplexed and not usable for this project. Let me see if I can find one that would work :)

  • @tdmmelody
    @tdmmelody Před 6 měsíci +1

    This is a great video! I was just confused by 2 things, how do I set the initial password for this circuit? I am confused about how the circuit knows which input is the right one, also why are we using three extra buttons? Can’t I use one button to reset the circuit? Thanks!!

    • @FriendlyWire
      @FriendlyWire  Před 6 měsíci

      Thank you so much, glad you like it!
      Yeah, of course only one button is enough to reset the circuit, but if you add more buttons you make it more difficult for the person to find the right code.
      The code, as you said, is hard-wired into the diagram. You cannot set your own code dynamically, you have to re-wire the entire circuit. But if you read the companion article to this video on www.friendlywire.com, you will be able to design your own circuit with different codes :)

  • @mlozano818
    @mlozano818 Před rokem +1

    Can you please tell me where you got your jumper wires?:)

    • @FriendlyWire
      @FriendlyWire  Před rokem

      I always have all links in the companion article: www.friendlywire.com/projects/code-lock/

  • @talha_abbas
    @talha_abbas Před 3 měsíci +1

    Hi, Great video. One Question, on which software did you make the schematic circuit

    • @FriendlyWire
      @FriendlyWire  Před 3 měsíci

      Thank you! I use Eagle to make the schematics (no real reason, I just like how they look like) and then I animate the squiggly lines by hand by drawing onto the schematic with GIMP and then superimposing those lines on top of it.

    • @talha_abbas
      @talha_abbas Před 3 měsíci +1

      @@FriendlyWire Thanks A lot for this brief comment, I have my DLD Project presentation next week, saw your designs and it caught my attention. Amazing ❤️

    • @FriendlyWire
      @FriendlyWire  Před 3 měsíci

      @@talha_abbas Happy to help, and good luck for your presentation! :)

  • @howitworks-anmolshastri2259
    @howitworks-anmolshastri2259 Před 2 měsíci +1

    What are the alternatives to CD 4081?

    • @FriendlyWire
      @FriendlyWire  Před 2 měsíci

      You can use any AND gate in the CMOS family. I used the CD4081 because it has two inputs, but you could use CD4073 (3 inputs) and just tie one permanently to VDD. But the CD4081 is the best choice.

  • @jpscafe7648
    @jpscafe7648 Před 2 lety +1

    😀 belíssimo trabalho, show de 🏈🏀🥎. Parabéns pelo seu projeto e trabalho, pena que não falo inglês pra entender sua explicação.☹️ Vou me inscrever no canal. Bora, toma uma 🍺🇧🇷

    • @FriendlyWire
      @FriendlyWire  Před 2 lety

      Muito obrigado! I am so glad you like the video. There is also an written version here: friendlywire.com/projects/code-lock/ . Maybe a translator website will be helpful. Best wishes, and have a great day!

  • @AndrewKiethBoggs
    @AndrewKiethBoggs Před 2 lety +1

    What is another solution for the capacitors across the power terminals on the ICs. The leads on the 0.1 uF caps are too short. Do I just need to extend my leads by soldering?

    • @FriendlyWire
      @FriendlyWire  Před 2 lety +1

      If the capacitor is close to the IC it's OK, you could plug it into the breadboard and use a wire to extend it, for example. If you're running this circuit on batteries you can omit these 100nF capacitors to begin with, they are only important when the power supply is not a linear one that is regulated. Hope that helps, let me know if you have any other questions, I am happy to help!

    • @AndrewKiethBoggs
      @AndrewKiethBoggs Před 2 lety +1

      @@FriendlyWire thank you for your reply! I enjoy a creator that is so willing to help and give a way to enter into the world of electronics. I was thinking about extending the capacitors but I thought the capacitors needed to be as close as possible to the IC to ensure it works best for reliable power. I will be running this on a 9v so I may just take your suggestion and omit these. Thanks!

    • @FriendlyWire
      @FriendlyWire  Před 2 lety +1

      @@AndrewKiethBoggs Happy to help! Long connections to the capacitors will be OK in this case. For high frequencies these long connections would work as an inductance and introduce new problems, but in this case it is OK to have longer connections because the circuit works at very low frequencies. It is just good practice to have a 100nF capacitor close to every logic chip, that way your circuit will also work well if you decide, at some point, to run it from a different power supply.

    • @abanoubhenry8876
      @abanoubhenry8876 Před 2 lety +1

      @@FriendlyWire i have the same problem. So what you're saying is that i can simply just not put those capacitors in my circuit?

    • @FriendlyWire
      @FriendlyWire  Před 2 lety +1

      @@abanoubhenry8876 They are not necessary for the functionality, under ideal circumstances. But they stabilize the circuit. I would recommend to place the 100nF capacitors directly in the power rail instead, close to each CD4017 chip. But if you run this circuit off of a battery you will most likely not need them. Let me know how it works out, Abanoub, I am happy to help and excited to see your progress :)

  • @anyonecanmakeit718
    @anyonecanmakeit718 Před 6 měsíci +1

    I have one doubt what if i make a safe with combination lock that runs on battery and unfortunately battery dies after couple of months then will my safe gets open automatically or it will stay closed forever i mean what would happen can u pls explain?

    • @FriendlyWire
      @FriendlyWire  Před 6 měsíci

      It depends on how you design the circuit :) But, yes, in short: when the circuit has no power left, it cannot activate the green LED at the end, and then the safe would not know that it has to open. As far as I know, many electronic safes have this problem. One way around it would be to add a "low voltage detection circuit" that warns when the battery gets low.

    • @anyonecanmakeit718
      @anyonecanmakeit718 Před 6 měsíci

      @@FriendlyWire thank you Sir for responding 🙏,
      Can u pls tell me how to add attempts i mean if someone tried 3 times to open safe and failed then safe would automatically locked forever?

  • @pawelczarnecki7780
    @pawelczarnecki7780 Před 2 lety +1

    Awesome thank

    • @FriendlyWire
      @FriendlyWire  Před 2 lety

      Glad you like it, Pawel! Let me know if you have any questions, I am happy to help :)

    • @pawelczarnecki7780
      @pawelczarnecki7780 Před 2 lety +1

      I will ask away if any questions come up. I’ve been learning electronics for about 27 years now, and you have got some talent that I could learn a lot from. Great Chanel and material.

    • @FriendlyWire
      @FriendlyWire  Před 2 lety

      @@pawelczarnecki7780 Wow, thank you for your kind words, much appreciated! Keep me posted, and I would love to see a picture of the code lock when you build it! (My email is at the bottom of www.friendlywire.com, but you can of course also reach out on social media @FriendlyWire if you prefer.)

    • @pawelczarnecki7780
      @pawelczarnecki7780 Před 2 lety +1

      I will send it in no problem

    • @FriendlyWire
      @FriendlyWire  Před 2 lety

      @@pawelczarnecki7780 Thank you! It's always so exciting for me to see these projects built by others :)

  • @wimealessandrasuege5901
    @wimealessandrasuege5901 Před rokem +1

    Hi. can you explain to me how i can limit the number of attempts to put the code?

    • @FriendlyWire
      @FriendlyWire  Před rokem

      You could connect the wrong code signal (pin 3 of the NE555) to another CD4017 counter. This counter will then count the incorrect attempts. If you only want to allow, say, three wrong attempts, then connect Q3 of that CD4017 to the clock inhibit pin of IC1 (pin 13). Make sure to also then connect pin 13 of IC1 to ground with a 4.7kOhm resistor. This should to the trick!

    • @sakshidas8741
      @sakshidas8741 Před 3 měsíci

      ​@@FriendlyWire Hi I have connected this circuit by this trick but the lock system cannot restrict the attempts after 3 wrong attempt.So can u pls say any other method to limit the number of attempt.Pls say 🙏🏻

  • @mancquito6181
    @mancquito6181 Před rokem +1

    Hi, I congratulate you for the work you did. I think it's fantastic. Well, I would like to know if this circuit activates when you enter a 3-digit sequential password.

    • @FriendlyWire
      @FriendlyWire  Před rokem +1

      Thank you for your kind words, I am glad you like it! Can you give ne an example for a three-digit code sequential password? Like ABC? Or do you mean something else? :)

    • @mancquito6181
      @mancquito6181 Před rokem +1

      @@FriendlyWire Good afternoon, thank you for answering a question. Do you have a sequential blocking project with only logic gates and when entering the 3-digit password, turn on a green LED or activate an alarm?🤗

    • @FriendlyWire
      @FriendlyWire  Před rokem +1

      @@mancquito6181 Thanks for the question :) I am not sure if I understand, but I think it should be possible. Can you give me an example what code you would like?

    • @mancquito6181
      @mancquito6181 Před rokem +1

      @@FriendlyWire With the easiest brother I beg you to help me with this project. no lm555 no microcontrollers. only with integrated and, or, not, which are with 3-digit logic gates

    • @mancquito6181
      @mancquito6181 Před rokem +1

      @@FriendlyWire please

  • @dr.scientenium3698
    @dr.scientenium3698 Před měsícem +1

    I have done it

    • @FriendlyWire
      @FriendlyWire  Před měsícem

      That's awesome! I would love to see a picture of the code lock. If you can, please share it with me on Twitter/Instagram @FriendlyWire or via email (at the bottom of www.fiendlywire.com). Did everything work as expected?

    • @dr.scientenium3698
      @dr.scientenium3698 Před měsícem

      @@FriendlyWire czcams.com/video/yDn2xTaY5Uw/video.html

    • @dr.scientenium3698
      @dr.scientenium3698 Před měsícem +1

      ​@@FriendlyWire This is security lock system I have made it in youtube video you can see it

  • @srikanth1508
    @srikanth1508 Před 4 měsíci +1

    What will happen if input is ABC (we need to put B 2 times)

    • @FriendlyWire
      @FriendlyWire  Před 4 měsíci

      If you press C when you have only pressed A and then B, then the CD4017 in charge of pin C will still be at Q0, and therefore the circuit will reset when C is pressed :)

  • @musharaf3561
    @musharaf3561 Před 3 lety +1

    👍🏼

  • @marounn-ao4014
    @marounn-ao4014 Před 2 měsíci +1

    how to change the code?

    • @FriendlyWire
      @FriendlyWire  Před 2 měsíci

      Good question! Because this circuit does not use any microcontroller, the code is fixed and cannot be changed. If you want to change the code, you have to change the circuit. Have a look at the companion article on my website: www.friendlywire.com/projects/code-lock/ . In this article I explain how the schematic works, and after reading it you will have a pretty good idea of how you can change the code :)
      But if you are building this circuit and have the pushbuttons in a separate location, a simple way to change the code is this: leave all wires unchanged, and just move the location of the physical pushbuttons around. For example, switch the location of pushbutton A and C on your keypad, and all of a sudden it looks as if the code has been changed.
      Let me know if this helps or if you have additional questions, and thanks again for your interest & for your question! And, most importantly, have fun with electronics!

    • @marounn-ao4014
      @marounn-ao4014 Před 2 měsíci +1

      Man!! the article is so helpful... thank you!

    • @FriendlyWire
      @FriendlyWire  Před 2 měsíci +1

      @@marounn-ao4014 I am glad it helps! If anything doesn't make sense please reach out via email, I will do my best to help out. You can find my email at the bottom of www.friendlywire.com :)

  • @mlozano818
    @mlozano818 Před rokem +1

    Nvm just had to watch more of the video 👌

  • @jj74qformerlyjailbreak3
    @jj74qformerlyjailbreak3 Před rokem +2

    Correction! There are 3 types of bread boards.
    1. Connected power rails
    2. Non-connected
    3. Connected Eluding Non-Connected.
    Don’t let 3 fool you.
    God Bless

    • @jj74qformerlyjailbreak3
      @jj74qformerlyjailbreak3 Před rokem +1

      Thanks for the walk-through of this design. It really gives me an idea. I have 50 4017s otw.
      Originally I was going to cascade them all and test clock circuits. Now I guess I need to order another 50. Thanks for keeping me busy and mind off of stress.
      Once again
      God Bless

    • @jj74qformerlyjailbreak3
      @jj74qformerlyjailbreak3 Před rokem +1

      But also couldn’t someone just press the button slowly to figure out the code. Assuming the lights remain.

    • @FriendlyWire
      @FriendlyWire  Před rokem +1

      @@jj74qformerlyjailbreak3 Oh, what's that type 3 breadboard? I am glad this video inspired you! Yup I suppose with the lights you could figure it out eventually (especially when you look at the red reset LED closely). So this is really just put in for fun (and not for final use).

    • @jj74qformerlyjailbreak3
      @jj74qformerlyjailbreak3 Před rokem +1

      @@FriendlyWire 3rd Type is the ones that silk screen “not connected” power rails, but really are CoNectted. Make stuff go, dang ol boomy man.
      💨

    • @FriendlyWire
      @FriendlyWire  Před rokem

      @@jj74qformerlyjailbreak3 Oh I have never seen those. Good to know!