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

Arduino UNO Based Ultrasonic Distance Measurement with LCD Display

Image of Arduino UNO Based Ultrasonic Distance Measurement with LCD Display

Circuit Documentation

Summary

This circuit integrates an Arduino UNO microcontroller with an HC-SR04 ultrasonic sensor and a 16x2 LCD screen with an I2C interface. The circuit is powered by a 9V battery connected through a rocker switch and a 2.1mm barrel jack with a terminal block to provide a controlled power source. The HC-SR04 sensor is used to measure distances, and the LCD screen displays the information processed by the Arduino. The Arduino UNO serves as the central processing unit, controlling the sensor and managing the display on the LCD.

Component List

Arduino UNO

  • Description: A microcontroller board based on the ATmega328P.
  • Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0-A5, SCL, SDA, AREF, D0-D13

HC-SR04 Ultrasonic Sensor

  • Description: An ultrasonic ranging module that provides 2cm to 400cm non-contact measurement functionality.
  • Pins: VCC, TRIG, ECHO, GND

LCD Screen 16x2 I2C

  • Description: A 16x2 character LCD display with an I2C interface.
  • Pins: SCL, SDA, VCC, GND

Rocker Switch

  • Description: A simple on/off rocker switch to control the power supply.
  • Pins: 1, 2

9V Battery

  • Description: A standard 9V battery to provide power to the circuit.
  • Pins: -, +

2.1mm Barrel Jack with Terminal Block

  • Description: A connector to adapt a 9V battery to a barrel jack.
  • Pins: POS, NEG

Wiring Details

Arduino UNO

  • 5V connected to VCC of HC-SR04 and LCD screen
  • GND connected to GND of HC-SR04 and LCD screen
  • A4 (SDA) connected to SDA of LCD screen
  • A5 (SCL) connected to SCL of LCD screen
  • D13 connected to ECHO of HC-SR04
  • D12 connected to TRIG of HC-SR04

HC-SR04 Ultrasonic Sensor

  • VCC connected to 5V of Arduino UNO
  • GND connected to GND of Arduino UNO
  • TRIG connected to D12 of Arduino UNO
  • ECHO connected to D13 of Arduino UNO

LCD Screen 16x2 I2C

  • SCL connected to A5 (SCL) of Arduino UNO
  • SDA connected to A4 (SDA) of Arduino UNO
  • VCC connected to 5V of Arduino UNO
  • GND connected to GND of Arduino UNO

Rocker Switch

  • Pin 1 connected to + of 9V Battery
  • Pin 2 connected to POS of 2.1mm Barrel Jack with Terminal Block

9V Battery

    • connected to Pin 1 of Rocker Switch
    • connected to NEG of 2.1mm Barrel Jack with Terminal Block

2.1mm Barrel Jack with Terminal Block

  • POS connected to Pin 2 of Rocker Switch
  • NEG connected to - of 9V Battery

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:

}

Note: The provided code is a template and does not include specific functionality. It should be populated with the setup and loop routines required to control the HC-SR04 sensor and display the results on the LCD screen.