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

ESP8266-Controlled Dual Gearmotor System with L298N Driver and Ultrasonic Sensing

View and Edit Project In Cirkit DesignerImage of ESP8266-Controlled Dual Gearmotor System with L298N Driver and Ultrasonic Sensing

Circuit Documentation

Summary

The circuit in question is designed to control multiple DC gearmotors using an L298N DC motor driver, which is interfaced with an ESP8266 NodeMCU microcontroller. The circuit also includes an HC-SR04 Ultrasonic Sensor for distance measurement and is powered by an 18650 Li-Ion battery. The ESP8266 NodeMCU is responsible for controlling the motor driver inputs to manipulate the motor speeds and directions, as well as reading the ultrasonic sensor for distance sensing.

Component List

Gearmotor DC / Motorreductor

18650 Li-Ion Battery

L298N DC Motor Driver

ESP8266 NodeMCU

HC-SR04 Ultrasonic Sensor

Wiring Details

Gearmotor DC / Motorreductor

18650 Li-Ion Battery

L298N DC Motor Driver

ESP8266 NodeMCU

HC-SR04 Ultrasonic Sensor

Documented Code

ESP8266 NodeMCU - sketch.ino

void setup() {
  // put your setup code here, to run once:

}

void loop() {
  // put your main code here, to run repeatedly:

}

This is the basic structure of an Arduino sketch for the ESP8266 NodeMCU. The setup() function is called once when the microcontroller is powered on or reset. It is used to initialize the pins and set up the communication protocols. The loop() function is called repeatedly and contains the main logic of the program. This is where the code to control the motor driver and read the ultrasonic sensor would be implemented.