Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


This was knocked together on a Saturday afternoon when I was bored and the weather was rotten :) I've been using JSON APIs at work lately, so when I saw I couldn't resist!

What does it do

Note this is for the UK only

It is a fun piece of physical computing that runs on a Raspberry Pi with the Sense HAT board. The Sense HAT LEDs light in a colour representing the carbon footprint of your electricity over the next 3 hours. Green means completely renewable, through yellow and orange to red which means "as bad as gas". You can use this to inform decisions about your electricity usage.

Principle of operation

  • Queries the API at to get a carbon forecast for your region

  • Crunches it to get an average carbon intensity for your electricity for the next 3 hours

  • Lights all of the LEDs on the Sense HAT board in an appropriate colour. Pure green is a carbon intensity of 0, going through yellow to pure red at a carbon intensity of 215g/kWh.

  • The LEDs are dimmed between 11pm and 6am.

How to install

Use a Raspberry Pi with a Sense HAT board and the latest RaspiOS Lite ("Raspbian Buster Lite")

Get an internet connection for it and SSH access to it from a desktop machine.

Update the package lists with sudo apt-get update.

Install Git and clone this repository.

cd carbonhat

Reboot and it should start automatically


  • Make an INI file so other users can enter their own postcode instead of having mine hard coded :)

  • Make it actually control a dual fuel gas/electric heating system


Display carbon footprint of UK electricity on a Raspberry Pi/Sense HAT







No releases published


No packages published