ESP32-Controlled Robotics Interface with Dual DC Motors, Servos, RFID, and I2C LCD Display
View and Edit Project In Cirkit Designer
Circuit Documentation
Summary
This circuit is designed to control two DC motors using an L298N DC motor driver, interfaced with an ESP32 microcontroller. Additionally, the circuit includes two SG90 servomotors, an RFID-RC522 module for RFID communication, a pushbutton with a pull-down resistor, and an I2C LCD 16x2 screen for display purposes. The power supply for the circuit is a 9V battery, which powers the motor driver, and the ESP32 provides 3.3V to the RFID module. The ESP32 microcontroller is the central processing unit, controlling the motors, servos, RFID reader, and the LCD via its GPIO pins.
Component List
L298N DC Motor Driver
- Description: A module used for controlling up to two DC motors with a maximum current of 2A per channel.
- Pins: OUT1, OUT2, 12V, GND, 5V, OUT3, OUT4, 5V-ENA-JMP-I, 5V-ENA-JMP-O, +5V-J1, +5V-J2, ENA, IN1, IN2, IN3, IN4, ENB
DC Motor
- Description: An electric motor that runs on direct current (DC) electricity.
- Pins: pin 1, pin 2
ESP32 (30 pin)
- Description: A microcontroller with Wi-Fi and Bluetooth capabilities, featuring a wide range of GPIO pins.
- 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
Servomotor SG90
- Description: A small and lightweight servo motor capable of precise control.
- Pins: SIG, VCC, GND
RFID-RC522
- Description: An RFID reader/writer module.
- Pins: VCC (3.3V), RST, GND, IRQ, MISO, MOSI, SCK, SDA
Pushbutton
- Description: A simple switch mechanism for controlling some aspect of a machine or a process.
- Pins: Pin 2, Pin 1, Pin 3, Pin 4
Resistor
- Description: A passive two-terminal electrical component that implements electrical resistance as a circuit element.
- Properties: Resistance: 200 Ohms
Battery 9V
- Description: A standard 9V battery used as the power source.
- Pins: VCC, GND
I2C LCD 16x2 Screen
- Description: A liquid crystal display capable of displaying 16 characters per line in 2 lines.
- Pins: SCL, SDA, VCC (5V), GND, VDD, VO, RS, RW, E, D0, D1, D2, D3, D4, D5, D6, D7, BLA, BLK
Wiring Details
L298N DC Motor Driver
- OUT1 connected to DC Motor 1 pin 2
- OUT2 connected to DC Motor 1 pin 1
- 12V connected to Battery 9V VCC
- GND connected to Battery 9V GND
- OUT3 connected to DC Motor 2 pin 2
- OUT4 connected to DC Motor 2 pin 1
- ENA connected to ESP32 pin D32
- IN1 connected to ESP32 pin D25
- IN2 connected to ESP32 pin D26
- IN3 connected to ESP32 pin D27
- IN4 connected to ESP32 pin D14
- ENB connected to ESP32 pin D33
DC Motor 1
- pin 1 connected to L298N DC motor driver OUT2
- pin 2 connected to L298N DC motor driver OUT1
DC Motor 2
- pin 1 connected to L298N DC motor driver OUT4
- pin 2 connected to L298N DC motor driver OUT3
ESP32 (30 pin)
- D32 connected to L298N DC motor driver ENA
- D25 connected to L298N DC motor driver IN1
- D26 connected to L298N DC motor driver IN2
- D27 connected to L298N DC motor driver IN3
- D14 connected to L298N DC motor driver IN4
- D33 connected to L298N DC motor driver ENB
- D34 connected to Servomotor SG90 1 SIG
- D35 connected to Servomotor SG90 2 SIG
- GND connected to Servomotor SG90 1 GND, Servomotor SG90 2 GND, I2C LCD 16x2 Screen GND, Pushbutton Pin 2, RFID-RC522 GND
- Vin connected to I2C LCD 16x2 Screen VCC (5V), Servomotor SG90 1 VCC, Servomotor SG90 2 VCC
- D23 connected to RFID-RC522 MOSI
- D22 connected to I2C LCD 16x2 Screen SCL
- D21 connected to I2C LCD 16x2 Screen SDA
- D19 connected to RFID-RC522 MISO
- D18 connected to RFID-RC522 SCK
- D5 connected to RFID-RC522 SDA
- D4 connected to RFID-RC522 RST
- D15 connected to Resistor pin1
- 3V3 connected to RFID-RC522 VCC (3.3V)
Servomotor SG90 1
- SIG connected to ESP32 pin D34
- VCC connected to ESP32 Vin
- GND connected to ESP32 GND
Servomotor SG90 2
- SIG connected to ESP32 pin D35
- VCC connected to ESP32 Vin
- GND connected to ESP32 GND
RFID-RC522
- VCC (3.3V) connected to ESP32 3V3
- RST connected to ESP32 D4
- GND connected to ESP32 GND
- IRQ not connected
- MISO connected to ESP32 D19
- MOSI connected to ESP32 D23
- SCK connected to ESP32 D18
- SDA connected to ESP32 D5
Pushbutton
- Pin 1 connected to Resistor pin2
- Pin 2 connected to ESP32 GND
Resistor
- pin1 connected to ESP32 D15
- pin2 connected to Pushbutton Pin 1
Battery 9V
- VCC connected to L298N DC motor driver 12V
- GND connected to L298N DC motor driver GND
I2C LCD 16x2 Screen
- SCL connected to ESP32 D22
- SDA connected to ESP32 D21
- VCC (5V) connected to ESP32 Vin
- GND connected to ESP32 GND
Documented Code
Since no code was provided, this section is left blank. Normally, this section would include the embedded code for the microcontroller, with comments explaining the functionality of each part of the code, including setup, main loop, and any functions or libraries used to control the components in the circuit.