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

Arduino UNO-Based Smart Door with Ultrasonic Sensor and Charging Station

View and Edit Project In Cirkit DesignerImage of Arduino UNO-Based Smart Door with Ultrasonic Sensor and Charging Station

Circuit Documentation

Summary

This circuit is designed to control a door using an ultrasonic sensor and a servo motor, and it includes a charging station for a device. The system uses an Arduino UNO microcontroller to manage the operations, a seven-segment display to show the charging time, and a relay to control the charging station. The circuit also includes a step-up boost power converter, an ultrasonic sensor, a servo motor, and a 12V battery for power.

Component List

  1. Arduino UNO

    • Description: 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. 5V Relay

    • Description: Relay module for switching high voltage devices.
    • Pins: Normally Open, Common terminal, Normally Closed, In, GND, VCC
  3. Step Up Boost Power Converter, Adjustable Voltage Regulator

    • Description: Boost converter to step up voltage.
    • Pins: VOUT+, VOUT-, VIN+, VIN-
  4. HC-SR04 Ultrasonic Sensor

    • Description: Ultrasonic distance sensor.
    • Pins: VCC, TRIG, ECHO, GND
  5. USB Male 2 Pin Connection

    • Description: USB connector for power.
    • Pins: Negative -, Positive +
  6. Seven Segment Display (TM1637) (Wokwi Compatible)

    • Description: Seven-segment display module.
    • Pins: CLK, DIO, VCC, GND
  7. Electrolytic Capacitor

    • Description: Capacitor with 1000 Farads capacitance.
    • Pins: -, +
  8. 2.1mm Barrel Jack with Terminal Block

    • Description: Power connector.
    • Pins: POS, NEG
  9. Tower Pro SG90 Servo

    • Description: Servo motor for precise control.
    • Pins: Signal, +5V, GND
  10. 12V 5Ah Battery

    • Description: Battery for power supply.
    • Pins: 12v +, 12v -

Wiring Details

Arduino UNO

5V Relay

Step Up Boost Power Converter, Adjustable Voltage Regulator

HC-SR04 Ultrasonic Sensor

USB Male 2 Pin Connection

Seven Segment Display (TM1637)

Electrolytic Capacitor

2.1mm Barrel Jack with Terminal Block

Tower Pro SG90 Servo

12V 5Ah Battery

Code Documentation

Arduino UNO Code

#include <Servo.h>
#include <TM1637Display.h>

#define ULTRASONIC_TRIG_PIN 4
#define ULTRASONIC_ECHO_PIN 5
#define MAIN_DOOR_SERVO_PIN 6
#define LED_PIN 7
#define RELAY_PIN 3
#define DISPLAY_CLK 11
#define DISPLAY_DIO 12

Servo mainDoorServo;
TM1637Display display(DISPLAY_CLK, DISPLAY_DIO);

bool chargingActive = false;
unsigned long chargingStartTime = 0;
unsigned long extraChargingTime = 0;
const unsigned long CHARGING_DURATION = 300000;

const int SERVO_OPEN_POS = 90;
const int SERVO_CLOSE_POS = 5;
const int SERVO_STEP_DELAY = 10;

void setup() {
  pinMode(ULTRASONIC