Arduino UNO-Based Ultrasonic Distance Measurement System with LCD Display and LoRa Communication
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This document provides a detailed overview of a circuit that includes an Arduino UNO microcontroller, an LCD screen, two HC-SR04 ultrasonic distance sensors, a pushbutton, a micro servo, and a LORA_RA02 module. The circuit is designed to interface these components with the Arduino UNO, allowing for various functionalities such as distance measurement, display output, and wireless communication.
Component List
Arduino UNO
- Description: A microcontroller board based on the ATmega328P.
- Pins: UNUSED, IOREF, Reset, 3.3V, 5V, GND, Vin, A0, A1, A2, A3, A4, A5, SCL, SDA, AREF, D13, D12, D11, D10, D9, D8, D7, D6, D5, D4, D3, D2, D1, D0
Pushbutton
- Description: A simple pushbutton switch.
- Pins: Pin 3 (out), Pin 4 (out), Pin 1 (in), Pin 2 (in)
LCD Screen
- Description: A display module for showing text and graphics.
- Pins: Backlight (GND), VSS, VDD, Contrast, RS, E, R/W, D0, D1, D2, D3, D4, D5, D6, D7, Backlight_PWR
HC-SR04 Ultrasonic Distance Sensor (Wokwi Compatible)
- Description: A sensor for measuring distance using ultrasonic waves.
- Pins: VCC, TRIG, ECHO, GND
Micro Servo 9G
- Description: A small servo motor for precise control of angular position.
- Pins: GND, +5V, PWM
LORA_RA02
- Description: A module for long-range wireless communication.
- Pins: A/G, GND, 3V3, RST, IO_0, IO_1, IO-2, IO_3, NSS, MOSI, MISO, SCK, IO_5, IO_4
Wiring Details
Arduino UNO
- GND: Connected to GND of LORA_RA02, Micro servo 9G, Pushbutton (Pin 1 (in)), HC-SR04 (both sensors), LCD screen (Backlight (GND), VSS, Contrast, R/W)
- 5V: Connected to VCC of both HC-SR04 sensors, +5V of Micro servo 9G, VDD of LCD screen
- 3.3V: Connected to 3V3 of LORA_RA02
- A0: Connected to RS of LCD screen
- A1: Connected to E of LCD screen
- A2: Connected to D4 of LCD screen
- A3: Connected to D5 of LCD screen
- A4: Connected to D6 of LCD screen
- A5: Connected to D7 of LCD screen
- D3: Connected to Pin 2 (in) of Pushbutton
- D4: Connected to ECHO of HC-SR04 (second sensor)
- D5: Connected to TRIG of HC-SR04 (second sensor)
- D6: Connected to ECHO of HC-SR04 (first sensor)
- D7: Connected to TRIG of HC-SR04 (first sensor)
- D8: Connected to PWM of Micro servo 9G
- D9: Connected to RST of LORA_RA02
- D10: Connected to NSS of LORA_RA02
- D11: Connected to MOSI of LORA_RA02
- D12: Connected to MISO of LORA_RA02
- D13: Connected to SCK of LORA_RA02
Pushbutton
- Pin 1 (in): Connected to GND of Arduino UNO
- Pin 2 (in): Connected to D3 of Arduino UNO
LCD Screen
- Backlight (GND): Connected to GND of Arduino UNO
- VSS: Connected to GND of Arduino UNO
- VDD: Connected to 5V of Arduino UNO
- Contrast: Connected to GND of Arduino UNO
- RS: Connected to A0 of Arduino UNO
- E: Connected to A1 of Arduino UNO
- R/W: Connected to GND of Arduino UNO
- D4: Connected to A2 of Arduino UNO
- D5: Connected to A3 of Arduino UNO
- D6: Connected to A4 of Arduino UNO
- D7: Connected to A5 of Arduino UNO
HC-SR04 Ultrasonic Distance Sensor (First Sensor)
- VCC: Connected to 5V of Arduino UNO
- TRIG: Connected to D7 of Arduino UNO
- ECHO: Connected to D6 of Arduino UNO
- GND: Connected to GND of Arduino UNO
HC-SR04 Ultrasonic Distance Sensor (Second Sensor)
- VCC: Connected to 5V of Arduino UNO
- TRIG: Connected to D5 of Arduino UNO
- ECHO: Connected to D4 of Arduino UNO
- GND: Connected to GND of Arduino UNO
Micro Servo 9G
- GND: Connected to GND of Arduino UNO
- +5V: Connected to 5V of Arduino UNO
- PWM: Connected to D8 of Arduino UNO
LORA_RA02
- GND: Connected to GND of Arduino UNO
- 3V3: Connected to 3.3V of Arduino UNO
- RST: Connected to D9 of Arduino UNO
- NSS: Connected to D10 of Arduino UNO
- MOSI: Connected to D11 of Arduino UNO
- MISO: Connected to D12 of Arduino UNO
- SCK: Connected to D13 of Arduino UNO
Code Documentation
Arduino UNO Code
void setup() {
// put your setup code here, to run once:
}
void loop() {
// put your main code here, to run repeatedly:
}
This code is a basic template for the Arduino UNO. The setup() function is where you initialize your components and settings, and the loop() function is where the main logic of your program runs repeatedly.