Ultrasonic Based Access System




This time I present you an ultrasonic based access system I think it could be interesting.

It is based on ultrasonic waves so it is a contactless access system that doesn't need any other electronic device but whatever object even your hands to try to grant access to whatever you want.

The basics of the system: an ordered sequence of measured distances forms a key

I hope you like

Teacher Notes

Teachers! Did you use this instructable in your classroom?
Add a Teacher Note to share how you incorporated it into your lesson.

Step 1: How It Works

The system uses an ultrasonic sensor to measure distances to an object placed in front of it.

Let's suppose we configure the system to admit 6 specified distances: 1/2", 1/5", ... and we define a sequence of 5 measured distances as access key, then the set of different combinations would be 6x6x6x6x6 = 7776

Playing with the numbers of specified distances and the lenght of the access key we can configure an access system with a huge number of combinations.

The system is always measuring distances.

If a valid distances is measured by the sensor during a specified time interval, the sketch saves it and lights up a white led during a brief time interval.

After that the sketch checks if all the distances previously saved matches in the same order with the configured access key.

If so, the sketch will light up the green led and will open the barrier.

Step 2: Supplies

  • One HC-SR04 ultrasonic sensor
  • One ARDUINO NANO or compatible microcotroller
  • One micro servo motor
  • One I2C ARDUINO LCD adapter
  • One protoboard
  • Three 5 mm leds: white, red and green
  • Wires
  • Plywood
  • Cardboard

Step 3: Fritzing Diagram

Step 4: Building the System

The steps I have followed to build the system are the following:

  • Open several holes on the plywood to install the ultrasonic sensor, the micro servo motor, the ARDUINO LCD and the three leds.
  • Wire all components and connect to the microcontroller as you can see in the pictures.

Step 5: The Code

Several points to take into account in the sketch:

  • The constant string variable "accessequence" stores the value of the access key
const String accessequence = "234";
  • The distance value you can see on the ARDUINO LCD is not the distance value measured on inches or centimeters but the value of a "distance group". I mean if the distance measured by the sensor goes from 0,78" to (0,78" + step_distance) the "distance group" value is 1 and so on.
  • You can modify the constant integer "step_distance", the "min_distance" and the "max_distance" to adjust the system precision.

Step 6: Testing the System

Be the First to Share


    • Instrument Contest

      Instrument Contest
    • Make it Glow Contest

      Make it Glow Contest
    • STEM Contest

      STEM Contest

    8 Discussions

    Mohammad AweshH

    Question 4 days ago

    can you please add details of how to do the coding part,as i can see there are several programs, i am completely new to it.

    1 answer
    TecnoProfesorMohammad AweshH

    Answer 4 days ago

    Just download the rar file and extract the content. You will see a new folder called "Acces_Control". After that open the ARDUINO IDE, go to new folder and open the file "Acces_Control.ino". Select the board and the port you are going to use to load the sketch.