I'm making a solder fume extractor from an old PC fan (4-pin PWM), driven by a mid-range PIC.

The fan needs 12V @ max 0.28A for power and a 5V PWM @ max 5mA to control the RPM. So I'll be running the PIC at 5V and therefore I will need both 5V and 12V available. I assume the PIC won't consume much power compared to the fan, even though I plan to have an IR proximity sensor too so I can ramp up the fan speed when my hands move towards whatever I'm soldering and then ramp down again when I'm done.

I haven't yet decided whether to use a wall wart or batteries, but would like to know the pros and cons of the available options.

So, as an example, I assume I could power the system with a 5V wall wart and use a DC boost converter to get the 12V for the fan.

Or, I could power the system with a 12V wall wart and use a DC buck converter to get 5V for the PIC etc.

Apart from the cost and availability of parts, what criteria are there for deciding to go one way or the other? This is a one-off personal project, so commercial considerations are less important (although still interesting), I'm thinking there may be practical issues that I'm unaware of (e.g. noise between power rails, efficiency?).

Could someone give me some insight into how these decisions are made?

  • 8
    \$\begingroup\$ Neither. For 5 or 10mA, use a linear regulator from 12V to 5V. Under 10mA it won't be less efficient than a buck, and it'll be simpler. \$\endgroup\$
    – user16324
    May 26, 2015 at 12:34
  • 1
    \$\begingroup\$ @BrianDrummond Thanks - I'd originally discounted linear regulators because I thought they were less efficient than bucks. At what point would it make sense to switch? I mean 10mA is ok, but 20mA not? 100mA? Where's the line drawn? \$\endgroup\$ May 26, 2015 at 12:37
  • 1
    \$\begingroup\$ it's not just about the headline efficiency figure of linear vs. switching, but the cost of components for one vs. the other, and that linear quickly starts generating heat which needs to be dealt with, which costs money & compromises reliability. There's no one mA figure for where switching is preferable to linear, lots of variables in each scenario. \$\endgroup\$ May 26, 2015 at 12:58
  • 1
    \$\begingroup\$ Look at the efficiency of switching regulators : they usually fall off at low currents because they take some current themselves - maybe as much as your PIC. \$\endgroup\$
    – user16324
    May 26, 2015 at 12:59
  • 1
    \$\begingroup\$ @whatsisname Good point but the variable speed is part of the fun! It's useful but also part of my learning process, getting some PWM and IR sensing to add to the piecemeal knowledge I'm acquiring in my spare time. \$\endgroup\$ May 26, 2015 at 16:47

2 Answers 2


For this application a buck or boost converter would be overkill. Your best option would likely be to have a 12v source and then take it down to 5V separately with a linear regulator. Cheap, few parts, most likely parts you already have, etc.

Dropping voltage with a linear regulator generates heat based on the current drawn through the regulator and the voltage dropped. This should not be an issue as the PIC will likely not draw much current.

However, a simple "cheat" way to drop the voltage enough that the regulator won't have a large voltage drop across it is to put one or more diodes in series before the regulator and use them to drop the voltage by ~.7v to 1.4v each depending on the diode. Dropping the voltage to 7v for a 5v regulator should be fine and allow enough headroom for the dropout of the regulator. Again, simple design and parts that you might readily find off the shelf or even salvage from old stuff.


  • \$\begingroup\$ I like the "cheat", thanks! Would any diode be ok? I have loads of 1N4148's but I'd need seven in series to drop ~5V. Maybe it would be useful to put a LED in series anyway so I can see when it's powered? \$\endgroup\$ May 26, 2015 at 12:43
  • 2
    \$\begingroup\$ @RogerRowland if your max current is ~ < 20mA, going with a LED (expect a Vd of about 2V) is a viable idea - bear in mind, however, that while regular diodes are commonly rated at 1A-ish range, common LEDs are (basing on size and colour) rated at 10mA-ish range. \$\endgroup\$
    – user20088
    May 26, 2015 at 13:58
  • 2
    \$\begingroup\$ Vaxquis is right, you would be best off using power diodes whose current rating is typically 1A or so. You could also use a zener diode to drop the voltage if you have a zener. I recommend just trying to buy some 2$ 1n400x series diodes from Radioshack if you can find one that's still open. They have a large assortment of power diodes on tap, and they should all have the forward voltage drop listed on the packaging. \$\endgroup\$
    – Korozjin
    May 26, 2015 at 14:07
  • 3
    \$\begingroup\$ Please note that the diode trick doesn't improve efficiency as the power loss is simply shifted from the linear supply to the diodes. It simply means the linear won't get as hot. \$\endgroup\$
    – CraigC
    Jan 11, 2018 at 14:55

If the 5V system is low current (i.e. 10s of mA, as one anticipates from a wee PIC MCU doing no much), even a 12V-to-5V linear regulator would be fine to power the electronics, and then a logic-level-gate MOSFET driven from a PIC GPIO, with low-side drive of the fan from the 12V supply, should work fine (I'm suggesting switching power to the fan as well, not just relying on its PWM input signal to control it - not all fans that have built-in PWM speed control (as distinct from actually PWMing the power input to the fan) can be controlled all the way down to zero speed).

If, on the other hand, other 5V circuitry pushes your current up to, say, > 100mA, and you're dropping 7V, that's 700mW or more, a not insignificant amount of heat to have to deal with, probably requires a heatsink, which is added cost and size. In that case a buck switcher for the electronics could be preferable. Especially if your MCU was purely digital (no analog functionality needed), then a relatively cheap & noisy buck switcher providing 5V @ 100mA with 100mVpp of noise, might be acceptable. With 80-90% buck switcher efficiency, at such low currents you need only the cheapest & lightest current-capability of switcher components.

As a general rule, it's better to buck than to boost, if you have the choice - and here you do have the choice. That fan draws almost 4 Watts (12V * ~0.3A), so deriving that 12V from a 5V supply from a boost converter (which will also be around 80-90% efficient) means almost 1.0 Amp is required from the 5V supply, which in a manufacturing perspective makes for a more expensive power supply option - transformer & bridge-rectifier & inductor & MOSFETs with higher current ratings, etc. It's not bad, just not as desirable compared to the 12V-powered option.

  • 1
    \$\begingroup\$ Very useful, thanks - I hadn't considered using the PIC to switch the power to the fan, the datasheet implies that PWM with less than 20% duty cycle stops the fan, but no harm allowing for a different fan in future. It seems it would be better to test and measure my power requirements carefully before deciding. Anyway, +1, very grateful. \$\endgroup\$ May 26, 2015 at 13:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.