No I'm using the Pi for a magic mirror. Everytime the PIR detects motion, the screen turns on and I want the fans to turn on too. The mirror is a closed system, and the screen heats up fast. That's why I want to cool it down only when the screen turns on (Motion detected).
It cannot be done this way. The Pi does not have individual USB power control; it's all or nothing, all four ports powered or none.
Ok thanks! Good to know.hippy wrote: ↑Tue Jan 22, 2019 1:06 amIt cannot be done this way. The Pi does not have individual USB power control; it's all or nothing, all four ports powered or none.
You need GPIO lines to switch relays or a FET to turn power to the fans on and off or a USB controlled relay or switch.
I seem to recall reading an article about reducing power consumption which suggested that on the 3B+ at least, you can disable the Ethernet and just two of the 4 USB sockets
Probably the same article I remember reading but don't recall where. But I do recall the article I read seemed to be confusing 'disabling ports' with 'turning off power to individual ports'.jbudd wrote: ↑Tue Jan 22, 2019 6:02 amI seem to recall reading an article about reducing power consumption which suggested that on the 3B+ at least, you can disable the Ethernet and just two of the 4 USB sockets
So it is possible? That would be perfect, but how do I control it via sh script? I have an existing sh script and I wand to add the needed commands.
Oh I'm sorry for misunderstanding it..hippy wrote: ↑Tue Jan 22, 2019 4:00 pmis not possible.
Disabling individual or groups of USB ports reduces power consumption within the USB/LAN chip but that doesn't disconnect power delivered to the individual USB ports.
Thank you very much! That helped me a lot!Imperf3kt wrote: ↑Tue Jan 22, 2019 9:16 pmhttps://en.wikipedia.org/wiki/2N2907
This can handle 0.6A of current, enough for four 0.1A fans.
Then read this.
http://www.learningaboutelectronics.com ... ircuit.php
Thank you that's a good idea!Mortimer wrote: ↑Wed Jan 23, 2019 2:54 pmYou'll need snubbers on those motors, to 'snub' the back EMF from the motors when they are turned off. Otherwise you'll get voltage spikes going back into the 5V supply rail.
It might also be preferable for the 5V supply to come directly from the PSU, rather than via the RPi.
1. All bipolar transistors need a base resistor.skyales wrote: ↑Wed Jan 23, 2019 2:26 pmIn some blogs I read that some transistors need base resistors. I didn't figure out what resistor I need.
I think the formula is Rb=Vbe/IB
Vbe should be 5v
Type Designator: 2N2907
SMD Transistor Code: 2B
Material of Transistor: Si
Maximum Collector Power Dissipation(Pc): 0.4 W
Maximum Collector-Base Voltage |Vcb|: 60V
Maximum Collector-Emitter Voltage |Vce|: 40 V
Maximum Emitter-Base Voltage |Veb|: 5 V
Maximum Collector Current |Ic max|: 0.6 A
Max. Operating Junction Temperature (Tj): 200 °C
Transition Frequency (ft): 200 MHz
Collector Capacitance (Cc): 8 pF
Forward Current Transfer Ratio (hFE), MIN: 35
Thank you very much for your detailed answer!drgeoff wrote: ↑Wed Jan 23, 2019 5:25 pm1. All bipolar transistors need a base resistor.
2. The base current needs to be at least the current through the fans divided by the minimum current gain (thats hfe) of the transistor at that collector current. That's 400mA divided by say 20 which comes to 20mA. That exceeds the 16 mA recommended maximum for a GPIO. Try 15 mA. The voltage across the resistor is the GPIO high output voltage minus the base to emitter voltage. The GPIO will not be able to sustain 3.3 volts when sourcing 15 mA. Estimate 3 volts. Use 0.7 for Vbe. So 2.3 volts and 15 mA gives 150 ohm as nearest commonly available resistor.
1 Fan is 0,1A and I have 4 of them. As a base current resistor 150 ohm. To protect the Rpi I use a 1A diode in parallel to the fans but inverted direction.