blog/_posts/2014-01-29-refresh-system-a...

1.7 KiB

title date url layout category
Refresh System [Active + Passive] 2014-01-29 refresh-system-active-passive post Hacking

{% include gallery.html URIs='refresh-system-active-passive_1.jpg;refresh-system-active-passive_2.jpg' %}

Passive refresh

I've bought and installed that Heat Dissipation for Raspberry.

Active refresh

I've installed a little fan, which is powered in continue by 3.3V of Raspberry.

To report out the temperature level inside the case, I've two LEDS (one green and one red), which are set on or off, controlled by a BASH script below, with GPIO Pins, as a function of measured temperature.

The surveillance of the temperature is run every minutes by Cron :

* * * * * bash /path/to/script/LED_Temp.sh > /dev/null

Fritzing of the wiring :

A missing blog post image

{% highlight bash %} #!/bin/bash

Author: Horloge-Skynet

Date: Begun 2014-01-26

Objective: Light up colored LED as a function of temperature

temp=$(/opt/vc/bin/vcgencmd measure_temp);

/usr/local/bin/gpio mode 4 out # Red LED /usr/local/bin/gpio mode 6 out # Green LED

if [${temp:5:2} -gt 30]; then

/usr/local/bin/gpio write 6 0 # Shutdown green LED
/usr/local/bin/gpio write 4 1 # Light up red LED

else

/usr/local/bin/gpio write 4 0 # Shutdown red LED
/usr/local/bin/gpio write 6 1 # Light up green LED

fi {% endhighlight %}