ESP32-Controlled NEMA23 Stepper Motor with I2C LCD Interface and Keypad Input
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit is designed to control a NEMA23 stepper motor using an ESP32 microcontroller and an L298N DC motor driver. The ESP32 also interfaces with a 4x4 membrane matrix keypad for input and an I2C LCD 16x2 screen for output. A buzzer provides audio feedback, and a rocker switch controls the power supply to the motor driver. The circuit is powered by a 12V power supply, with a 2.1mm DC barrel jack facilitating the connection.
Component List
ESP32 (30 pin)
- Microcontroller with WiFi and Bluetooth capabilities.
- 30 GPIO pins including analog inputs, SPI, I2C, UART, DAC, and touch sensors.
L298N DC Motor Driver
- Dual H-bridge motor driver capable of driving two DC motors or one stepper motor.
- Provides up to 2A per channel.
NEMA23 Stepper Motor
- A high torque stepper motor commonly used for precision control in CNC machines and 3D printers.
Rocker Switch (SPST)
- A single-pole single-throw switch used to control the power flow to the motor driver.
2.1mm DC Barrel Jack
- A power connector that mates with a standard 2.1mm power plug.
Buzzer
- An audio signaling device that can be used to provide audible feedback.
I2C LCD 16x2 Screen
- A 16-character by 2-line liquid crystal display with an I2C interface.
4X4 Membrane Matrix Keypad
- A 16-button keypad arranged in a 4x4 matrix for user input.
12V Power Supply
- Provides the necessary power to the circuit components.
Wiring Details
ESP32 (30 pin)
D32connected to KeypadR2D33connected to KeypadR1D25connected to Motor DriverIN4D26connected to Motor DriverIN3D27connected to Motor DriverIN2D14connected to Motor DriverIN1GNDconnected to LCD ScreenGND, DC Barrel Jackswitch, Motor DriverGND, Power Supply-, and BuzzerGNDVinconnected to Motor Driver5Vand LCD ScreenVCC (5V)D22connected to LCD ScreenSCLD21connected to LCD ScreenSDAD19connected to KeypadR4D18connected to KeypadR3D5connected to KeypadC2TX2connected to KeypadC4RX2connected to KeypadC3D4connected to KeypadC1D15connected to BuzzerPIN
L298N DC Motor Driver
OUT1connected to NEMA23COUT2connected to NEMA23A12Vconnected to Rocker Switch2GNDshared with ESP32GND, DC Barrel Jackswitch, Power Supply-, and BuzzerGND5Vshared with ESP32Vinand LCD ScreenVCC (5V)OUT3connected to NEMA23DOUT4connected to NEMA23B
NEMA23 Stepper Motor
Cconnected to Motor DriverOUT1Aconnected to Motor DriverOUT2Dconnected to Motor DriverOUT3Bconnected to Motor DriverOUT4
Rocker Switch (SPST)
2connected to Motor Driver12V1connected to DC Barrel Jackcenterand Power Supply+
2.1mm DC Barrel Jack
switchshared with ESP32GND, Motor DriverGND, Power Supply-, and BuzzerGNDcenterconnected to Rocker Switch1and Power Supply+
Buzzer
PINconnected to ESP32D15GNDshared with ESP32GND, DC Barrel Jackswitch, Motor DriverGND, and Power Supply-
I2C LCD 16x2 Screen
SCLconnected to ESP32D22SDAconnected to ESP32D21VCC (5V)shared with ESP32Vinand Motor Driver5VGNDconnected to ESP32GND
4X4 Membrane Matrix Keypad
R1connected to ESP32D33R2connected to ESP32D32R3connected to ESP32D18R4connected to ESP32D19C1connected to ESP32D4C2connected to ESP32D5C3connected to ESP32RX2C4connected to ESP32TX2
12V Power Supply
+connected to DC Barrel Jackcenterand Rocker Switch1-shared with ESP32GND, DC Barrel Jackswitch, Motor DriverGND, and BuzzerGND
Documented Code
No code was provided for the microcontroller. The documentation of the code would typically include a description of the functionality, setup and loop functions, and any functions or libraries used to control the components in the circuit. Since no code is available, this section is left blank.