Desktop Fan - USB-Wind Blower With Unnecessary But Awesome Features

by kilianklepper in Circuits > Gadgets

5621 Views, 104 Favorites, 0 Comments

Desktop Fan - USB-Wind Blower With Unnecessary But Awesome Features

produkt_close.jpeg
produkt.jpeg

Hot summer days can make your workspace unbearable, but there's an easy solution:

A little desktop fan! Instead of buying a new one, why not repurpose an old PC fan you have lying around? With a bit of creativity and some electronics know-how, you can transform that old fan into a USB-powered wind blower with some fun and unnecessary (but awesome) features.

Not only will it keep you cool, but it’s also a great way to recycle and tinker with some basic electronics.

Let's dive in and build something cool, literally!

Supplies

Parts.jpeg

Before we dive into the build, let's gather everything we'll need. Below is a list of materials and tools for this project. Make sure you have everything on hand before starting to avoid interruptions.


Materials:

  1. Old PC Fan (12V, 120x120x25mm)
  2. Boost Converter Module (DC-DC Step-Up, XL6009)
  3. Temperature Sensor (AZDelivery DS18B20 Digital)
  4. OLED Display (0.91" I2C Display Module, 128x32, 3.3V/5V)
  5. Microcontroller (ESP32S3)
  6. Potentiometer (10k)
  7. Rocker Switch (SPST, SW-R3-1A-A-1-0)
  8. Resistors (Different Values, SMD or THT)
  9. Enclosure for the Fan (could be 3D printed or repurposed)
  10. Wires and Connectors


Tools:

  1. Soldering Iron and Solder
  2. Screwdrivers, Allen Key
  3. Wire Cutters and Strippers
  4. Multimeter
  5. Hot Glue Gun
  6. 3D Printer

Electronics

schematics.png

Before jumping into the assembly, let’s take a closer look at the electronics setup and how everything is connected. Below is a high-level explanation of the circuit, along with a schematic to visualize the wiring.


Power Supply (via USB-C):

The ESP32S3 has a built-in USB connector, which provides 5V power. A rocker switch is placed between the USB’s 5V line and the input of the boost converter, allowing you to turn the fan on and off. The GND line goes directly through to all components.


Boost Converter (XL6009):

The boost converter steps up the USB's 5V to a higher voltage (between 5V and 20V), which powers the fan. This voltage is adjusted using a 10k potentiometer. The potentiometer allows manual control over the fan speed by varying the voltage supplied to the fan.


Fan Connection:

The fan is connected to the output of the boost converter, receiving the adjusted stepped-up voltage.


Speed Measurement (R2 / R3):

A voltage divider is connected across the output of the boost converter. The divided voltage is sent to one of the analog inputs of the ESP32S3, enabling the microcontroller to measure the voltage and thus estimate the fan speed in percent.


Temperature Sensor (DS18B20 + R1):

The temperature sensor is connected to the ESP32S3 using the one-wire protocol. It measures the ambient temperature, which will be displayed.


OLED Display (0.91" I2C):

The OLED display is connected to the ESP32S3 using the SPI interface. It shows both the current temperature and the voltage output (which relates to the fan speed). Power and ground are connected directly to the ESP32S3.

Modifying the Boost Converter

boost.png

In this step, we’ll modify the boost converter (XL6009) to allow adjustable output voltage using a different potentiometer.

The boost converter works by comparing the output voltage to a reference voltage (1.25V), and adjusting the output accordingly. To achieve this, a voltage divider is used between the output voltage and the feedback pin of the converter.

Here’s the process to modify the boost converter so that you can adjust the output voltage between 5V and 20V using a 10k potentiometer.

How the Feedback Circuit Works:

  1. Feedback Reference Voltage (V_ref): The XL6009’s controller uses a feedback voltage reference of 1.25V. It adjusts the output voltage until the voltage at the feedback pin reaches 1.25V.
  2. Voltage Divider: The output voltage is divided down by two resistors: the potentiometer (Ra) and a second resistor (Rb). The ratio of these resistors determines the output voltage.

The output voltage VoutV_{out}Vout​ can be calculated using the formula:

Vout = Vref × (1 + (Ra / Rb))

Where:

  1. Vref is the reference voltage (1.25V)
  2. Ra is the variable resistance of the potentiometer (0 to 10kΩ)
  3. Rb is a fixed resistor

We want the output voltage to be adjustable between 5V and 20V.

After some calculations, we come to the conclusion to look for a value between 470Ω and 1kΩ.

I used Rb: 660Ω

Voltage Divider for Measuring Fan Speed

schematics.png
boost_divider.png
Boost.jpeg

To measure the output voltage of the boost converter (which indicates the fan speed) using the ESP32S3's analog input, we need to scale down the voltage to a safe level. The maximum voltage the ESP32S3’s analog input can handle is 3.3V, while the boost converter output can go up to 20V.

We can achieve this using a voltage divider, which reduces the voltage proportionally to a safe level. The voltage divider consists of two resistors, R2 and R3, arranged in series.


The output voltage from the divider Vout is given by the formula:

Vout = Vin × (R3 / (R2+R3))

With:

Vin(max)​ = 25V (give some some overhead)

Vout(max) = 3.3V


Again, after some calculations I came up with:

R2 = 20k

R3 = 3.3k


This gives me a following voltage level at the MCU ADC Pin (measured with an multimeter):

Fan Voltage: 22V = MCU Voltage: 3.10V

Fan Voltage: 4.5V = MCU Voltage: 0.66V

Designing the Housing

housing.png

Now that we have the electronics sorted out, it’s time to design a functional and cool enclosure to house everything.

If you have access to a 3D printer, you can create a custom-fit enclosure as I did, or try mine.


Optional:

Include a grill or guard on the front of the fan to protect it from dust and foreign objects.

Software

software.png
ESP32.png
JSON-Link.png
selectboard.png

In this step, we’ll take a closer look at the software that runs your DIY desktop fan project. The program is written in Arduino C++ and is designed to manage the fan's operation, control the display, read temperature data, and calculate fan speed based on the boost converter voltage.


Installing ESP32 Arduino on Arduino IDE:

  1. Check Supported SoCs
  2. Copy the Development release link [https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json]
  3. Go to Arduino IDE > Preferences > Additional Boards Manager URLs and paste the JSON link
  4. Go to Tools > Boards > Boards Manager > Search ESP32 > Install the latest version
  5. Plug in the USB cable to USB port of the dev board
  6. Check the board can be detected on the computer with the dropdown menu of Select Board
  7. You are now ready to go


Software:

The libraries are necessary to interact with the temperature sensor (DS18B20) and the OLED display (SSD1306). Which are then defined in pinout, size and address. Which is followed by initialize the OLED display and create instances for both OneWire (for communication) and DallasTemperature (for reading temperature data).

After some variables, you can put in your setup for the boost converter. These values represent the voltage divider resistors that scale down the boost converter's output voltage and define the voltage range for the fan (4V to 22V), allowing the software to calculate the fan speed.

  1. float getTemperature() requests and retrieves the current temperature from the DS18B20 sensor
  2. float getBoostVoltag(float lastValue) retrieves a stable boost converter voltage
  3. int mapFanPower(...) maps the boost converter voltage to a fan power percentage


void setup()

Arduino requires the setup() function which initializes the temperature sensor, the serial connection, and the OLED display in this case. The display shows a simple "Desktop Fan" message as a startup test.


void loop()

It is followed by the loop() functions. This is where the controller will handle the functions of the project. The loop means, that everything inhere will be executed over and over again. In this case:

The loop() function handles the real-time updates:

  1. It reads the temperature and boost converter voltage.
  2. Updates the fan state based on the voltage.
  3. Maps the voltage to a fan power percentage.
  4. Displays the data on the OLED and outputs it to the serial monitor.

Downloads

Final Assembly

Backside.jpeg

With all the individual components—electronics, housing, and software—complete, the final step is assembling everything together. Hot glue is your friend here :D

Mount the Fan:

  1. Secure the fan inside the housing. Ensure it's tightly held to minimize vibration, but leave enough room for airflow. Use screws or brackets as needed.

Install the Electronics:

  1. Solder the connections for the temperature sensor, OLED display, potentiometer, and rocker switch.
  2. Place the boost converter, ESP32S3 microcontroller, and other components inside the housing. Route the wires neatly and ensure they won’t interfere with the fan's operation.

Secure the OLED Display and Controls:

  1. Mount the OLED display in the housing so that it’s visible.
  2. Attach the potentiometer knob for fan speed control and install the rocker switch for powering the fan on and off.

Wire Management:

  1. Ensure all wiring is securely fastened and doesn’t obstruct airflow. Use hot glue, zip ties, or wire clips to hold everything in place.

Connect Power:

  1. Connect the USB cable to the ESP32S3’s USB port for power. Make sure the USB port is accessible from the outside of the housing.

Test the Fan:

  1. Power up the system and test it. The fan should start spinning, and the display should show the temperature and fan speed percentage. Check if the potentiometer adjusts the fan speed as expected.


Future Enhancements:

  1. Since the ESP32S3 has built-in Wi-Fi and Bluetooth capabilities, you could add remote control functionality
  2. consider adding RGB LEDs
  3. Expand the project by integrating more sensors like humidity or air quality sensors
  4. Show more details on the display like the current time


By following these steps, your desktop fan will not only help you stay cool but also serve as a platform for future projects, allowing you to keep adding features and enhancing its functionality!