Cirkit Designer Logo
Cirkit Designer
Your all-in-one circuit design IDE
Home / 
Project Documentation

Arduino UNO Based Ultrasonic Distance Measurement with HC-SR04 and Bluetooth Communication via HC-05

Image of Arduino UNO Based Ultrasonic Distance Measurement with HC-SR04 and Bluetooth Communication via HC-05

Circuit Documentation

Summary

This document provides a detailed overview of a circuit that integrates an Arduino UNO microcontroller with an HC-05 Bluetooth module and an HC-SR04 Ultrasonic Sensor. The Arduino UNO serves as the central processing unit, the HC-05 enables Bluetooth connectivity, and the HC-SR04 is used for distance measurement. The circuit is designed to measure distances and potentially communicate that information wirelessly via Bluetooth.

Component List

Arduino UNO

  • Description: A microcontroller board based on the ATmega328P.
  • Purpose: Acts as the central processing unit for the circuit, controlling the sensor and communication with the HC-05 Bluetooth module.
  • Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0-A5, SCL, SDA, AREF, D0-D13.

HC-05 Bluetooth Module

  • Description: A Bluetooth module for wireless communication.
  • Purpose: Provides Bluetooth connectivity to the circuit, allowing for wireless data transmission.
  • Pins: EN, VCC, GND, TXD, RXD, STATE.

HC-SR04 Ultrasonic Sensor

  • Description: An ultrasonic ranging module that provides 2cm to 400cm non-contact measurement functionality.
  • Purpose: Measures distances by emitting ultrasonic waves and detecting the reflection.
  • Pins: VCC, TRIG, ECHO, GND.

Wiring Details

Arduino UNO

  • 5V connected to HC-SR04 VCC and HC-05 VCC.
  • GND connected to HC-SR04 GND and HC-05 GND.
  • D2 connected to HC-SR04 TRIG.
  • D3 connected to HC-SR04 ECHO.
  • D0 (RX) connected to HC-05 TXD.
  • D1 (TX) connected to HC-05 RXD.

HC-05 Bluetooth Module

  • VCC connected to Arduino UNO 5V.
  • GND connected to Arduino UNO GND.
  • TXD connected to Arduino UNO D0 (RX).
  • RXD connected to Arduino UNO D1 (TX).

HC-SR04 Ultrasonic Sensor

  • VCC connected to Arduino UNO 5V.
  • TRIG connected to Arduino UNO D2.
  • ECHO connected to Arduino UNO D3.
  • GND connected to Arduino UNO GND.

Documented Code

Arduino UNO Code (sketch.ino)

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

Additional Notes

  • The provided code is a template and does not contain any functional logic. It needs to be populated with the setup and loop functions to initialize the pins and implement the desired functionality for the HC-SR04 and HC-05 modules.
  • The HC-05 module requires additional configuration for Bluetooth communication, which is not covered in the provided code.
  • The HC-SR04 sensor will require code to trigger the ultrasonic pulse and measure the time taken for the echo to return, which can then be converted into a distance measurement. This logic should be implemented in the loop function.