Introduction: ESP8266 POV Fan With Clock and Web Page Text Update

About: Works with Arduino, RaspberryPi, Banana Pi, Orange Pi, STM32F103C, ESP8266,

This is a variable speed, POV (Persistence Of Vision), Fan that intermittently displays the time, and two text messages that can be updated "on the fly."

The POV Fan is also a single page web server that allows you to change the two text messages.

To use this POV Fan, there must be a wireless network with "client sharing". If you don't know what client sharing is, it's easy to find out. Look for other computers on your network. If you can see them, you have client sharing capabilities on your network. (Most hotels and public venues don't allow client sharing--client isolation-- for obvious security reasons.)

The POV uses the "WifiManager" library which makes it easy to connect to the wireless network wherever you may be. Once connected to the wireless network, the POV Fan will display the IP address you need to put in your web browser address bar. You can change the text in the POV Fan via the web page.

This instructable is a little bit above the novice level. There is some soldering, drilling, "hot glue-gunning", and electrical testing involved. If you think that your mom will be upset that you tore her favorite fan apart, and endangered your household by exposed electricity, maybe you ought to do something different, otherwise read-on.



  • ESP8266---This can be a NodeMCU VIN5v--3.3Logic, Super Node VIN3.3v, Weemos VIN5v--3.3Logic, Adafruit Huzzah VIN5v-3.3Logic Sparkfun Thing VIN5v--3.3Logic, or bare ESP8266 VIN3.3v (as long as you can program it. I don't go into detail of setting up a programming board for a bare ESP8266, so the USB capable boards mentioned may be easiest.) Note the requirements necessary in the picture above.
  • AMS1117-3.3v and 10k resistor (for 3.3v boards)-- This is a 3.3v power regulator. Note the above, aforementioned options of ESP devices and the voltages listed next to them. If you have a VIN 3.3volt system, the AMS1117-3.3v is necessary. The bare ESP8266 is 3.3v.
  • Hall Sensor and 10k resistor--- I use the 3144 variety. Although they are rated for 4.5v and up, I've had great results with the 3.3v rail. I use a 10k resistor to reset the trigger by "leaking" the voltage back out (pull default low).
  • (5) LEDs (and optional resistors)--- Use whatever you can find. The ratings for an LED demand a resistor to keep a steady current from free-flowing through the LED and being similar to a short circuit. Note the LED data pages with the rating for SUSTAINED power. For "Pulse Width Modulation, PWM" or rapid flashing, the LEDs can withstand a little variance in the voltage so the resistor is optional in a 3.3v system. I like the superbright white 3mm or 5mm, ~3.4v @ 20mA. If you use a red LED, be aware that the voltage ratings may be significantly lower, 1.8v @ 20mA, so resistors may be a good precaution.(voltage_rail - LED_voltage) / Amperes = resistance needed. ie, (3.3v-1.8vLED=1.5v) divided by .02A or 20mA = 75 Ohms resistor recomended.(Note: The best resistor tutorial I remember is from a Raspbery Pi tutorial I was watching-- at roughly the 2:40 mark-- It's a great learning epiphany! I drew the circle above for reference.)
  • Cheap 5v wall charger--- I used an old one from a phone. We're going to crack it open and throw solder to it. A cheap one from a Dollar Store would be adequate.
  • Wireless Charging Coils--- I use something like this, or this. It's small but very effective. The ESP8266 uses somewhere around 300mA when transmitting wirelessly. Bigger isn't necessary-- just more expensive. ... besides, a capcitor in line with the DC voltage will steady the load when demand is higher.
  • 100uF 16v Electrolytic Capacitor-- The voltage will need to be at least 5v. Anything over 5v will be fine. A 16v cap is overkill, but also cheap and easy to find.
  • Magnet-- I had a couple of neodymium magnets lying around, but any magnet should work.
  • Fan-- I used a cheap box fan from the local store for $12-$18 during the summer season. The styles and sizes are unlimited with an exception of hardware room. The bigger the fan, the easier it is to squeeze in the hardware. Too small a fan will look more, "Ghetto Frankenstein," while hardware is being mounted on the outside. Note that this fan has the necessary windings for the fan speed control to work.
  • Fan Speed Control (Optional)-- This is different than a wall switch- incandescent light dimmer. Fan speed controls change wavelengths of the electricity to optimize the inductance driving inside an AC motor. Find the correct fan speed controller for your fan. If not using a fan speed controller, You have to switch the power to the 5V rail on separately. --Some may prefer this as it allows you to turn off the POV, and continue using the fan.
  • Shrink Tubing-- and/or wire insulator of choice. I've seen really thick paint, silicon caulking, electric tape, and hot glue used as wire insulation. On the rotating parts, it is important to keep the weight down.
  • Super-Glue-- Super Glue is lighter than Hot Glue, and helps keep the weight down on rotating parts.
  • The smallest and lightest insulated wire you can find. (phone cord wire, ethernet cable wire, salvaged ATA bus HDD ribbon, ...)


  • Safety First-- Some safety glasses are always good. Don't get that little bit in your eye on this project.
  • Leather gloves -- You should always wear leather gloves when drilling anything. Cloth gloves can unravel and get caught in a drill bit easily, snapping and breaking fingers and/or the drill bit.
  • Soldering Iron, flux, and solder
  • Drill and/or Dremel
  • Wire Cutters and Wire Strippers
  • Hot Glue Gun-- My Daughter is the "Hot Glue Gun Ninja." I think she can literally repair anything with it.
  • Screw Driver-- To take the fan apart.
  • Electric tester
  • Sandpaper -- If you have a nail file, that's fine. We just need to rough up the LEDs so they are more opaque. Superglue and baking soda works just as well.

Step 1: Your POV Needs Power-- There Are Options

There are two options for powering the POV part of the fan. You may want to have the POV to turn on with the fan by default, or you may want to turn on the POV only sometimes.

OPTION 1is to not use the variable speed controller at all. Just branch the power coming into the fan to a separate switch that turns on the POV. This is self explanatory. This may be a better option for smaller fans that don't have much room inside the housing for the variable speed controller.

OPTION 2 is to replace the three speed switch with a variable speed controller. Use the power after the speed controller to turn on the POV any time the fan is on. This WILL DEDICATE your fan as a POV sign. This may be what you want if you don't want everyone borrowing your hard effort all the time for cooling off a room while they sleep. I used this option in the box fan depicted above.

I guess there IS a third option. You could do both, branch the POV power from the incoming power line to a switch, AND use a variable speed controller just to have better control of the fan speed.

Step 2: Using the Variable Speed Controller

Before you do anything, plug your fan into the wall and turn the fan to its highest setting. Once the fan's highest setting is set, jerk the plug from the wall. Leave the switch in the highest position and pull the knob off. This will help us find the correct wire for the Fan Speed Controller.

Variable Speed Controllers need to have the fan set at the highest speed. A typical box fan switch (the original switch you will be replacing) has one wire coming from the power source (wall outlet end), and three wires going to different parts of the winding in the fan motor. One of the three wires between the switch and the fan motor turns the fan to its highest setting. You need to find which wire is the highest fan speed setting and label it. The other two wires will be unnecessary and can be insulated and/or capped. Now, you can replace the three speed switch with the variable speed controller using the labelled wire.

Some fans may have a small white box adjacent to the switch. Don't mess with it. It is most likely the capacitor and thermal sensor that drives the fan.

I wanted to change this fan's switch for a long time now because our adopted stray dog chewed the knob and switch to the nub you see in the picture above. My fan took a No 2 phillip's head screwdriver to easily remove the front grill from the fan. Once the grill was pulled, I could easily get to the switch. I labeled the wires like the picture above to keep them organized. I put a stripe on the Neutral, "N," line and dotted the other lines.

Once you have the wires labeled, you can cut the switch out. Use an Ohm Meter to see which wire goes to the motor's highest speed winding. Mine was the No.1 wire.

Step 3: Breadboard Your ESP8266 (Optional)

OK, I like to breadboard my projects just to make sure they don't have any surprises. I put all of my stuff onto a breadboard and run it.

ESP-12F The first three illustrations above are the bare ESP-12F pins. The first illustration is for programming the board. The second illustration is only the fan connections. You can use both, or just program it and put the second attachments alone.

Super Node The fourth and fifth illustration uses the Super Node board. You can just program this board as well and eliminate a couple switches and an FTDI on the fan. Note that I didn't put the needed capacitor in the illustration. You will still need one for steady power.

NodeMCU The third option is super-simple. Use a NodeMCU or equivalent (Huzzah Feather, Weemos, Sparkfun Thing,...) and eliminate all of the switches and 3.3v regulators. The difference is the cost of the NodeMCU, which is nearly three to four times the cost of a bare ESP-12F.

Step 4: Program the ESP8266

Let's look at the code.

There are a few libraries required in this sketch. These will be needed in your Arduino IDE.
Most of them can be added from the "Libraries Manager" in the Arduino IDE. Go to your Arduino IDE, and open "Tools >> Library Manger". The Most important one is the WifiManager from tzapu.

#include  <ESP8266Wifi.h>       //
#include  <TimeLib.h>
#include <DNSServer.h>
#include <ESP8266WebServer.h>
#include  <WifiManager.h>         //
ESP8266WebServer server(80);
#include <WifiUDP.h>;

Notice that there is a ton of comments in the code so it can be easily followed.

I have also changed a number of lines from using plain Wifi connection to the more dynamic WifiManager. I left the static ip connection lines, but commented them out. Also, I have the NTP server accessed every 24 hours rather than accessing the server every loop. Your NTP server will block you like a TSR Virus if you access it too often.

It may look a little messy with all of the extra code commented out. Feel free to delete the commented out code. I left it in there for options.

I will make mention of the most important lines.

On Line 42 the "hall_interval" is declared. The hall interval is the time between the text message switching. It is set at 10 seconds. Every ten seconds, the hall sensor reads the rotation speed of the fan and adjusts the text accordingly. It also switches between the time, text 1 and text 2. This can be changed to your liking.

On line 52, you may want to change the NTP server from which you will connect and get your time.

Credit should be given where credit is due! I created my first POV using an Altoids Tin, an ATTiny85, and some phone cord. On Line 131 I mention the original source for the POV lettering concept. I have changed the code quite significantly to be more efficient for this project, but it wouldn't have come to exist without this start.

On Lines 291-365 the web page with the jquery libraries are induced. The Ajax libraries are brought from an external resource, so it may be best to make sure that they are up to date.

On Line 498 the WifiManager password should be changed to reflect what you want it to be. This is the password that is needed to set up the POV Fan the first time only.

Feel free to browse through the rest of the code. If you are in the bread boarding mode, you can uncomment the Serial feedback lines for debugging.

Once you have uploaded the sketch to your ESP8266, you should see another Wifi Access Point on your phone or laptop called POV_Fan. Connect to it, open a web browser and type the IP address in the address bar "". You should be able to connect your fan to your home network Wifi router. You will lose connection with the POV_Fan. Don't panic. Wave a magnet back and forth over the hall sensor-- front to back. Your POV_Fan will be connecting to the NTP server and getting the time (It may take a minute). You should see the LEDs flashing.

Step 5: Get Ready to Make Your Frankenstein!

Put it all together, yeah!!!!!

Get your creative juices going for this part. When you removed the front grill of your fan, you probably noticed that there isn't much space between the front of the fan blades assembly and the grill. The first photo included above shows a fan with a Nut holding the blade on the motor spindle. The second photo shows a fan with a molded fan blade to the spindle.

I was able to remove the blade assembly with the nut and use all of the empty space behind the blades as well--very nice! I should have done more. I used a Super Node, so I had to put all of the other components surrounding the spindle.

The second set of blades was difficult because the center spindle was so close to the grill. I had to recess some components. I wish I had just used the outer edge of the inner blade assembly to place the components instead of trying to use the front. I used an ESP-12F which was a bit smaller though. It works well. I also included the components for programming so I could tweek it later if I choose.

Rules of Engagement

  • Try to consider the balance of the fan. Place a counterbalancing component to the LEDs and Hall Sensor. If you find that your fan vibrates too much, use something to counterweight the blades ( a small screw, some tape, hot-glue globs, whatever...).
  • The further from the center of the fan, the more centrifugal force will be on the component. Secure them well.

Step 6: Secure Your LEDs and Your Hall Sensor

To solder the LEDs together, I used a 1/4 drill bit and measured on a straight line 1.5cm in a 2x4 board. The LEDs sat in them and I was easily able to solder them in an array. I think 1 cm would be better as the letters tend to be very tall and stretched out at 1.5cm.

Measure your blade and use a 3/16 inch bit to drill the holes. The LEDs should fit very tightly into the holes and be very secure. Use sandpaper on the front the LEDs to make the light diffuse better. I like to also use superglue and baking soda to glue the LEDs into place and create better diffusion of light. Superglue is also lightweight by comparison to Hot Glue.

On the other end of the fan assembly, drill or dremel three small holes for your hall sensor. Notice in the picture that the hall sensor is perpendicular to the blade travel. Once again, secure your wires well. Pass them through holes in the blade assembly for stability.

Step 7: Solder the Final Product

Place your coils as close as possible without touching. A pair of snips to an old CDROM is a good spacer if you need to shim the coils. Since the coils are in the middle of the spinning fan blade assembly, there isn't too much centrifugal force. You can Hot Glue with confidence.

I used a USB cable (cheap one, not your nice programming one) to power the coil on the grill. Remember, the power lines to a standard four wire USB cable are Red and Black. The White and Green lines are digital lines.

Finalize your soldering. Since I bread boarded mine, I just install one component at a time. Take your time. Make sure the LEDs are attached in the correct order. The No. 1 LED should be the outermost.

When you are finished soldering, place a magnet in the path of the hall sensor. You want it to be as close the the hall sensor as possible during rotation without hitting it.

Step 8: Fire It Up

Once your Fan is complete, fire it up!

If you have already set up your fan to the Wifi, you should see the IP address in the fan POV. It may take a minute to connect to the Wifi. Go to a web browser and type the IP address into the address bar. The text will magically change to the two texts that you typed.