Pimp my Raspberry Pi 3 (video #131)

In my last mailbag, I got an ordinary Raspberry Pi Model 3 with an acrylic housing, a fan, and a battery power supply. All nice things, but not good enough for me. I will pimp my Raspi!

A small fan will keep the Raspi 3 cool

A simple hardware switches a fan on and off

A Python program reads the CPU temperature and switches the fan
So, we have a cool Raspi without too much noise
I will auto-launch Python applications during boot (including error logging)

Build-in a nice “battery fuel gauge”

 

Hack the gauge to provide a “battery low” signal for automatic shutdown

Useful commands:
Create Scripts directory:

cd
mkdir Scripts

cd Scripts

Python program:

wget http://www.sensorsiot.org/transferFiles/Pi_Zero_MQTT_Broker/fan_shutdown.py

Automatic Startup

cd

mkdir logs

cd Scripts

wget http://sensorsiot.org/transferFiles/Pi_Zero_MQTT_Broker/launcher.sh

chmod 755 launcher.sh

sudo crontab -e    (select “nano editor” if asked)

Fill in:
@reboot sh /home/pi/Scripts/launcher.sh >/home/pi/logs/cronlog 2>&1

Stress test:

wget http://www.sensorsiot.org/transferFiles/Pi_Zero_MQTT_Broker/powerTest2.sh

Additional links

http://www.instructables.com/id/Raspberry-Pi-Launch-Python-script-on-startup/?ALLSTEPS

https://www.element14.com/community/docs/DOC-78055/l/adding-a-shutdown-button-to-the-raspberry-pi-b