Arduino Nano Controlled HC-SR04 Ultrasonic Distance Measurement
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary of the Circuit
This circuit integrates an HC-SR04 Ultrasonic Sensor with an Arduino Nano microcontroller. The purpose of the circuit is to utilize the ultrasonic sensor to measure distances and relay that information back to the Arduino Nano for processing. The Arduino Nano is programmed to control the sensor and interpret its signals.
Component List
HC-SR04 Ultrasonic Sensor
- Description: An ultrasonic ranging sensor that provides 2cm to 400cm non-contact measurement functionality with a ranging accuracy that can reach up to 3mm.
- Pins:
- VCC: Power supply input (5V)
- TRIG: Trigger input for initiating the measurement
- ECHO: Echo output where the sensor provides a pulse proportional to the distance
- GND: Ground
Arduino Nano
- Description: A small, complete, and breadboard-friendly board based on the ATmega328 (Arduino Nano 3.x).
- Pins:
- D1/TX: Digital pin 1, used for serial transmission
- D0/RX: Digital pin 0, used for serial reception
- RESET: Used to reset the microcontroller
- GND: Ground
- D2-D13: Digital pins 2 to 13
- VIN: Input voltage to the Arduino when using an external power source
- 5V: Regulated power supply used to power the microcontroller and other components
- A0-A7: Analog input pins 0 to 7
- AREF: Analog reference pin for the ADC
- 3V3: 3.3V output from the onboard voltage regulator
Wiring Details
HC-SR04 Ultrasonic Sensor
- VCC connected to Arduino Nano 5V
- TRIG connected to Arduino Nano D9
- ECHO connected to Arduino Nano D10
- GND connected to Arduino Nano GND
Arduino Nano
- 5V provides power to HC-SR04 Ultrasonic Sensor VCC
- D9 connected to HC-SR04 Ultrasonic Sensor TRIG
- D10 connected to HC-SR04 Ultrasonic Sensor ECHO
- GND provides ground to HC-SR04 Ultrasonic Sensor GND
Documented Code
Arduino Nano 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 contain any functionality. It should be populated with the necessary setup and loop code to control the HC-SR04 Ultrasonic Sensor and process its data.
Additional Documentation (documentation.txt)
No additional documentation code was provided.