+21622886281
Arduino HC-SR04 Project

Obstacle detection system with Arduino

An obstacle detection system is a device or system that is designed to detect the presence of obstacles in a specific area. These systems can be used in a variety of applications, such as in vehicles to assist with driving, in robotics to help with navigation, and in industrial settings to protect workers and equipment. Common types of obstacle detection systems include radar, lidar, ultrasonic sensors, and cameras. These systems use different techniques to detect obstacles, such as measuring distance, using infrared radiation, or analyzing images.

An obstacle detection system with Arduino can be implemented using ultrasonic sensors. These sensors emit ultrasonic waves and measure the time it takes for the waves to bounce back to the sensor. By measuring the time and the speed of sound, the distance to the obstacle can be calculated. The Arduino can then be programmed to take actions based on the distance, such as stopping a robot or activating an alarm. Additionally, an infrared sensor can also be used for obstacle detection, which emits infrared light and detect the reflected beams. Both these sensors can be interfaced with arduino using it’s digital or analog pins and programming the arduino using C/C++ like arduino programming language.

Purpose of this project:

In this project an obstacle detection system will be built with Arduino. This system mainly uses an ultrasound sensor, buzzer and LED.

When the ultrasonic sensor detects an obstacle at a distance < 3cm, the Arduino orders the buzzer to ring and the red LED to light up.

Necessary components

Arduino UNO

The Arduino UNO is a microcontroller board based on the ATmega328P. It has 14 digital input/output pins, 6 analog inputs, a 16 MHz quartz crystal, a USB connection, a power jack, an ICSP header, and a reset button. It is the most popular and widely used board among the Arduino boards.

The Arduino UNO can be programmed using the Arduino programming language, which is based on C++. It uses a simple and intuitive programming environment, making it easy for beginners to get started with microcontroller programming.

The Arduino UNO can be connected to various sensors and actuators to control different devices and perform different tasks. For example, it can be used to control motors, read data from sensors, display information on an LCD screen, and communicate with other devices via serial communication protocols such as I2C and SPI.

The Arduino UNO can also be powered by a USB cable or an external power supply, making it easy to use in a wide range of projects and applications. It’s compatible with a wide range of shields (expansion boards) that adds functionality to the board, such as Ethernet, WiFi, and Bluetooth, and it’s widely supported by a strong and active community, which provides a lot of tutorials, examples and libraries to help users to get the most of the board.

ultrasonic sensor (HC-SR04)

The HC-SR04 is an ultrasonic distance sensor. It uses sound waves to measure the distance to an object. The sensor sends out a 40kHz sound wave, and then measures the time it takes for the sound wave to bounce back to the sensor. By measuring the time it takes for the sound wave to travel to an object and back, the HC-SR04 can calculate the distance to that object. It is commonly used in robotics, automation and other projects where distance measurement is required.

Buzzer

A buzzer is an electronic device that produces a sound when an alternating current is applied to it. It is used for a variety of purposes, such as in alarms, timers, and other devices that need to produce an audible signal.

1 resistance of 220Ω

Resistance is the measure of a material’s ability to oppose the flow of electric current. It is measured in units of ohms (Ω). The resistance of a material is determined by its composition and temperature, and can be affected by changes in temperature and the presence of impurities.

1 red LED

A red LED (Light Emitting Diode) is a type of semiconductor device that emits light when a current is passed through it. LEDs are made of a material called a semiconductor, which is a type of material that has electrical properties that fall between those of a conductor and an insulator. When a current is passed through an LED, it causes the electrons in the semiconductor to become excited and release energy in the form of light.

connecting wires

Connecting wires are used to connect various components in an electronic circuit. They allow for the transfer of electricity, data, or signals between different devices and components.

When connecting wires to an Arduino or other microcontroller, it is important to pay attention to the correct pinout. The pinout refers to the arrangement of pins on the microcontroller and the corresponding function of each pin. The Arduino pinout can be found in the documentation provided by the manufacturer, or in various resources available online.

test plate

A test plate, also known as a test jig, is a device used to test electronic circuits and components. It is a board or plate that has been designed to hold and connect various components and devices in a specific configuration, allowing for the easy testing and measurement of their performance.

A test plate can be used to test various types of electronic circuits and components, such as microcontrollers, sensors, and actuators. It typically includes connectors and sockets for connecting wires, power supply and measurement devices such as multimeters, oscilloscopes, and power supplies.

Mounting

To make the assembly, we can connect :

For LED and buzzer:

  • the terminals (+) of the red LED and buzzer to the digital pin 1 of  Arduino.
  • the (-) terminals of the red LED and buzzer at the GND pin of  Arduino.

For HC-SR04 sensor:

  • TRIG pin to pin 2 of Arduino
  • Echo pin tp pin 3 of Arduino.
  • VCC pin to 3.3V of Arduino
  • GND pin to GND of Arduino

or the LCD display:

  • the SDA pin at the Arduino analog pin A4.

  • the SCL pin at the Arduino analog pin A5.

  • the VCC pin at the Arduino 5v pin.

  • the GND pin at the Arduino GND pin

Program

The Obstacle Detection System program is as follows:

 




0 commentaire


Leave a comment

Votre adresse e-mail ne sera pas publiée.

Scroll to Top