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

Arduino Nano-Based Smart Motor Control with Ultrasonic Sensor and Relay Switches

View and Edit Project In Cirkit DesignerImage of Arduino Nano-Based Smart Motor Control with Ultrasonic Sensor and Relay Switches

Circuit Documentation

Summary

This document provides a detailed overview of a circuit that includes an Arduino Nano microcontroller, various switches, relays, sensors, a DC motor, and power sources. The circuit is designed to control a DC motor and interact with an ultrasonic sensor, with the relays and switches providing control mechanisms.

Component List

  1. Arduino Nano

    • Description: A small, complete, and breadboard-friendly board based on the ATmega328P.
    • Pins: D1/TX, D0/RX, RESET, GND, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11/MOSI, D12/MISO, VIN, 5V, A7, A6, A5, A4, A3, A2, A1, A0, AREF, 3V3, D13/SCK
  2. Rocker Switch

    • Description: A switch that rocks back and forth to open or close a circuit.
    • Pins: 1, 2
  3. 2-Channel Relay (5V 10A)

    • Description: A relay module that can control two separate circuits.
    • Pins: K1-Off, K1-In, K2-On, K2-In, K1-On, K2-Off, VCC, JD-GND, IN2, IN1, GND
  4. 1-Channel Relay (5V 10A)

    • Description: A relay module that can control a single circuit.
    • Pins: NC, signal, C, power, NO, ground
  5. Toggle Switch SPST

    • Description: A single-pole single-throw (SPST) toggle switch.
    • Pins: L1, COM
  6. HC-SR04 Ultrasonic Sensor

    • Description: An ultrasonic sensor used for distance measurement.
    • Pins: VCC, TRIG, ECHO, GND
  7. DC Motor

    • Description: A motor that runs on direct current (DC).
    • Pins: pin 1, pin 2
  8. 12V Battery (mini)

    • Description: A small 12V battery.
    • Pins: -, +
  9. Battery 12V

    • Description: A 12V battery.
    • Pins: +, -
  10. 1N4007 Rectifier Diode

    • Description: A general-purpose silicon rectifier diode.
    • Pins: Cathode, Anode
  11. Inductor

    • Description: An inductor with an inductance of 1 µH.
    • Pins: pin 0, pin 1

Wiring Details

Arduino Nano

Rocker Switch

2-Channel Relay (5V 10A)

1-Channel Relay (5V 10A)

Toggle Switch SPST

HC-SR04 Ultrasonic Sensor

DC Motor

12V Battery (mini)

Battery 12V

1N4007 Rectifier Diode

Inductor

Documented Code

Arduino Nano 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 Nano. The setup function is where you initialize your settings, and the loop function is where the main code runs repeatedly. You can add your specific logic to control the relays, read the ultrasonic sensor, and manage the motor within these functions.