element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Arduino
  • Products
  • More
Arduino
Arduino Forum unlock door using servo motor by knocking
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Arduino to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Not Answered
  • Replies 5 replies
  • Subscribers 393 subscribers
  • Views 403 views
  • Users 0 members are here
  • servo
  • motor
Related

unlock door using servo motor by knocking

Former Member
Former Member over 10 years ago

hey guys am new with the arduino and am having some troubles concerning tho codes for the servo motor that i want to use to unlock my door after some specific knocks. can anyone help me please...!

Attachments:
knock_3_doors_unlock.ino.zip
  • Sign in to reply
  • Cancel

Top Replies

  • Former Member
    Former Member over 10 years ago in reply to Former Member +1
    Part of the answer to your question will be a suggestion for HOW you get it working. You say that it isn't recognizing your knocks OR opening the door. Are you sure? For a start, put your "open the door…
  • timswift
    0 timswift over 10 years ago

    What trouble are you having?

     

     

     

    Tim

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 10 years ago in reply to timswift

    i have already written all the codes it seem correct but when trying it,

    its not working properly, like when i knock 3 times it doesn`t unlock door

    even if it recognise the three knocks.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Robert Peter Oakes
    0 Robert Peter Oakes over 10 years ago in reply to Former Member

    Can you post your code and schematic and we will have a look for you

     

    Peter

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 10 years ago in reply to Robert Peter Oakes

    // import the library

    #include quietKnock && value < loudKnock)

            {

              // turn the status LED on

              digitalWrite(yellowLed,HIGH);

              delay(50);

              digitalWrite(yellowLed,LOW);

     

              // print out the status

              Serial.print("Valid knock of the value");

              serial.println(value);

              // return true

              return true;

            }

            // if the knock is not within range

            else

            {

              // print status

              Serial.print("Bad Knock value");

              Serial.println(value);

              //return false

              return false;

            }

          }

    Attachments:
    image
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • Former Member
    0 Former Member over 10 years ago in reply to Former Member

    Part of the answer to your question will be a suggestion for HOW you get it working.

     

    You say that it isn't recognizing your knocks OR opening the door. Are you sure?

     

    For a start, put your "open the door" code into a routine, if you haven't done so already.

     

    Tweak your code so that it winks an LED when it recognizes the knock code. Get that much working. Then replace the "wink LED" code with a call of a routine to open the door.

     

    And, either first or second, add a button to the Arduino, and program it so that pressing the button calls the "open the door" code. (Make it call a simple "Wink the LED" routine first, just to be sure the Arduino IS seeing you press the button.)

     

    Divide and conquer!

     

    ===

    While writing...

     

    Have you considered the old engineering adage: "The solution to the problem may be a different question"...

     

    The servo actuated lock may be a hassle on mechanical grounds, even if you get the programming working... although I concede that there will be circumstances where it will be "the answer". Alternatively, electro-mechanical strikeplates are great if the door is secured with a "Yale" type lock: I.e., you just pull it closed to lock it. (And you have the authority and the carpentry skills!) For one thing, it leaves the mechanical lock unchanged, so that you can, sigh, use the old fashioned key when your alternative isn't working.

     

    More on electro-mechanical strikeplates at..

     

    Electromechanical strike plates (electronic access control)- ec1ems

     

    (And an Arduino/ RFID reader based access control system) at...

     

    RFID reader from Sparkfun or Iteadstudio connected to Arduino- art3rfid1

     

    (And it does work: It is how I have accessed two different properties for several years now.)

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube