Ultrasonic Sensor HC-SR04 (Arduino Project): In this project I will show you how to use two ultrasonic sensors connected to your Arduino board.I’m providing a full step-by-step guidance to expalin how to use this kind of sensors, and I'm explaining in details both hardware and software parts i. Arduino Ultrasonic Sensor HC-SR04 Proteus Library HC-SR04 Ultrasonic sensor mostly uses to measure distance speed or as object detection sensor the good thing about this sensor we don’t need any physical connection between target and sensor. GitHub is where the world builds software. Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world. Allows an Arduino board to use HCSR04 module. HCSR04 ultrasonic sensor. Allows an Arduino board to use HCSR04 module.
- Arduino Tutorial
- Arduino Function Libraries
- Arduino Advanced
- Arduino Projects
- Arduino Sensors
- Motor Control
- Arduino And Sound
- Arduino Useful Resources
- Selected Reading
The HC-SR04 ultrasonic sensor uses SONAR to determine the distance of an object just like the bats do. It offers excellent non-contact range detection with high accuracy and stable readings in an easy-to-use package from 2 cm to 400 cm or 1” to 13 feet.
The operation is not affected by sunlight or black material, although acoustically, soft materials like cloth can be difficult to detect. It comes complete with ultrasonic transmitter and receiver module.
Technical Specifications
- Power Supply − +5V DC
- Quiescent Current − <2mA
- Working Current − 15mA
- Effectual Angle − <15°
- Ranging Distance − 2cm – 400 cm/1″ – 13ft
- Resolution − 0.3 cm
- Measuring Angle − 30 degree
Components Required
You will need the following components −
- 1 × Breadboard
- 1 × Arduino Uno R3
- 1 × ULTRASONIC Sensor (HC-SR04)
Procedure
Follow the circuit diagram and make the connections as shown in the image given below.
Sketch
Open the Arduino IDE software on your computer. Coding in the Arduino language will control your circuit. Open a new sketch File by clicking New.
Arduino Code
Code to Note
Arduino Nano Library For Proteus
The Ultrasonic sensor has four terminals - +5V, Trigger, Echo, and GND connected as follows −
- Connect the +5V pin to +5v on your Arduino board.
- Connect Trigger to digital pin 7 on your Arduino board.
- Connect Echo to digital pin 6 on your Arduino board.
- Connect GND with GND on Arduino.
In our program, we have displayed the distance measured by the sensor in inches and cm via the serial port.
Result
You will see the distance measured by sensor in inches and cm on Arduino serial monitor.
1. Ultrasonic Sensor Library for Proteus
Ultrasonic sensors are mainly used for obstacle detection. They use sound waves for object detection. Ultrasonic sound waves are emitted at a particular frequency which are then reflected back to the sensor after hitting the obstacle. The time these sounds waves takes in traveling from the sensors and then reflecting from the object is measured that gives the total distance covered by the sound waves. It is important to note that these ultrasonic sound waves travel faster than the audible sound that we humans can hear.We’ve designed an ultrasonic sensor library for proteus which you can easily run and simulate in proteus. The library is demonstrated with examples that will help you better understand these sensors covering three different scenarios. I’m sure you’ll love the working and simulation of this library that you can easily understand and incorporate in your semester project. Click the link below to download the ultrasonic library for proteus.Ultrasonic Library Arduino For Proteus 8 Crack Key
2. PIR Sensor Library for Proteus
PIR (passive infrared) sensor is an electronic device that uses infrared rays for motion detection. They are based on thermal detection. They measure infrared rays reflected from objects that produce heat and thus infrared radiations in its field of view. Crystalline material incorporated at the center of the sensor detects the infrared radiation. These sensors are mainly used for security purposes. You’ll find these sensors installed in bank security or home security systems.We cannot measure real motion in proteus software unless we place TestPin. We don’t need this pin in real-time applications. We use this pin for proteus simulation only. When we give 5V to this pin, it will detect the motion and when zero voltage is applied, no motion is detected through this pin.We’ve designed the proteus library of this PIR sensor that you can download from the link below.3. Gas Sensor Library for Proteus
A gas sensor is an electronic device mainly used to detect the presence of gases in the surrounding. Working is simple and straight forward. The gas sensor generates a potential difference based on the gas concentration in the atmosphere. This potential difference is directly related to the resistance of the inside material. This potential difference is measured as an output voltage that is directly proportional to the concentration of the gas. The gas sensor is widely used in a variety of industries for the detection of gas leakage.We’ve designed and added the library for the gas sensor which you can easily simulate in proteus. We’ve included the following 8 gas sensors in the library:MQ – 2MQ – 3MQ – 4MQ – 5MQ – 6MQ – 7MQ – 8MQ – 9You can download the Gas sensor library for proteus by the link below.4. Flame Sensor Library for Proteus
A flame sensor is an electrical device mainly used to detect flame or fire. This sensor carries an infrared band that detects the presence of hot gases in the atmosphere. Installation of the flame sensor depends on the nature of work i.e. the presence of hot gases can lead to sounding the alarm, activation of the fire suspension system, or deactivation of fuel from the mainline. A flame sensor works better than the heat or smoke detector due to its quick response corresponding to the hot gases. It is widely used in industrial furnaces, confirming if the furnace is running accurately.Again, we cannot produce fire in the proteus software the reason we need to include the TestPin for the detection of fire. When the TestPin is HIGH it indicates the presence of flame and when it is LOW it projects the absence of flame.We’ve designed and added Flame Sensor Library in Proteus that you can download from the link below.5. Vibration Sensor Library for Proteus
A vibration sensor (also called a piezoelectric sensor) is an electrical device mainly used to detect the vibration. It is a transducer that behaves like a switch to turn off or turn on the system when a certain vibration level is achieved. The vibration sensor might contain different sensitivity that depends on the nature of the application. Sensitivity is 500 mV/G for low vibration applications and 100mV/G for high vibration applications.These sensors are also used in security systems. If someone tries to break in your house, this sensor can detect the forced entry and produce a signal that triggers an alarm system.Vibration plays a critical role in electrical and mechanical machines. These systems are configured with a specific number of vibration which if exceeds from the recommended value, can damage the machine. These sensors confirm if machines are running with the required vibration.Click the link below to download the vibration sensor library for the proteus.6. Flex Sensor Library for Proteus
The flex sensor is also known as a bend sensor mainly used to measure the bending angle. The resistance of the sensor element is directly proportional to the value of the bend that the surface generates. The bend sensor is also called a flexible potentiometer. This sensor is widely used in security systems, rehabilitation research for measuring the joint movement, and in computer and music interfaces. Dataglove is a common example of a flex sensor.We’ve designed and added the library of this flex sensor in proteus which you can download from the link below.7. Heart Beat Sensor Library for Proteus
Heartbeat sensor is used to detect the heartbeat of the human heart. It operates on the principle of light modulation. When a finger is placed on the sensor, it generates the digital output of the heartbeat. As you place the finger, it detects the blood flow that you can produce as a digital output on the LCD connected with Arduino Board or Microcontroller.We’ve designed and added the library of this heartbeat sensor in proteus. We’ve produced two versions of a heartbeat sensor where one version generates only one heartbeat pattern and the other produces multiple heartbeat patterns. Click the link below to download the heartbeat sensor library for proteus.[LinkButton1 link='https://www.theengineeringprojects.com/2017/09/heart-beat-sensor-library-proteus.html']Download Heart Beat Sensor Library for Proteus[/LinkButton1]8. Rain Sensor Library for Proteus
A rain sensor is a switching device used to detect rain. It finds applications in security systems and home automation. This sensor is also installed in some car windshield where it detects the presence of rainwater, giving an automatic signal to the windshield wipers that thus start cleaning the windshield. Rain sensor operates on the principle of total internal reflection with the use of infrared radiation. The infrared light beam is set at a 45-degree angle on the clear glass of the windshield. This sensor triggers when it starts raining. In the presence of rain, less amount of light is reflected back to the sensor. When this reflected light meets the preset value you already set earlier, it turns on the car wiper mechanism.We’ve designed and added the library of rain sensor in proteus which you can download from the link below.9. Soil Moisture Sensor Library for Proteus
Soil moisture sensor, as the name suggests, is used to measure the water content. It carries two probes where the resistance value of the current passing through the soil is used to record the moisture value. The probe is normally powered with DC supply or batteries ranging from 3.3 to 20V that generates the output voltage ranging from 0 to 3V.We’ve designed the library of soil moisture sensors in proteus. You won’t find this library before in the proteus library and we’re adding it the very first time. You can download the soil moisture library for proteus from the link below.10. Water Sensor Library for Proteus
A water sensor is an electrical device used to detect the presence of water. It is mainly used for domestic and industrial purposes where it is used to detect water leakage. When it detects the leakage, it turns off the water supply to the house.We’ve designed and added the library of water sensor in proteus which you can download from the link below.Conclusion
I've shared 10 New Proteus Libraries above for Engineering Students. Hope you find this post helpful. You can use these libraries in your semester project or anyway as you like better. Both simple sensor simulation and simulation with the Arduino board are added to the proteus library. And TestPin included in the sensor is only used for simulation purposes. You won't find this pin in actual sensor.Don’t forget to leave your comment in case you need my help. We keep sharing and adding new libraries on and off, not available in the proteus already. Feel free to leave your valuable suggestions about the libraries you think are not included in the proteus library. We’ll try our best to include them from the get-go in easy to read and easy to understand tutorials. Thank you for reading this post.
JLCPCB – Prototype 10 PCBs for $2 (For Any Color)
China’s Largest PCB Prototype Enterprise, 600,000+ Customers & 10,000+ Online Orders Daily
How to Get PCB Cash Coupon from JLCPCB:
Syed Zain Nasir
@syedzainnasirI am Syed Zain Nasir, the founder of The Engineering Projects (TEP).I am a programmer since 2009 before that I just search things, make small projects and now I am sharing my knowledge through this platform.I also work as a freelancer and did many projects related to programming and electrical circuitry. My Google Profile+
FollowGet Connected
Comments are closed.