A Threat Level Monitor For Everyone

A TV news pundit might on any given evening in 2024 look at the viewers and gravely announce that we are living in uncertain times. Those of us who’ve been around for a bit longer than we’d like to admit would see that, scratch our heads, and ask “Have we ever not lived in uncertain times?” If all this uncertainty is getting to you though, you can now reassure yourself as [Ian Williams] has, with a threat level monitor which displays the UK’s current level of projected fear threat level.

The build is fairly straightforward in hardware terms, with a Raspberry Pi Zero and a Pimoroni e-paper display pHAT. The software grabs the current level of doom from in this case the UK government’s website with a nifty bit of Python code, and turns it into an easy to read alert level bar.

So if you’re genuinely worried that the sky might fall upon your head you can now gain reassurance from a small piece of electronic hardware. If you feel things are really going south though, how about converting your basement into a fallout shelter?

25 thoughts on “A Threat Level Monitor For Everyone

  1. I could do with one of these for rabbits eating my fruit trees in my DEAD RAT CIDER orchard. I’m guessing it would need some kind of roving dog bot to patrol the site and infer the threat level through object recognition. Currently, the rabbits are at 140 m, but regularly try to populate new territory.

  2. I’ve been working on a similar project I call Doom, though my program checks many different indicators to determine if SHTF. So far it queries the number of power outages in many states (at least one from each grid), pings nodes across the country to check internet health, checks the NOAA CME alerts, and uses a 4G/GNSS HAT to get the number of GPS-type satellites in range (meaning they’re still alive and active). I’ll add this to it (as more informational, less ‘red alert’) as well as the Defcon level. I will be checking local power/internet/cellular status. I’m currently trying to get it to use an SDR to automatically detect and parse Emergency Alert System messages which has been difficult. I also want to automatically download live images from the NOAA satellites (using SDR/special antenna) as they pass overhead (which would also check the status of those satellites and show any mushroom cloud assuming the satellites are still active).

        1. Yeah, here it’s a case of when it says “Critical” they’re expecting an attack *right now* and Police, Security Services, Military, and any potential target’s security teams are on high alert, almost certainly due to specific time sensitive information – it’s not normally for public consumption.

    1. DEFCON is not officially published anywhere, so anything you find online which states “we’re currently at DEFCON 3” is speculation at best. Maybe check Homeland to see if they have a similar threat level indicator you could use instead, then modify the sentence code to match whatever sentence preceeds the threat level word.

    1. It does now!

      import requests
      from bs4 import BeautifulSoup
      import inkyphat
      import time
      import webbrowser # Added library to open webpages

      def update_image():
      url = “https://www.gov.uk/terrorism-national-emergency”
      response = requests.get(url)
      soup = BeautifulSoup(response.text, “html.parser”)

      sentence = soup.find(text=”The threat to the UK (England, Wales, Scotland and Northern Ireland) from terrorism is “)

      if sentence:
      next_word = sentence.find_next(“strong”)
      if next_word:
      next_word = next_word.text.strip().lower()
      print(f”Retrieved sentence: {sentence}”) # Debugging print
      print(f”Next word (image indicator): {next_word}”) # Debugging print
      if next_word in image_paths:
      inkyphat.clear() # Clear the display

      # Open URL if threat level is critical
      if next_word == “critical”:

      inkyphat.set_colour(“red”) # Specify the color of your Inky pHAT
      time.sleep(15) # Wait 5 seconds on boot

      image_paths = {
      “low”: “/home/pi/inky/images/1.png”,
      “medium”: “/home/pi/inky/images/2.png”,
      “substantial”: “/home/pi/inky/images/3.png”,
      “severe”: “/home/pi/inky/images/4.png”,
      “critical”: “/home/pi/inky/images/5.png”

      # Continuous loop to check for updates (alternative to schedule)
      while True:
      time.sleep(43200) # Update every 12 hours (43200 seconds)

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.