Back to Basics: Wireless DC Fan Motor Control Using 2 X ESP32 Boards
by Penguingineer in Circuits > Arduino
329 Views, 2 Favorites, 0 Comments
Back to Basics: Wireless DC Fan Motor Control Using 2 X ESP32 Boards

In this tutorial, I share an easy circuit and code for wirelessly controlling a DC fan motor using 2 x ESP32 development boards using a single-axis joystick! Programmed used the Arduino IDE and utilizing ESP-NOW wireless communication, this low-cost project is perfect for learning Arduino, ESP32, and motor control. The fundamentals and skills developed by this project include:
- Basic, safe, low-voltage wiring
- Reading from a single-axis joystick (potentiometer)
- DC motor control
- ESP32 wireless communication
This simple circuit could be expanded for more complex projects, such as:
- Controlling 2 x fan motors for steering a hovercraft
- Building a battery-powered fan to stay cool during the summer
- Wireless control of fans to cool an enclosure (e.g. for a PC)
- And, the fan can be swapped out for a simple wheel for controlling an RC car!
Note: Some of the links in this article are affiliate links. This means that, at zero cost to you, if you click through the link and make a purchase, I will receive a commission.
Supplies
- 2 x ESP32-WROOM development board
- 1 x Single-axis joystick
- 1 x DC motor
- 1 x Fan/propeller
- 1 x MicroBots DriveCell motor driver (alternative generic driver from Amazon)
- 2 x 830-point solderless breadboard
- 1 x Assorted 22 AWG solid-core hookup wire
- 1 x 5VDC Power supply
- 1 x Assorted hook test clip wires
- 1 x Snips
- 1 x Wire stripper
- 1 x Soldering iron (if needed)
Circuit and Breadboard Wiring
.png)
The wiring diagram for this project was made using Cirkit Designer, available for download here. To assemble the breadboard circuit:
- Assemble the 2 x 830-point solderless breadboards side by side.
- Connect the 2 x ESP32 development boards, DC motor, H-bridge driver and single axis joystick to the solderless breadboard.
- Cut and strip 22 gauge (AWG) hookup wire, and connect all the components according to the wiring diagram above. It is helpful to stay consistent with the wire colors. For example, 5VDC (power) and ground wires should all be the same color. Take care not to bridge/short power and ground wires, or the components in your circuit may be damaged.
- Add the hook test clip wires to the 5VDC power supply, but don't plug the power supply into a wall outlet yet.
- Double check all your wiring to ensure it matches the wiring diagram, and then plug in the 5VDC power supply to power on the circuit. The on-board red LED on each ESP32 development board will light up if they are correctly powered on.
Programming


ESP32 development boards such as these can be programmed like any other Arduino-brand board. Here is a great video reference giving an overview for setting up the Arduino IDE to use it with ESP32 boards:
Open the ESP32_Motor_Sendor.ino file below, and upload it to the ESP32 board that is connected to the single-axis joystick. Similarly, open and upload the ESP32-Motor_Receiver.ino file below to the ESP32 board that is connected to the fan.
Power on both units, and after the two boards have established an ESP-NOW wireless connection between them, you can use the single-axis joystick to control the speed of the fan!
Demonstration

Here is a YouTube video demonstrating wireless ESP-NOW control of the DC fan motor, in both the forward and reverse directions using the single-axis joystick!
Conclusion + Next Steps
This project successfully demonstrated:
- Reading from a single-axis joystick (spring-loaded potentiometer)
- ESP-NOW wireless communication
- Using the received signal with a DriveCell motor driver to control a geared DC fan motor
Check out my other Instructables articles:
- ESP32 + BaseCam Bluetooth Gimbal Control
- Single-Axis Joystick Controller Module Using Arduino
- Accuracy-Sensing Smart Sports Rebounder With ESP32
- EMT Conduit-Mounted Weather Station Wind Sensors
- Telescoping EMT Conduit Pole Extension Sensing Methods + Photoresistor Implementation
- Force-Sensing Telescoping EMT Conduit Pole
- Jumbo-Sized Telescoping Light Painter Made from EMT (Electrical) Conduit
- Homemade/DIY Telescoping Pole From EMT (Electrical) Conduit
Thanks for reading!
Austin Allen
Founder and Owner
Elation Sports Technologies LLC