I have a Bash script (see below) which controls a relay via the GPIO pins. It works fine but I've noticed the CPU of the Pi gets very hot - up to 83C or so when it runs, up from around 40C when the Pi's idle.
I've looked at CPU usage and the script, which runs all the time, uses 16% of CPU.
Has anyone got any ideas why this overheating is happening?
Thanks.
#!/bin/bash
while true; do
s=$(date +%S)
if [ $s -eq 58 -o $s -eq 28 ]; then
sleep 1.9
echo "1" > /sys/class/gpio/gpio6/value
sleep 0.5
echo "0" > /sys/class/gpio/gpio6/value
sleep 1
fi
done