Introduction: Wireless Fan Fully Controlled Using Your Phone!
In this project, we will be creating a wireless fan that you can fully control using your phone over WiFi. You can rotate it left and right, tilt it up and down, and choose the fan speed and rotation speed. We will be using the ESP32 with a desktop PC fan and a couple of motors to achieve this very easily. I have made a video that goes over the whole project and explains each step very clearly. So if you want a video version, I highly recommend watching the video as it is much easier to follow. Let's get to it!
Here is a list of all the components that are needed for this project:
- 140mm fan, I am using the Noctua NF-A14. I suggest getting one with as high as possible RPM. The fan used here has 3000 RPM.
- Nema 17 stepper motor, for the rotation of the fan.
- A4988 stepper motor driver, to drive and control the stepper motor.
- DS04-NFC servo motor, this is for the tilt motion.
- ESP32, as the micro-controller, it has built-in WiFi, which is needed for the wireless connectivity.
- 12 volts power supply that can deliver 5 amps of current. I used a mains power cable with a power jack DC cable.
- LM2596 buck converter, to step down the 12v to 5v, as the servo and micro-controller operate on 5v. The 12v is needed for the fan and the stepper motor.
- 100uF capacitor, this is used to filter the power supply of any voltage spikes.
- 2 switches.
Step 1: Breadboard Wiring
The first step is to wire everything together on a breadboard. Follow the wiring diagram and carefully connect everything together.
Step 2: Phone Setup (Blynk)
To control the fan wiressly using the phone, we will be using Blynk. It is a very easy to use platform that allows you to control Arduino boards from your phone using WiFi. First you need to install the Blynk app on your phone.
Step 3: Create a New Blynk Project
Once the Blynk app is installed on your phone.
- Create a new project.
- Choose a project name.
- Choose the "ESP32 Dev Board" as the device.
- Select Wi-Fi as the connection type.
Step 4: Add All the Widgets
Insert the same widgets as you see in the image, and ensure all the virtual pins matches with the image.
- You will need two buttons for the tilt up and down.
- A slider for the fan speed. Ensure the slider range is from 0 to 4095.
- A button to toggle auto mode on and off. Ensure it is a switch and not a push button.
- Another slider for the rotation speed. Ensure the slider range is from 50 to 300.
- Two buttons to turn the fan left and right.
- Two final buttons to set the start and end positions of the rotation.
Remember that all virtual pins need to match to what you see in the image.
Once all these widgets are added, go to the project settings and make sure the "Notify devices when app connected" is switched on.
Step 5: Arduino Sketch
All these libraries can be easily installed using the Arduino IDE library manager.
- Blynk by Volodymyr Shymanskyy.
- ESP32Servo by Kevin Harrington and John K. Bennett.
Get the Arduino sketch from this repository.
There are only 3 variables that you need to change in the sketch:
- auth which is the Blynk authentication code that you receive by email when you create the project on the Blynk app on the phone.
- ssid your WiFi name.
- pass your WiFi password.
Once you have made these changes, upload the sketch to the ESP32.
Step 6: Breadboard Demo/testing
Once the code is uploaded and everything is connected on the breadboard. Connect the power and turn it on using the switch.
You now can open the Blynk app you created and connect to the ESP32.
Once you are connected, you will be able to use all the widgets and control the fan!
Step 7: Stripboard Version
Once you have confirmed that everything is working properly on the breadboard version. You can create a stripboard version. This will make it have a much smaller footprint and very easy to use, as all you need is to just connect the components to the stripboard and not worry about having wires everywhere.
Step 8: 3D Printing!
If you have a 3D printer. You can download all the 3D models here.
Print all the parts.
For the motor shaft connector, top part, and the left fan attachment, use 3mm threaded insert nuts in the holes for extra stability.
Assemble the fan as you can see from the photo.
Step 9: Done!
You have now created your own wireless fan! Which you can easily control using your phone.
I highly recommend watching the video if anything is not clear, and also remember to subscribe if you enjoyed or found this project/video useful!
Participated in the