🔧 How to Make a DIY 12V AC/DC Fan for 12V Battery Pack – Perfect for Home or Solar Projects!
by Jhuman in Circuits > Electronics
72 Views, 1 Favorites, 0 Comments
🔧 How to Make a DIY 12V AC/DC Fan for 12V Battery Pack – Perfect for Home or Solar Projects!

Are you looking for a way to run a fan from both AC and DC power sources? Whether you're off-grid, building a UPS fan system, or just want a cool DIY project, this 12V AC/DC Fan for 12V Battery Pack is the perfect build for you!
In this tutorial, I’ll walk you through the full process—from understanding the circuit diagram to assembling the components and powering your own dual-source fan. 💡
Supplies
Component List (Line by Line)
- LM2596 Buck Converter Module – 1 pc
- 1N5822 Schottky Diode – 3 pcs (D5, D6, D8)
- 1N5819 Diode – 1 pc (D3)
- 1N5408 High-Current Diode – 2 pcs (D1, D2)
- LED (Red) – 1 pc (for power indication)
- 1kΩ Resistor – 1 pc (for LED current limiting)
- 10kΩ Resistor – 1 pc (MOSFET gate pull-down)
- IRF9540N P-Channel MOSFET – 1 pc
- 880μH Inductor – 1 pc
- 220μF Capacitor (Electrolytic) – 2 pcs (C1, C2)
- Switch (SPST or jumper type) – 1 pc (manual control)
- 12V DC Fan (2-pin or 3-pin) – 1 pc
- Battery (12V Lead-Acid or Li-ion pack) – 1 pc
- Terminal Block (2-pin or 3-pin) – As needed for AC input, battery, and load
- Wires (AWG 20 or thicker) – As needed
- PCB or Perfboard – 1 pc (for assembly, optional)
- Heatsink (for LM2596 if needed) – Optional
- Soldering Iron and Solder – For connections
📋 Features
✅ Works with both AC and DC (Battery) power
✅ Ideal for UPS, solar, and emergency cooling systems
✅ Built-in switch for manual fan control
✅ Smart load switching based on power availability
🧠 Circuit Explanation (Step-by-Step)

Discover Easy, Affordable, and Reliable PCB manufacturing with JLCPCB!Register to get $70 New customer coupons:https://jlcpcb.com/?from=EST Special Deal: Get a $30 coupon for JLCPCB premium 6-layer PCBs: https://jlcpcb.com/6-layer-pcb?from=getcoupon
🔌 1. AC Input and Rectification
- D1 & D2 (1N5408): These diodes form a rectifier to allow AC to be safely converted to DC.
- C1 (220μF): Smooths out the ripples from the rectified voltage.
- LED1 + R3: Indicates AC power is ON.
🔋 2. DC Voltage Regulation
- LM2596 Buck Converter (X1):
- Converts high DC voltage (from rectified AC) down to a stable 12V.
- Pinout:
- VIN: Input Voltage
- GND: Ground
- OUTPUT: Regulated 12V Output
- ON/OFF & FB: Control and Feedback pins for operation
🔄 3. Auto Switching Control Logic
- D5 (1N5822): Allows current flow from the buck converter to the fan only when AC is present.
- D3 (1N5819): Prevents backflow from the battery when AC is ON.
- D6 (1N5822): Ensures one-way flow from battery to the MOSFET gate.
⚙️ 4. MOSFET Auto Switching
- Q2 (IRF9540N P-Channel MOSFET):
- Acts as an electronic switch to allow battery power to the fan when AC is off.
- Gate Control:
- R1 (10kΩ) pulls the gate high to keep the MOSFET OFF when not triggered.
- When AC is off, the gate is pulled LOW via D6, turning the MOSFET ON.
🌬️ 5. Fan Output
- Fan Output is connected to the drain of the MOSFET and receives power either from:
- AC Source (via Buck Converter and D5) when AC is available
- Battery (via D8 and MOSFET Q2) when AC is not available
📘 Step-by-Step Instructions
🧠 Step 1: Understanding the Circuit
The schematic (see image above) is designed to:
- Use AC power via diodes D1 and D2 for rectification.
- Store charge in capacitor C1 for smooth DC.
- Control the output through an LM2596 buck converter.
- Supply 12V to the fan with auto/manual switch-over using a MOSFET and diodes.
- Ensure backup battery kicks in when AC fails.
🔌 Step 2: Assemble the AC Input Section
- Connect P1 terminal to your AC adapter (12V transformer).
- Use D1 and D2 (1N5408) to rectify AC to DC.
- Solder C1 (220µF) to filter the DC signal.
⚙️ Step 3: Voltage Regulation
- Connect the rectified and filtered DC to LM2596.
- Set output voltage to 12V using the onboard potentiometer.
- Attach LED + resistor combo at the output to indicate power status.
🔄 Step 4: Battery Backup & Load Control
- Connect a 12V battery to the BAT connector.
- Use D3 (1N5819) and D5/D6/D8 (1N5822) for reverse polarity protection and voltage flow direction.
- The IRF9540N MOSFET acts as a switch, controlled by manual switch and auto logic from LM2596 output.
🌀 Step 5: Connect the Load (Fan)
- The LOAD terminal goes to your 12V fan.
- When AC power is available, the fan runs from AC.
- If AC fails, the fan automatically runs from the battery without any interruption.
🛠️ Testing the Circuit
- Connect a 12V fan to the load output.
- Supply 12V AC via a transformer or adapter.
- The fan should spin using the AC input.
- Disconnect AC to simulate a power cut—the battery should instantly take over.
💡 Applications
- Solar-powered fan systems
- Emergency cooling during power outages
- Smart fan system for battery packs
- DIY UPS system fan
📝 Notes
- Always test with a multimeter before powering your fan.
- Double-check polarity and diode directions.
- Use a heatsink for the LM2596 if your fan consumes high current (>1A).
- Add fuses or protection if deploying long-term.
🛠️ Assembly Tips
- Double-check diode polarity.
- Use heatsinks on the LM2596 if the fan draws high current.
- Test the output using a multimeter before connecting the fan.
🎥 Video Tutorial

Discover Easy, Affordable, and Reliable PCB manufacturing with JLCPCB!Register to get $70 New customer coupons:https://jlcpcb.com/?from=EST Special Deal: Get a $30 coupon for JLCPCB premium 6-layer PCBs: https://jlcpcb.com/6-layer-pcb?from=getcoupon
🔚 Final Thoughts
This project is a must-have for any DIY enthusiast working on battery systems or off-grid setups. With just a few inexpensive components, you can create a smart 12V AC/DC fan system that’s perfect for inverters, solar systems, or any power backup configuration.
If you liked this tutorial, please vote, like, and share it!