Cheaply controlling a USB fan with an MCU? - Page 1
Forum section: electronics / general

author: kalel
author_rank: Frequent Contributor
timestamp: June 25, 2017, 08:22:57 pm
content: I have a USB fan of about 0.5 A draw.For fun, I want to try to add some modes, where the ran ramps up and down, and makes pauses (externally controlled with a MCU, not planning to build it in). Why is this useful? Well, it might be useless, I just want to try it and see. If you keep a fan constantly blowing towards you, your body adjusts to this. Once you remove the fan, the part of your body where the fan was blowing suddenly feels warmer than the rest, for a little while. If the fan is not constantly blowing, perhaps your body will not have as much time to adapt, so you might feel that the air is "colder".The other thing is, I want to do this as cheaply as possible (I already have a clone of Arduino Uno, but no power transistors, and connecting 10-20 in parallel seems impractical, unstable - e.g. one might hog more current and heat up - and more expensive).The cheapest relay I could find is about $0.3. But a relay might not be practical. Cheapest power transistors I could find are these:"B0083 50pcs NPN power transistors BD139 TO-126". One costs about $0.05 or less if you order 50.PNP variants are slightly cheaper, but it should be easier to work with NPN.One buyer tested one on Aliexpress, and got the following data from the tester:BJT-NPNhFE=233Ic=2.1mAVbe=668mVFairchild's datasheet (https://www.fairchildsemi.com/datasheets/BD/BD139.pdf) shows the following characteristics:Absolute maximum ratings:Collector Current (DC) 1.5 ACollector Current (PULSE) 3.0 ABase Current 0.5 ADo you think this transistor would be sufficient to drive that load? Obviously, I'm not considering any commercial products (just want to test this out for a few minutes and see how it works) so I don't really need reputable / high quality parts, it's more important that the cost is minimal.

author: MosherIV
author_rank: Super Contributor
timestamp: June 25, 2017, 10:16:18 pm
content: QuoteYou will have to learn to interprit the specifcation for yourself......QuoteQuoteThat sound like a yes it will work IF the part is real!Avoid getting parts from vendors like ebay, Aliexpress and the like. There is a very high chance of getting fake parts that do not work or do not meet the specifications.To ramp the fan up/down you can vary the voltage across it. PWM into a capacitor and put fan accross capacitor should work. Do not forget, since you are dealing with a motor, to use a flyback diode across transistor to catch back volt from motor.Edit: best put these questions in beginners or projects NOT in general chat. General chat is for non project stuff

author: kalel
author_rank: Frequent Contributor
timestamp: June 25, 2017, 10:31:17 pm
content: Quote from: MosherIV on June 25, 2017, 10:16:18 pmExactly, not knowing and considering that the ratings are absolute maximum ratings (not recommended usage), I'm left to hope it would work. Fortunately, the transistors are cheap enough that if they do overheat or not last long, at least not much money was spent, and not being any commercial thing there's less long term reliability to worry about (in fact, I'm just experimenting).QuoteThanks for the useful tips.QuoteYou're right about that, it would fit better in Projects. My fault.

author: NiHaoMike
author_rank: Super Contributor
timestamp: June 26, 2017, 03:49:12 am
content: Use a MOSFET. Even high current ones are fairly cheap and if you have an old motherboard lying around, you can easily salvage some MOSFETs with way more current capacity than you need.

author: kalel
author_rank: Frequent Contributor
timestamp: June 26, 2017, 04:15:34 am
content: Quote from: NiHaoMike on June 26, 2017, 03:49:12 amThanks for the suggestion. Just wondering, are you recommending a MOSFET because it needs less current for switching being voltage-controlled (thus might heat less), might be cheaper to obtain than a BJT capable of the same amount of current, or is there another reason?

author: NiHaoMike
author_rank: Super Contributor
timestamp: June 26, 2017, 06:01:03 am
content: A bipolar transistor will need a pretty good amount of drive current, maybe more than what some microcontrollers can supply. You can get around it by cascading another bipolar, but small (10A or so max current at 20V or so) MOSFETs will run nicely off a microcontroller at least for low switching frequencies. (For high switching frequencies and/or large MOSFETs, use a MOSFET driver.)BTW, since larger (higher voltage/current) MOSFETs have higher gate charge, you'll actually want a fairly small MOSFET. If you're salvaging from an old motherboard, try looking for SO8 packages near some inductors or capacitors that have several pins connected together.

author: kalel
author_rank: Frequent Contributor
timestamp: June 26, 2017, 04:29:24 pm
content: Quote from: NiHaoMike on June 26, 2017, 06:01:03 amThanks. Since I didn't consider drive current much, I agree that a MOSFET may really work better here. I will get a module (they are about $0.5) driver with a MOSFET designed for MCU use (although it's just a mosfet and a few passives it seems). It comes with screw terminals so slightly easier to test than soldering things in/out. They suggest adding a heatsink at 1A or higher, but shouldn't be necessary at half that value.

author: Red Squirrel
author_rank: Super Contributor
timestamp: June 26, 2017, 07:54:46 pm
content: I'm thinking pwm would do, essentially a really basic buck converter topology if you want to smooth it out but straight pwm might work fine too. Heck, if you use a computer fan that has an actual pwm pin you can control that and just apply a constant 12v to the rest of the fan. That way you may even be able to drive it directly from the MCU. (the 12v would be separate of course and ensure it has the same ground as the mcu)I can't say I've ever played with the pwm of a computer fan myself though so not sure how specific it is, like if it needs to be a specific frequency etc or if it does not matter. Worth checking into.