I just bought a case with fa , as pi 4 is not working great without it. Now temperature is low, but as I have it in my room, I would like to turn it off while sleeping.
My fan is: https://www.amazon.fr/gp/product/B07V9Q95RX/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&psc=1
When I shutdown the pi, fan is still active, so I have to physically unplug power, which is not so great.
Is there a way to shutdown fan at the same time than pi ?
-
Hi @Juliatzin del Toro, Ah, let me see. If there is no power on/off switch on the power cord, perhaps you can DIY one: Rpi4B Case with Fan, 4 Heatsinks, 5V 3A USB-C PSU – US$17 – amazon.com/Smraza-Raspberry-Cooling-Heatsinks-Included/dp/… – (With a handy on/off switch on the 59 inches cable, easily press button to power on RPi4B) – tlfong01 Oct 3 at 5:32
-
Without knowing what case and how the fan is connected – No – Milliways Oct 3 at 6:03
-
This is the switch you can DIY: imgur.com/a/7GcpXDI. – tlfong01 Oct 3 at 6:29
-
@Milliways sorry I updated my question with fan link – Juliatzin del Toro Oct 3 at 7:03
-
And you can use this kind of switches: imgur.com/gallery/R0j5Ac9. These are 250V AC 3A ~ 5A switches. Your Rpi4 5.1V ~ 5.3V DC 3A wall wart output has a micro USB connector. So I would suggest (no guarantee nothing won’t melt down!) to “insert” the switch between wall wart and micro USB connector. – tlfong01 2 days ago
-
Now the time has come for the cut operation. First thing first is to cut the wall wart to micro USB connector power cord into two halves (sorry, unplug the wall wart first!). And before the cut, you need to think twice that if the two “halves” are really halves, or one long half and one short half, say, one quarter and three quarters. Now you strip the ground wire and 5V wire, IN DIFFERENT LENGTHS. This important for newbies, who always short the red wire with the blue wire and cause explosion. If red is shorter than blue, then the newbie can live longer: imgur.com/K2UOQGj – tlfong01 2 days ago
If the fan is connected to the 5V and GND pins then they are not controlled by software. Those two pins are directly connected to your power supply, so as long as the power supply is connected and turned on at the wall socket your fan will continue to run.
-
But this does not answer the question: “Is there a way to shutdown fan at the same time than pi?“ – Ingo 2 days ago
-
@ingo I don’t understand your comments. The fan runs while the power is connected regardless of whether the RPi is booted. – Dougie 2 days ago
-
Not really important and your answer is right, but that was not asked. How would you shut down the fan with the pi? With a common wall switch? – Ingo 2 days ago
-
I don’t remember how did I connect it, but I can check tomorrow. So did I buy the wrong case ? Is there some case that would actually turn off with PI ? – Juliatzin del Toro yesterday
-
shop.pimoroni.com/products/fan-shim Or you can hack your fan with a transistor to switch the power raspberrypi.org/forums/viewtopic.php?t=194621 – Dougie yesterday
Question
How to turn off Rpi4B case’s cooling fan without pulling the power plug?
Answer
There are many ways, including the following:
(1) Get a case with a manual power switch (Reference 2).
(2) DIY a manual cable power switch (Appendices A to C).
(3) Using Rpi GPIO to control a software switch to turn on/off the power supply for the cooling fan (Ref 6, Appendix C)
Discussions
Discussion Notes #1 – 2019oct04 hkt1635
The OP commented that my answer does not meet his requirement, which is summarized below:
Lying in bed, after watching a movie, shut down the Rpi as a PC, without leaving the bed. Therefore a local switch near the Rpi but too far from bed won’t do.
Now let me consider some cases and see if I can product a real solution.
Case 1 – The OP sits in front of Rpi on a desk, starts the VLC Media Player, selects a movie, then walks to his bed, lies on bed and starts watching the movie. He does not want to leave the bed anymore, and wishes NOT to get up and walk to the wall socket to switch off the wall wart.
Now either he changes his present Rpi case without a manual power switch to a new one with manual power switch, or DIY his own switch, IF the switch is “local” to Rpi but remote from bed, then he has to get up to reach the switch.
In other words, if the switch either comes with the Rpi case, or DIY inserted, does NOT solve the problem.
Case 2 – I have thought about a couple of more possible solutions, including the following:
(2.1) Use a mobile phone to switch Rpi, and then case power,
(2.2) Use a remote controller (similar to TV remote) to switch off Rpi and then case power, or just cooling fan power, which is easier.
(2.3) Lengthen the power cord at either or both ends of the manual power switch (Appendix A, Tamiya socket labelled “B”). This way, the OP needs to carry the switch with a dangling long power cord to bed. But this method is easy. One problem is that Rpi won’t be properly shutdown.
(2.4) use a WiFi power socket, …
(2.5) Extract the two wires connecting to the fan, extend the wires and added manual switch. This is easy but messy.
I need to ask the OP to confirm if I indeed understand his situation, and more details of his user requirements, before I suggest more solutions.
Discussion Notes #2 – 2019oct05 0938
Case 3
(3.1) Use a USB powered cooling fan, extend the USB cable to bedside, and without leaving the bed, just pull the USB plug to turn off the fan (Ref 7). This 40mm cooling fan is brushless, double bearing, and might be much more quiet than your Rpi case’s built in fan. You can also find “magnetic” bearing which is even more quiet.
(3.2) And you can add temperature sensed PWM fan speed control, so if the Rpi is not playing video, Rpi becomes cool, the fan will automatically run at very low speed, or even stops. Now you can have a nice sleep, …
Case 4 – Updated 2019oct06hkt1204
In Case 2.4 above, I suggest using a WiFi power switch such as Sonoff, but I am not sure if the OP is confident to to the wiring of 200VAC wires. I also googled IoT Stack Exchange and found 50+ posts on uggest using a WiFi power switch, but I am not sure if the OP is confident to to the wiring of 200VAC wires. I also googled IoT Stack Exchange and found 50+ posts on Sonoff, including how to use Sonoff’s GPIO pins to do other things (Perhaps turning on/off the OP’s case’s cooling fan, as well as the Rpi power.
Again, this is a bit risky and not recommended to newbies. So in case if the OP is interested in the approach,
I would suggest the OP to move this question to IoT Stack Exchange, …
For those those are interested to learn about Sonoff, IoT MQTT, ESP8266 etc, and dare not to touch the dangerous 200VAC mains, you can consider doing the following experiments.
(1) Open the Sonoff cover (it is hacker friendly, takes your less than 3 seconds)
(2) Study the schematic, find where the AC200V to 3V3 transformer output, remove the AC circuit, supply your own 3V3 power.
(3) Find the ESP8266 chip’s TxD, RxD, GPIO pins and use Rpi ESP8266 IDE to program the ESP8266.
There is a tutorial (Ref 20) on how to use LUA to program the ESP8266/ Sonoff smart switch. This tutorial is simple because it does not make use of any cloud, third party server, MQTT broker, you just use your smart phone to WiFi talk to ESP8266 whose pins can do the following: (1) switch on/off Rpi (logic or power circuit), (2) switch on/off cooling fan, with the help of ddriver 2N2222.
WARNING: I myself have not tried it. So there is no guarantee that something won’t explode!
/ to continue, …
References
(1) Rpi4 Case without manual power switch
(2) Rpi4 Case with a power switch
(3) The manual power switch to DIY
(4) 250V 3A ~ 5A manual power switches
(5) How to strip the power wires
(6) Using LM2596 and LM2941 to switch on/off PSU/currenct
(7) Amazon 40mm x 10mm 5VDC USB Brushless Cooling Fan, Dual Ball Bearing – $14/2 pcs
(8) Sonoff Smart Remote Control Wifi Switch Compatible with Alexa Iphone Android – $22
(10) Sonoff User Guide
(11) Six Sonoff Secrets: Storage, Safety, Switches, Sensors, Software, and Sites
(12) Sonoff Basic WiFi Smart Switch Review (YouTube)
(13) How to Use MQTT With the Raspberry Pi and ESP8266 – Thomas Varnish
(14) Make your own Sonoff WiFi switch using ESP8266 and MQTT 2017aug09
(15) Sonoff / Tasmoto Garage Door sensors
(16) Are all SonOff GPIO mains isolated? – IoT StackExchange 2019sep19
(17) Manual Override Button for Sonoff Basic – IoT StackExchange 2019sep19
(18) Sonoff basic- GPIO’s – IoT StackExchange 2019sep02
(19) DIY Add a Sonoff To Home Thermostat
(20) Lua application for management Sonoff WiFi Smart Switch
(21) Sonoff Schematic
Appendices
Appendix A – Power Switch DIY Notes 1 – Cutting power cord to insert switch
Appendix B – Power Switch DIY Notes 2 – Switch inserted
Appendix C – Rpi4B + PSU – Power Switch Testing OK
Appendix D – Using A Software Switch to switch on/off cooling fan power
Appendix E – Sonoff Smart Remote Control Wifi Switch
Product Spec
Supports 2.4G WIFI router and 2/3/4G mobile network (5G router not supported)
Power Input – 90 ~250VAC
Maximum load current – 10A
Only use “eWeLink” free app.
Security Mechanism: WEP/WPA-PSK/WPA2-PSK
Features
Remote ON/OFF: Turn electrical devices on/off from anywhere
App Support: Free IOS and Android mobile App eWelink
Sync Status: Real time device status provided to App
Timing: Set scheduled/countdown timers to turn on/off at specified time
Scene: Turn on/off a gang of devices one tap
Smart Scene: Trigger on/off by temperature, humidity or other environmental conditions
Control Options
Voice Control
Sonoff Basic Switch works with Amazon Echo,Echo Dot,Amazon Tap and Google Home to manage your devices through Voice control
Remote Control
Sonoff Switch transmits data to a cloud platform through the Wi-Fi Router, which enables you to remotely control the connected appliances, via free eWeLink App.You can download the iOS version in App Store and the Android version in Google Play.The App eWeLink enables you to control your devices easily
Timer Control
Set timing schedules for the appliances, which can include countdown, scheduled on/off
Setup Guide
- Switch off electricity source
- Open the covers at both ends
- Connect the two electricity source cables (Live and Neutral) to the ports with “IN” mark, one cable for one port, and there’s no limitation for which port to connect
- Connect the two appliances cables(Live and Neutral) to the two ports with “OUT” mark, one cable for one port, and there’s no limitation for which port to connect make the cover install firmly
End of Answer
-
sorry, question is: Is there a way to shutdown fan at the same time than pi ? My use case is that I watch a movie with my Raspberry PI from my bed, so I don’t want to leave my bed to turn off PI. So a local switch is not a good option… I just don’t understand why PI can’t tell everything to shutdown by software, like any PC would do. – Juliatzin del Toro yesterday
-
1
-
-
***Question***
> How to turn off Rpi4B case’s cooling fan without pulling the power plug?
—
***Answer***
*There are many ways, including the following:*
> (1) Get a case with a manual power switch (*Reference 2*).
>
> (2) DIY a manual cable power switch (*Appendices A to C*).
>
> (3) Using Rpi GPIO to control a software switch to turn on/off the power supply for the cooling fan (Ref 6, Appendix C)
—
***Discussions***
*Discussion Notes #1 – 2019oct04 hkt1635*
The OP commented that my answer does not meet his requirement, which is summarized below:
> Lying in bed, after watching a movie, shut down the Rpi as a PC, without leaving the bed. Therefore a local switch near the Rpi but too far from bed won’t do.
Now let me consider some cases and see if I can product a real solution.
—
***Case 1*** – The OP sits in front of Rpi on a desk, starts the VLC Media Player, selects a movie, then walks to his bed, lies on bed and starts watching the movie. He does not want to leave the bed anymore, and wishes NOT to get up and walk to the wall socket to switch off the wall wart.
Now either he changes his present Rpi case without a manual power switch to a new one with manual power switch, or DIY his own switch, IF the switch is “local” to Rpi but remote from bed, then he has to get up to reach the switch.
In other words, if the switch either comes with the Rpi case, or DIY inserted, does NOT solve the problem.
—
***Case 2*** – I have thought about a couple of more possible solutions, including the following:
(2.1) Use a mobile phone to switch Rpi, and then case power,
(2.2) Use a remote controller (similar to TV remote) to switch off Rpi and then case power, or just cooling fan power, which is easier.
(2.3) Lengthen the power cord at either or both ends of the manual power switch (Appendix A, Tamiya socket labelled “B”). This way, the OP needs to carry the switch with a dangling long power cord to bed. But this method is easy. One problem is that Rpi won’t be properly shutdown.
(2.4) use a WiFi power socket, …
(2.5) Extract the two wires connecting to the fan, extend the wires and added manual switch. This is easy but messy.
> I need to ask the OP to confirm if I indeed understand his situation, and more details of his user requirements, before I suggest more solutions.
*Discussion Notes #2 – 2019oct05 0938*
—
***Case 3***
(3.1) Use a [USB powered cooling fan][1], extend the USB cable to bedside, and without leaving the bed, just pull the USB plug to turn off the fan (Ref 7). This 40mm cooling fan is brushless, double bearing, and might be much more quiet than your Rpi case’s built in fan. You can also find “magnetic” bearing which is even more quiet.
(3.2) And you can add temperature sensed PWM fan speed control, so if the Rpi is not playing video, Rpi becomes cool, the fan will automatically run at very low speed, or even stops. Now you can have a nice sleep, …
—
***Case 4 – Updated 2019oct06hkt1204***
In Case 2.4 above, I suggest using a WiFi power switch such as Sonoff, but I am not sure if the OP is confident to to the wiring of 200VAC wires. I also googled IoT Stack Exchange and found 50+ posts on uggest using a WiFi power switch, but I am not sure if the OP is confident to to the wiring of 200VAC wires. I also googled IoT Stack Exchange and found 50+ posts on Sonoff, including how to use Sonoff’s GPIO pins to do other things (Perhaps turning on/off the OP’s case’s cooling fan, as well as the Rpi power.
Again, this is a bit risky and not recommended to newbies. So in case if the OP is interested in the approach,
> I would suggest the OP to ***move this question to IoT Stack Exchange***, …
[![sonoff_2019oct0601][2]][2]
[![sonoff_2019oct0602][3]][3]
[![sonoff 2019oct0602][4]][4]
For those those are interested to learn about Sonoff, IoT MQTT, ESP8266 etc, and dare not to touch the dangerous 200VAC mains, you can consider doing the following experiments.
(1) Open the Sonoff cover (it is hacker friendly, takes your less than 3 seconds)
(2) Study the schematic, find where the AC200V to 3V3 transformer output, remove the AC circuit, supply your own 3V3 power.
(3) Find the ESP8266 chip’s TxD, RxD, GPIO pins and use Rpi ESP8266 IDE to program the ESP8266.
There is a [tutorial][5] (Ref 20) on how to use LUA to program the ESP8266/ Sonoff smart switch. This tutorial is simple because it does not make use of any cloud, third party server, MQTT broker, you just use your smart phone to WiFi talk to ESP8266 whose pins can do the following: (1) switch on/off Rpi (logic or power circuit), (2) switch on/off cooling fan, with the help of ddriver 2N2222.
> WARNING: I myself have not tried it. So there is no guarantee that
> something won’t explode!
—
*/ to continue, …*
—
***References***
(1) [Rpi4 Case without manual power switch][6]
(2) [Rpi4 Case with a power switch][7]
(3) [The manual power switch to DIY][8]
(4) [250V 3A ~ 5A manual power switches][9]
(5) [How to strip the power wires][10]
(6) [Using LM2596 and LM2941 to switch on/off PSU/currenct][11]
(7) [Amazon 40mm x 10mm 5VDC USB Brushless Cooling Fan, Dual Ball Bearing – $14/2 pcs][1]
(8) [Sonoff Smart Remote Control Wifi Switch Compatible with Alexa Iphone Android – $22][12]
(9) [Sonoff Product Info][12]
(10) [Sonoff User Guide][13]
(11) [Six Sonoff Secrets: Storage, Safety, Switches, Sensors, Software, and Sites][14]
(12) [Sonoff Basic WiFi Smart Switch Review (YouTube)][15]
(13) [How to Use MQTT With the Raspberry Pi and ESP8266 – Thomas Varnish][16]
(14) [Make your own Sonoff WiFi switch using ESP8266 and MQTT 2017aug09][17]
(15) [Sonoff / Tasmoto Garage Door sensors][18]
(16) [Are all SonOff GPIO mains isolated? – IoT StackExchange 2019sep19][19]
(17) [Manual Override Button for Sonoff Basic – IoT StackExchange 2019sep19][20]
(18) [Sonoff basic- GPIO’s – IoT StackExchange 2019sep02][21]
(19) [DIY Add a Sonoff To Home Thermostat][22]
(20) [Lua application for management Sonoff WiFi Smart Switch][5]
(21) [Sonoff Schematic][23]
—
***Appendices***
*Appendix A – Power Switch DIY Notes 1 – Cutting power cord to insert switch*
[![stripping wires][24]][24]
*Appendix B – Power Switch DIY Notes 2 – Switch inserted*
[![pss switch][25]][25]
*Appendix C – Rpi4B + PSU – Power Switch Testing OK*
[![system testing ok][26]][26]
*Appendix D – [Using A Software Switch to switch on/off cooling fan power][11]*
[![psu switch 1][27]][27]
[![psu switch 2][28]][28]
*Appendix E – [Sonoff Smart Remote Control Wifi Switch][12]*
*Product Spec*
> Supports 2.4G WIFI router and 2/3/4G mobile network (5G router not
> supported)
>
> Power Input – 90 ~250VAC
>
> Maximum load current – 10A
>
> Only use “eWeLink” free app.
>
> Security Mechanism: WEP/WPA-PSK/WPA2-PSK
*Features*
> Remote ON/OFF: Turn electrical devices on/off from anywhere
>
> App Support: Free IOS and Android mobile App eWelink
>
> Sync Status: Real time device status provided to App
>
> Timing: Set scheduled/countdown timers to turn on/off at specified
> time
>
> Scene: Turn on/off a gang of devices one tap
>
> Smart Scene: Trigger on/off by temperature, humidity or other
> environmental conditions
*Control Options*
> Voice Control
>
> Sonoff Basic Switch works with Amazon Echo,Echo Dot,Amazon Tap and
> Google Home to manage your devices through Voice control
>
> Remote Control
>
> Sonoff Switch transmits data to a cloud platform through the Wi-Fi
> Router, which enables you to remotely control the connected
> appliances, via free eWeLink App.You can download the iOS version in
> App Store and the Android version in Google Play.The App eWeLink
> enables you to control your devices easily
>
> Timer Control
>
> Set timing schedules for the appliances, which can include countdown,
> scheduled on/off
*Setup Guide*
> 1. Switch off electricity source
>
> 2. Open the covers at both ends
>
> 3. Connect the two electricity source cables (Live and Neutral) to the ports with “IN” mark, one cable for one port, and there’s no
> limitation for which port to connect
>
> 4. Connect the two appliances cables(Live and Neutral) to the two ports with “OUT” mark, one cable for one port, and there’s no
> limitation for which port to connect make the cover install firmly
*End of Answer*
—
[1]: https://www.amazon.com/ANVISION-Bearing-Brushless-Cooling-YDM4010B05/dp/B074YJH3P9/ref=sr_1_4?keywords=mini%20cpu%20cooling%20fan&qid=1570237815&sr=8-4
[2]: https://i.stack.imgur.com/UpvFd.jpg
[3]: https://i.stack.imgur.com/ERIqo.jpg
[4]: https://i.stack.imgur.com/E4OsD.jpg
[5]: http://esp8266.fancon.cz/esp8266-sonoff-relay-application-lua/esp8266-sonoff-relay-application-lua.html
[6]: https://www.amazon.fr/gp/product/B07V9Q95RX/ref=ppx_yo_dt_b_asin_title_o00_s00?ie=UTF8&psc=1
[7]: https://www.amazon.com/dp/B07TTMQ4PH/
[8]: https://imgur.com/a/7GcpXDI
[9]: https://imgur.com/gallery/R0j5Ac9
[10]: https://imgur.com/K2UOQGj
[11]: https://raspberrypi.stackexchange.com/questions/99584/cut-power-on-a-remote-raspberry-pi-3-via-another-raspi
[12]: https://www.amazon.com/Sonoff-Remote-Control-Compatible-Android/dp/B078GDFYTY
[13]: http://ewelink.coolkit.cc/?p=126
[14]: https://www.youtube.com/watch?v=8mz5sCAvDAY&t=5s
[15]: https://www.youtube.com/watch?v=Z2nW4QvG-xI
[16]: https://www.instructables.com/id/How-to-Use-MQTT-With-the-Raspberry-Pi-and-ESP8266/
[17]: https://www.youtube.com/watch?v=_ud8SXucAEY
[18]: https://raspberrypi.stackexchange.com/questions/98821/garage-door-sensors
[19]: https://iot.stackexchange.com/questions/4526/are-all-sonoff-gpio-mains-isolated
[20]: https://iot.stackexchange.com/questions/4513/manual-override-button-for-sonoff-basic
[21]: https://iot.stackexchange.com/questions/3349/sonoff-basic-gpio-s
[22]: https://iot.stackexchange.com/questions/3079/diy-add-a-sonoff-to-home-thermostat
[23]: https://www.itead.cc/wiki/images/f/f8/Sonoff-Schmatic.pdf
[24]: https://i.stack.imgur.com/7FJTA.jpg
[25]: https://i.stack.imgur.com/fqky1.jpg
[26]: https://i.stack.imgur.com/nOn62.jpg
[27]: https://i.stack.imgur.com/41qzu.jpg
[28]: https://i.stack.imgur.com/afEh4.jpg
.END
Categories: Uncategorized








