this post was submitted on 11 Jul 2023
46 points (100.0% liked)

Ask Electronics

3313 readers
14 users here now

For questions about component-level electronic circuits, tools and equipment.

Rules

1: Be nice.

2: Be on-topic (eg: Electronic, not electrical).

3: No commercial stuff, buying, selling or valuations.

4: Be safe.


founded 1 year ago
MODERATORS
 

Circuit is for controlling the fan on a Raspberry Pi, just on/off according to temp, no PWM. Not sure about the diode as it has a .7V drop and it's a tiny brushless DC motor. No markings on the fan so I measured the current with a multimeter when hooking it up to a USB charger. Circuit was adapted from here using what I have on hand.

Suggestions? Any advice is greatly appreciated!

*EDIT: Confirmed, this circuit works on a Raspberry Pi 4. Base was wired to GPIO 17 and manually tested using commands:

raspi-gpio set 17 op dh

raspi-gpio set 17 op dl

I didn't use a breadboard, just hack-n-slash with the wires coming out of the fan, the leads on the thru hole components, a jumper connected to gpio 17 as a socket for the base/resistor lead, and heat shrink tubing for insulation. Folded it up as I closed the housing. Case combo including heatsinks and fan here.

top 17 comments
sorted by: hot top controversial new old
[–] [email protected] 4 points 1 year ago

On a KISS basis - I tend to just use a bimetallic switch or omit the temperature control and just run the fan from power up. It's possible for a processor to suffer some non-handled exception where it no longer executes the temperature management routine.

[–] [email protected] 3 points 1 year ago (1 children)

The diode is a fly back diode, it’s just circuit protection no need to worry about it.

[–] [email protected] 2 points 1 year ago (2 children)

Yah. I added it as the original didn't have one. Think I should keep it?

[–] [email protected] 2 points 1 year ago (1 children)

It's fine, won't cause any problems.

[–] [email protected] 1 points 1 year ago
[–] [email protected] 2 points 1 year ago* (last edited 1 year ago) (1 children)

Well, It does no harm to the rest. So I would keep it.

[–] [email protected] 1 points 1 year ago
[–] [email protected] 3 points 1 year ago (2 children)

Doing some quick math, the transistor will have a base current of 5 milliamps, which a Pi should be able to supply. At a fairly typical beta of 100, the transistor could drive the fan at up to .5 amps, which is plenty for a small fan. A MOSFET transistor is generally better suited for switching high current loads, but for this a BJT (as drawn) should be fine.

[–] [email protected] 3 points 1 year ago (1 children)

The transistor is a 2N4401. From the datasheet, V~BE(sat,max)~ = 1.2 V and h~FE(min)~ = 20, so it could drive ~60 mA in the worst case

[–] [email protected] 3 points 1 year ago

Thanks for checking the datasheet!

[–] [email protected] 1 points 1 year ago

Awesome. That agrees with what I calculated as well. I'm a jack when it comes to electronics.

Thank you much for the help!

[–] [email protected] 2 points 1 year ago (1 children)

I'm no expert by any means and correct me if I'm wrong, but don't you need a control board to drive brushless DC motors?

[–] [email protected] 3 points 1 year ago (1 children)

The board is built into the motor and should also add flyback protection, that's why I'm not sure if I need the diode. Give it juice and it spins.

[–] [email protected] 2 points 1 year ago (2 children)

The point of the diode is to prevent reverse current that gets induced when a (brushed) motor is turned off. It essentially turns into a small generator while spinning down, and the diode essentially short circuits that. It prevents damage to the rest of the circuit. If that motor is brushless (with an integrated control board), you likely won't need it but it doesn't do any harm either.

[–] [email protected] 2 points 1 year ago

It essentially turns into a small generator while spinning down

Kind of like an inductor?

[–] [email protected] 2 points 1 year ago

That's what I figured as well, there's some sort of board under the top of the housing. I'm going to leave the diode in.

I appreciate the advice!

[–] [email protected] 2 points 1 year ago* (last edited 1 year ago)

The maximum I~CE~ is 61.76 mA in the worst case, so I'd say you're good

load more comments
view more: next ›