Introduction
In this article we are going to learn how to work with ultrasonic Sensor in Arduino Compatible Transducer device which emits and receive Ultrasonic waves. Ultrasonic sensor acts as an artificial hearing apparatus for gadgets. Ultrasonic sensor has 4 pins, the first pin and second pins are power supply pins and the third pin acts as a trigger and the fourth pin acts as an echo pin to send and receive ultrasonic waves.
Requirements
- Arduino(UNO)
- Ultrasonic Sensor
- Buzzer
Procedure
- The circuit connections are made as per the circuit Diagram.
- Upload the codings and place the ultrasonic sensor as per your requirements.
- When any object passes in the range or path ( in our case we are considering 90cm.), buzzer will get ON.
- We can change the Range of the ultrasonic sensor as per the buzzer requirements.
- This can be modified with the use of Relay Module to use in our home and Office.
Steps to follow,
Step 1
Open the Arduino IDE software.
Step 2
Declare the Pins used in the Arduino UNO Board in the void setup, and also declare the initialization of Serial Monitor of Arduino UNO.
Step3
Code the looping conditions in the void loop of Arduino.
Step 4
Make connections as per the circuit diagram.
Step 5
Upload the coding.
Step 6
Open Serial Monitor and Check the working.
Step 7
Check the working of the project by placing your hand or any objects.
Conclusion
In this article we learned how to work with ultrasonic sensor and buzzer, by creating a simple alarm project using ATMega328 microcontroller development kit (that is Arduino UNO). This alarm can be further developed to produce accurate results, which can be done by adding a PIR sensor to it which we will learn about in upcoming articles.