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

ESP32-Based Automatic Cigarette Machine with Hall Sensors and Stepper Motors

View and Edit Project In Cirkit DesignerImage of ESP32-Based Automatic Cigarette Machine with Hall Sensors and Stepper Motors

Automatic Cigarette Machine Circuit Documentation

Summary

This document provides a detailed overview of the Automatic Cigarette Machine circuit. The circuit is designed to automate the process of making cigarettes using an ESP32 microcontroller. It interfaces with various sensors and actuators, including Hall sensors, IR sensors, pushbuttons, servos, stepper motors, and an RGB LED matrix.

Component List

  1. Hall Sensor

    • Pins: -, +, S
    • Description: Detects magnetic fields.
    • Purpose: Used to detect the position of the drum and the presence of cigarette tubes.
  2. Regulator XL 4015 with LCD Display with heatsink

    • Pins: IN +, IN -, OUT +, OUT -
    • Description: Voltage regulator with an LCD display.
    • Purpose: Provides regulated power to the circuit components.
  3. DC Mini Metal Gear Motor

    • Pins: IN1, IN2
    • Description: Small DC motor with metal gears.
    • Purpose: Drives mechanical parts of the machine.
  4. BC547 Transistor

    • Pins: Collector, Base, Emitter
    • Description: NPN transistor.
    • Purpose: Used for switching and amplification.
  5. 1N4007 Rectifier Diode

    • Pins: Cathode, Anode
    • Description: General-purpose rectifier diode.
    • Purpose: Protects against reverse voltage.
  6. 12v power supply

    • Pins: +, -
    • Description: Provides 12V DC power.
    • Purpose: Powers the entire circuit.
  7. Servo

    • Pins: GND, VCC, PWM
    • Description: Standard servo motor.
    • Purpose: Controls the loading and starting mechanisms.
  8. Nema 17 42-STH48

    • Pins: A2 (black), A1 Green, B2 Red, B1 Blue
    • Description: Stepper motor.
    • Purpose: Drives the drum rotation.
  9. 28BYJ-48 Stepper Motor

    • Pins: BLUE, PINK, YELLOW, ORANGE, RED
    • Description: Small stepper motor.
    • Purpose: Drives the cigarette tube loading mechanism.
  10. Pushbutton

    • Pins: Pin 2, Pin 1, Pin 3, Pin 4
    • Description: Standard pushbutton.
    • Purpose: Used for start and stop controls.
  11. WS2812 RGB LED matrix 1x8

    • Pins: VCC, GND, DOUT, DIN
    • Description: RGB LED matrix.
    • Purpose: Provides visual feedback.
  12. Resistor

    • Pins: pin1, pin2
    • Description: Resistor.
    • Purpose: Limits current flow.
    • Properties: 220 Ohms, 1000 Ohms
  13. ir sensor

    • Pins: out, gnd, vcc
    • Description: Infrared sensor.
    • Purpose: Detects the presence of objects.
  14. Photocell (LDR)

    • Pins: pin 0, pin 1
    • Description: Light-dependent resistor.
    • Purpose: Detects light levels.
  15. Micro Switch

    • Pins: COM, NO, NC
    • Description: Small switch.
    • Purpose: Used for end-stop detection.
  16. A4988 on Breakout Board

    • Pins: VIN (12-24V), GND, 2B, 2A, 1A, 1B, ENABLE, STEP, DIR, VDD (5V)
    • Description: Stepper motor driver.
    • Purpose: Drives the stepper motors.
  17. ESP32 (30 pin)

    • Pins: EN, VP, VN, D34, D35, D32, D33, D25, D26, D27, D14, D12, D13, GND, Vin, D23, D22, TX0, RX0, D21, D19, D18, D5, TX2, RX2, D4, D2, D15, 3V3
    • Description: Microcontroller.
    • Purpose: Controls the entire circuit.

Wiring Details

Hall Sensor

Regulator XL 4015 with LCD Display with heatsink

DC Mini Metal Gear Motor

BC547 Transistor

1N4007 Rectifier Diode

12v power supply

Servo

Nema 17 42-STH48

28BYJ-48 Stepper Motor

Pushbutton

WS2812 RGB LED matrix 1x8

Resistor

ir sensor

Photocell (LDR)

Micro Switch