08-30-2017, 12:08 AM
(This post was last modified: 08-31-2017, 02:42 AM by MarkHaysHarris777.)
See full update on post #2 below:
I plan to mount this 5v brushless fan under the clear Rock64 shipping case using very tiny machine screws set directly into the soft plastic ( for a little later ). The motor leads ( red +5v, black grnd ) are plugged into the PI-2 bus voltage pins with a 2N2222 transistor in the power lead ( collector emitter ) and with the base lead plugged into the GPIO2_C2 (82) via biasing resistor.
The theory is that a driver script ( fan_motor.sh ) will generate a soft-pwm signal to the base of the driver transistor allowing current to flow from collector to emitter; with greatly reduced current, heat, and noise. I have wrapped the 2N2222 transistor in an aluminum clip ( heatsink ) to help extend the life of the transistor; the heatsink gets warm but does it's job quite well.
The simple driver script is listed below, and is also visible in the terminal pics below:
fan_motor.sh
The pic at the far right-hand is the fan happily spinning away ! The other two pics are views of the control terminal and the commands used to control the 2N2222 transistor bias. The code sets up a loop that monitors the control pin ( in this case gpio83 ). gpio83 must be set HIGH to run the loop, which runs in the background. Momentarily pulling the control pin (83) LOW causes the loop to break and the motor will stop ( the control pin is on parm $2 ).
The control loop turns gpio(82) ON|OFF using parms $3 and $4 with a slow duty cycle in this case of 75% ON, and a frequency of about 6cps; for a brushless fan this is perfect for keeping the fan running ( very nice airflow ) but with greatly reduced current and far less noise !
The stopled.sh script is simply a three line script that pulls the control pin low for 1.5 seconds and then releases it. This breaks the control loop effectively stopping the motor.
I plan to mount this 5v brushless fan under the clear Rock64 shipping case using very tiny machine screws set directly into the soft plastic ( for a little later ). The motor leads ( red +5v, black grnd ) are plugged into the PI-2 bus voltage pins with a 2N2222 transistor in the power lead ( collector emitter ) and with the base lead plugged into the GPIO2_C2 (82) via biasing resistor.
The theory is that a driver script ( fan_motor.sh ) will generate a soft-pwm signal to the base of the driver transistor allowing current to flow from collector to emitter; with greatly reduced current, heat, and noise. I have wrapped the 2N2222 transistor in an aluminum clip ( heatsink ) to help extend the life of the transistor; the heatsink gets warm but does it's job quite well.
The simple driver script is listed below, and is also visible in the terminal pics below:
fan_motor.sh
Code:
#!/bin/sh
# sudo ./fan_motor.sh pwm_pin# ctrl_pin# time_ON time_OFF &
while [ `cat /sys/class/gpio/gpio$2/value` -gt 0 ]; do
echo 1 > /sys/class/gpio/gpio$1/value
sleep $3
echo 0 > /sys/class/gpio/gpio$1/value
sleep $4
done
echo 0 > /sys/class/gpio/gpio$1/value
The pic at the far right-hand is the fan happily spinning away ! The other two pics are views of the control terminal and the commands used to control the 2N2222 transistor bias. The code sets up a loop that monitors the control pin ( in this case gpio83 ). gpio83 must be set HIGH to run the loop, which runs in the background. Momentarily pulling the control pin (83) LOW causes the loop to break and the motor will stop ( the control pin is on parm $2 ).
The control loop turns gpio(82) ON|OFF using parms $3 and $4 with a slow duty cycle in this case of 75% ON, and a frequency of about 6cps; for a brushless fan this is perfect for keeping the fan running ( very nice airflow ) but with greatly reduced current and far less noise !
The stopled.sh script is simply a three line script that pulls the control pin low for 1.5 seconds and then releases it. This breaks the control loop effectively stopping the motor.
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! )