08-22-2016, 03:54 PM
(This post was last modified: 09-02-2016, 11:34 PM by MarkHaysHarris777.)
edit: I changed the soft-pwm to GPIO23, pin(16).
The schematic above could not be much more simple. The important element here is getting the emitter and collector of the 2N2222 transistor identified correctly. The emitter is the transistor lead marked by the out-going arrow in the diagram and marked pin (1) on the data sheet. What makes this tricky is that different vendors swap pins 1 & 3 as you can see on the card. Mine was the third diag all the way to the right (the base pin is offset). At any rate the emitter must go to ground.
This diagram is simplified from the photo below. The idea is that the fan is in-line with the transistor; but of course, the fan has two leads. I have placed my transistor in-line with the black lead. In other words the red lead goes all the way from the motor to pin(4) 5v. The black lead holds the transistor with the emitter towards the plug.
The pic above shows the in-line transistor (2N2222) . It is important to note that I swapped the leads in the standard 5v plug (this is CRITICAL) because it not only allows the plug to fit between 5v and ground, but also gets the exposed 'pin locks' to the outside where they will not short against pins 3 & 5.
The base lead runs through a 1K ohm resistor to pin(16), which is GPIO23. The fan_motor.sh script is coded to use this pin for soft-pwm by default.
I have left this in-line wiring expanded for easy viewing. If mounting in a case , like the C4Labs case , you may want to make the wiring smaller , or you may want to enclose the wiring inside the case. I even have a setup where I soldered the transistor directly to the GPIO pins; although, I do not recommend this.
Again, the diagram I provided isn't quite in sync with the photo. I placed the transistor in-line in the black lead. The red lead runs from the motor to pin(4). The black lead holds the transistor and runs to pin(6). The base lead has the 1K ohm resistor and runs to pin(16) or GPIO23.
The theory of operation is simple: the soft-pwm (pulse width modulation) in fan_motor.sh turns the transistor ON and OFF rapidly with a duty cycle ON of about 80%. This slows and quiets the motor substantially because the average time ON is reduced , thereby reducing the overall power to the motor while maintaining the 5v supply for the brushless operation.
edit: important change: I changed the soft-pwm to GPIO23, pin(16)
marcushh777
please join us for a chat @ irc.pine64.xyz:6667 or ssl irc.pine64.xyz:6697
( I regret that I am not able to respond to personal messages; let's meet on irc! )
please join us for a chat @ irc.pine64.xyz:6667 or ssl irc.pine64.xyz:6697
( I regret that I am not able to respond to personal messages; let's meet on irc! )