Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino-Controlled Ultrasonic Distance Sensor with Relay-Activated Bulb

View and Edit Project In Cirkit DesignerImage of Arduino-Controlled Ultrasonic Distance Sensor with Relay-Activated Bulb

Circuit Documentation

Summary of the Circuit

This circuit is designed to interface an Arduino UNO with an HC-SR04 Ultrasonic Sensor and control a relay which in turn controls a bulb. The Arduino UNO is used as the central processing unit, reading sensor data from the HC-SR04 and controlling the relay based on the sensor inputs. The relay acts as an electrically operated switch that allows the Arduino to control the bulb, which is powered by a separate 9V battery. The HC-SR04 Ultrasonic Sensor is used to measure distance by emitting ultrasonic waves and measuring the time it takes for the echo to return.

Component List

Arduino UNO

HC-SR04 Ultrasonic Sensor

BULB

5V Relay

9V Battery

Wiring Details

Arduino UNO

HC-SR04 Ultrasonic Sensor

BULB

5V Relay

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 code provided for the Arduino UNO is a template and does not contain any functional code to operate the HC-SR04 sensor or the relay. To complete the circuit functionality, the code needs to be written to initialize the sensor, read distance measurements, and control the relay based on the sensor data.