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

Arduino-Controlled RGB Traffic Light with Stepper Motor Actuation

View and Edit Project In Cirkit DesignerImage of Arduino-Controlled RGB Traffic Light with Stepper Motor Actuation

Circuit Documentation

Summary

The circuit in question appears to be a control system utilizing an Arduino UNO microcontroller to manage the operation of a stepper motor and a series of LEDs, including an RGB LED. The system is designed to respond to button presses, with the capability to control the stepper motor's operation and the state of the LEDs. The circuit includes resistors for current limiting, tactile switch buttons for user input, and a ULN2003A breakout board to drive the stepper motor.

Component List

Microcontroller

Resistors

Tactile Switch Buttons

LEDs

Motor Driver

Stepper Motor

Wiring Details

Arduino UNO

220 Ohm Resistors

Tactile Switch Buttons

LEDs (Green, Yellow, Red)

RGB LED (Wokwi compatible)

ULN2003A breakout board

28BYJ-48 Stepper Motor

Documented Code

The code provided is for the Arduino UNO microcontroller and is written in C++ using the Arduino IDE. The code includes a library for controlling stepper motors and defines several constants for pin assignments and system parameters. The setup() function initializes the system, and the loop() function continuously checks for button presses and updates the system state accordingly.

The system can be in one of several states: OFF, STANDBY, RUNNING, PAUSED, or RESET. Button presses can change the state, and the system behavior changes depending on the current state. The stepper motor's operation and the LEDs' states are controlled based on the system state and button inputs.

The code includes functions for handling short and long button presses, updating the system state, controlling the stepper motor and LEDs, and printing the system status to the serial monitor.

// Code omitted for brevity. Please refer to the provided code for details.

The code is structured with clear function definitions and comments explaining the purpose of each part of the code. This makes it easier to understand and modify if necessary.