Skip to the content
2 layers135.5 × 100 mmVar Speed Fan With LED Strip, the printed circuit board in 3D

Desk fan with RGB Lighting controlled with ESP32 board

Size
135.5 × 100 mm
Copper layers
2
Thickness
1.6 mm
Parts
40
Nets
54
Pads
122
Tracks, vias
199, 19
Routed
Yes
KiCad
KiCad 8.0 (file 20240108)
Created
19 Jun 2024
Updated
7 Aug 2024

Overview

Var Speed Fan With LED Strip is an open-source printed circuit board by joshuawalker3, from the joshuawalker3/Var_Speed_Fan_With_LED_Strip repository on GitHub. It is a 2-layer board of 135.5 × 100 mm with 40 parts on 54 nets, routed with 199 tracks and 19 vias.

It is built around the PN2222A. Its parts include 15 resistors, 7 diodes, 5 switches, 3 transistors and 2 ICs. It belongs with the lEDs and displays boards and the ESP32 boards of this library.

Main components

1

README

README.md

Variable Speed Desk Fan with RGB LED for Use While Soldering

Final-Product

Project Overview

An annoyance I’ve had while soldering is that the fumes from the flux burning off tends to drift directly in my face and up my nose. To solve this issue, I made this desktop fan. The fan is actually a PC chassis fan and the LED strip is a cheap LED strip. Any strip will work as long as they have a 4 pin connection and are Common Anode.

Code

Overview

The code is written in C. No IDE was used, only sublime text editor (because it’s the superior text editor).

Overall, the code is pretty straightforward. After initializing structs representing a motor (the fan) and the LED strip, they are used to initialize their respective functions then the drivers for each are started as their own task so they can run in “parallel”. The drivers and related functions are contained in components so the code header can be linked when the ELF is built by the toolchain.

The fan is represented in the code as a Pulse Width Modulated (PWM) DC-motor. The struct is used to set up the PWM module and the GPIO pins for controlling motor speed. A 2-bit resolution for the PWM was chosen since I only desired to have three speeds for the fan: off, half-power, and full-power. The motor driver polls the GPIO pins and, when an input is detected, changes the motor speed accordingly.

The LED strip is controlled via signals from 3 GPIO pins, 1 for each color. The LED has two modes. The static mode where a chosen color is displayed indefinitely and the cycle mode where every color combination is cycled through sequentially. The LED driver polls two input pins. The first input pin cycles through colors sequentially and can cycle power to the LED if pressed for 1 second. The second input changes the LED mode.

Challenges and Lessons Learned

The biggest challenge with the code was figuring out the toolchain and how the build system works. A good chunk of time was spent trying to figure out how to integrate the header into the main code. The solution to this was obviously to RTFM. The biggest lesson learned was the value of structs. By putting all needed variables into pretty little structs, the code became easier to read as well as to write.

Chassis Design and Manufacture

Overview

The chassis was designed in FreeCAD, sliced using Ankermake default slicer, and printed on an Ankermake M5. It was printed as one solid piece. The chassis is simply a plastic base connected to a slot for the fan and slots for the LED strip and PCB. It was designed to be as compact as possible while maintaining stability.

FreeCAD Model

Model

Challenges and Lessons Learned

The main challenge with the chassis was getting it to print properly. Since that are parts that are “floating” while the print is in process, supports were required for the fan slot and the circular vertical hole. The print failed twice for what is suspected to be the same reason. The solution was to simply to slow the speeds down across the board for the entire print. This caused the print time to inflate from around 11 hours to 30 hours.

Failed Print

Print-Fail

Proper Print with Supports Connected

Good-Print

Final Print

Final-print

PCB Design

Overview

The PCB was designed using KiCAD and manufactured through PCBWay. I changed PCB manufacturers out of curiousity but could find no signifigance between PCBWay and Seeed Fusion.

Since the fan and LED strip require 12 VDC and the ESP32 requires between 3.3 – 6 VDC, the circuit is split by a buck converter that transforms 12VDC to8 around 5 VDC (I used 4.5 VDC). The PWM signal is sent directly from the ESP board to the fan. The LED strip interfaces to the ESP board via PN-2222A transistors.

PCB Schematic

Schematic

Circuit Prototype

Prototype

PCB Design

PCB-Design

I also added some components to aid in troubleshooting such as LED’s that indicate that power is being applied to the board when off, an indication the model is on, LED’s connected in parallel to each LED GPIO to show proper response, and an LED in parallel to the fan that shows the status of the fan since the LED will change brightness as the PWM signal, and therefore fan speed, changes.

Challenges and Lessons Learned

This was a big step for me in PCB design since it had more components than I had ever used before. This meant that I had to be creative with routing traces. To further remove trace clutter on the PCB, I added via’s so I could have traces on both the top and bottom of the PCB.

PCB Comparison Before and After Soldering Components

Top Bottom

PCB Mounted on Chassis

Mounted

Parts

40
QtyValueFootprintReferences
610KResistor_SMD:R_1206_3216Metric_Pad1.30x1.75mm_HandSolderR1, R2, R3, R4, R10, R11
5MountingHoleMountingHole:MountingHole_3.2mm_M3H1, H2, H3, H4, H5
4100Resistor_SMD:R_1206_3216Metric_Pad1.30x1.75mm_HandSolderR8, R9, R12, R13
3220Resistor_SMD:R_1206_3216Metric_Pad1.30x1.75mm_HandSolderR5, R6, R7
3PN2222APackage_TO_SOT_THT:TO-92_InlineQ1, Q2, Q3
21KResistor_SMD:R_1206_3216Metric_Pad1.30x1.75mm_HandSolderR14, R15
1104Capacitor_THT:C_Disc_D5.0mm_W2.5mm_P5.00mmC1
15VDC<-12VDCCustom:Buck_ConverterU1
1BLU_INDLED_SMD:LED_1206_3216Metric_Pad1.42x1.75mm_HandSolderD5
1Barrel_JackConnector_BarrelJack:BarrelJack_Wuerth_6941xx301002J1
1CYCLE_COLORCustom:SW_PUSH_6mmSW4
1CYCLE_MODECustom:SW_PUSH_6mmSW3
1ESP32-DEVKIT-V1Custom:MODULE_ESP32_DEVKIT_V1_NO_MOUNTU3
1Fan_4pinConnector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_VerticalM1
1GRN_INDLED_SMD:LED_1206_3216Metric_Pad1.42x1.75mm_HandSolderD4
1LED_AGRBConnector_PinHeader_2.54mm:PinHeader_1x04_P2.54mm_VerticalD1
1MOTOR_DECREASECustom:SW_PUSH_6mmSW1
1MOTOR_INCREASECustom:SW_PUSH_6mmSW2
1MOT_INDLED_SMD:LED_1206_3216Metric_Pad1.42x1.75mm_HandSolderD2
1OFF_INDLED_SMD:LED_1206_3216Metric_Pad1.42x1.75mm_HandSolderD6
1ON_INDLED_SMD:LED_1206_3216Metric_Pad1.42x1.75mm_HandSolderD7
1RED_INDLED_SMD:LED_1206_3216Metric_Pad1.42x1.75mm_HandSolderD3
1SW_Wuerth_450301014042Button_Switch_THT:SW_Slide-03_Wuerth-WS-SLTV_10x2.5x6.4_P2.54mmSW5

Similar boards

  • 2 layers152.4 × 101.6 mm8088-FE2010A SBC, the printed circuit board in 3D

    8088-FE2010A SBC

    skiselev/micro_8088

    Micro 8088 - IBM XT Compatible Processor Board based on Faraday FE2010 chipset

    72 parts412GPL-3.0
  • 2 layers33.7 × 66 mmSmartbell, the printed circuit board in 3D

    Smartbell

    Staacks/there.oughta.be

    Projects featured on my blog at https://there.oughta.be

    27 parts108GPL-3.0
  • 4 layers100 × 100 mm2063-Z80, the printed circuit board in 3D

    2063-Z80

    Z80-Retro/2063-Z80

    Retro Z80 CPU Board

    86 parts96
  • 2 layers30.7 × 76.1 mmRepeater v2, the printed circuit board in 3D

    Repeater v2

    plusvic/simplebus2-intercom

    General description of the Simplebus2 protocol used by some Comelit's intercoms. Hardware for retransmitting Simplebus2 messages over UART.

    17 parts95CC0-1.0
  • 2 layers28.8 × 43.8 mmAdv pcb, the printed circuit board in 3D

    Adv pcb

    Vail-CW/vail-adapter

    Adapter for cw morse keys to USB

    13 parts81MIT
  • 2 layers23.2 × 52.1 mmOpenC64Saver, the printed circuit board in 3D

    OpenC64Saver

    SukkoPera/OpenC64Saver

    Protect your Commodore 64 from killer power supplies!

    17 parts79
  • 4 layers184.2 × 169.5 mmSB mini II, the printed circuit board in 3D

    SB mini II

    simonboak/SB-mini-II

    A homebrewed Apple II clone

    97 parts76MIT
  • 2 layers49.5 × 30 mmAirpcb smd old, the printed circuit board in 3D

    Airpcb smd old

    issalig/toshiba_air_cond

    AB protocol decoder for toshiba air conditioners

    30 parts65

Questions

How big is the Var Speed Fan With LED Strip PCB?

It measures 135.5 × 100 mm and has 2 copper layers, 1.6 mm thick.

What parts does the Var Speed Fan With LED Strip use?

40 parts, built around the PN2222A. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Var Speed Fan With LED Strip KiCad files?

From the joshuawalker3/Var_Speed_Fan_With_LED_Strip repository on GitHub, at the commit this page was made from: the board is Electronics/Electronics.kicad_pcb and its schematic Electronics/Electronics.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Var Speed Fan With LED Strip design in my own project?

Its repository states no licence, so its author keeps all rights: ask joshuawalker3 before reusing the design.