rip cpu fan + shutdown button
1.Use cheep transistor like bc547.
2.Connect emiter transistor pin to pin 2 gpio.
3.cpu fan "+" pin connect to transistor, "-" pin connect to any GND.
4.For shutdown button use resistor 1kom-3kom and connect to pin 18 gpio and any and pin.
-
download python 3 and all dependencies.
-
make new systemcl daemon with following code and change "NAMEOFYOURSERVICE" on your name:
nano /lib/systemd/system/NAMEOFYOURSERVICE.service
Then paste this code:
#=================================================
[Unit]
Description=NAMEOFYOURSERVICE Service
After=multi-user.target
Conflicts=[email protected]
[Service]
Type=simple
ExecStart=/usr/bin/python3 /home/pi/temp.py
StandardInput=tty-force
[Install]
WantedBy=multi-user.target
#===============================================
-
copy file temp.py into /home/pi/temp.py
-
Load Ned deamon with command: systemctl daemon-reload
-
systemctl start NAMEOFYOURSERVICE
-
systemctl status NAMEOFYOURSERVICE
AND REMEMBER! PASPBERRY PI HAVEN'T ANY PROTECTION FROM SHORT CIRCUT!!!