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

Arduino UNO-Based Smart Distance Sensing and Alert System with Ultrasonic Sensor and Servo

Image of Arduino UNO-Based Smart Distance Sensing and Alert System with Ultrasonic Sensor and Servo

Circuit Documentation

Summary

This circuit involves an Arduino UNO microcontroller interfacing with various components including LEDs, resistors, a servo motor, an ultrasonic sensor, and a buzzer. The circuit is designed to demonstrate basic control of these components using the Arduino platform.

Component List

  1. 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
  2. HC-SR04 Ultrasonic Sensor

    • Description: A sensor used for measuring distance.
    • Pins: VCC, TRIG, ECHO, GND
  3. Servo

    • Description: A motor used for precise control of angular position.
    • Pins: gnd, vcc, pulse
  4. LED: Two Pin (red)

    • Description: A red light-emitting diode.
    • Pins: cathode, anode
  5. LED: Two Pin (green)

    • Description: A green light-emitting diode.
    • Pins: cathode, anode
  6. LED: Two Pin (white)

    • Description: A white light-emitting diode.
    • Pins: cathode, anode
  7. Resistor (220 Ohms)

    • Description: A resistor with a resistance of 220 Ohms.
    • Pins: pin1, pin2
  8. Buzzer

    • Description: A device that produces sound.
    • Pins: PIN, GND

Wiring Details

Arduino UNO

  • 5V connected to:

    • Servo (vcc)
    • HC-SR04 Ultrasonic Sensor (VCC)
  • GND connected to:

    • LED: Two Pin (white) (cathode)
    • LED: Two Pin (green) (cathode)
    • LED: Two Pin (red) (cathode)
    • Servo (gnd)
    • LED: Two Pin (red) (cathode)
    • LED: Two Pin (green) (cathode)
    • Buzzer (GND)
    • HC-SR04 Ultrasonic Sensor (GND)
  • D2 connected to:

    • Resistor (pin1)
    • Resistor (pin2) connected to LED: Two Pin (white) (anode)
  • D3 connected to:

    • Resistor (pin1)
    • Resistor (pin2) connected to LED: Two Pin (green) (anode)
  • D4 connected to:

    • Resistor (pin1)
    • Resistor (pin2) connected to LED: Two Pin (red) (anode)
  • D5 connected to:

    • Resistor (pin1)
    • Resistor (pin2) connected to LED: Two Pin (red) (anode)
  • D6 connected to:

    • Resistor (pin1)
    • Resistor (pin2) connected to LED: Two Pin (green) (anode)
  • D7 connected to:

    • Buzzer (PIN)
  • D11 connected to:

    • HC-SR04 Ultrasonic Sensor (TRIG)
  • D12 connected to:

    • HC-SR04 Ultrasonic Sensor (ECHO)
  • D13 connected to:

    • Servo (pulse)

HC-SR04 Ultrasonic Sensor

  • VCC connected to Arduino UNO (5V)
  • TRIG connected to Arduino UNO (D11)
  • ECHO connected to Arduino UNO (D12)
  • GND connected to Arduino UNO (GND)

Servo

  • vcc connected to Arduino UNO (5V)
  • gnd connected to Arduino UNO (GND)
  • pulse connected to Arduino UNO (D13)

LED: Two Pin (red)

  • cathode connected to Arduino UNO (GND)
  • anode connected to Resistor (pin2)
  • Resistor (pin1) connected to Arduino UNO (D4)

LED: Two Pin (green)

  • cathode connected to Arduino UNO (GND)
  • anode connected to Resistor (pin2)
  • Resistor (pin1) connected to Arduino UNO (D3)

LED: Two Pin (white)

  • cathode connected to Arduino UNO (GND)
  • anode connected to Resistor (pin2)
  • Resistor (pin1) connected to Arduino UNO (D2)

Resistor (220 Ohms)

  • pin1 connected to Arduino UNO (D2, D3, D4, D5, D6)
  • pin2 connected to LED: Two Pin (white, green, red)

Buzzer

  • PIN connected to Arduino UNO (D7)
  • GND connected to Arduino UNO (GND)

Documented Code

Arduino UNO Code

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

}

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

}

Buzzer Code

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

}

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

}

This documentation provides a comprehensive overview of the circuit, including the components used, their connections, and the code running on the microcontrollers.