Category: Raspberry Pi

  • PurpleAir Raspberry Pi

    Purple Raspberry Pi

    With all the fires in California, I found myself checking PurpleAir multiple times per day to track what the air is like outside – waiting for a moment when the AQI improves so we can open some windows or take a walk.

    I have a bunch of Raspberry Pi boards handy, and two with the Pimoroni Unicorn Hat 64 RGB light array on them. This would work perfectly as a display for current air quality conditions.

    In addition I have a few of the Blink(1) USB lights. This will add even more color.

    There is example code provided in python for both the Unicorn Hat and the blink(1) light, so that would be easiest to throw something together in python.

    The basic premise is quite simple:

    • Fetch PurpleAir data from the website
    • Display colors on the Pi

    The script got a little more complicated in that I want it to:

    • Only hit PurpleAir once every x seconds
    • Update the colors on the Unicorn Hat slowly so we can more easily see when we are transitioning from one color to another
    • Show some indication that the script is still running
    • Handle HTTP errors gracefully

    I posted the code over on GitHub. Right now it’s pretty specific to my setup but will make it a bit more generic to work with more hardware options going forward.

    Code on GitHub

  • Raspberry Pi Zero OTG mode

    Configuring a Raspberry Pi Zero for the first time just got a lot easier.

    (more…)

  • Achieving high frame rate with a Raspberry Pi camera system

    When you read about using Raspberry Pi cameras as part of your home security system, most of the information you will find will point you in the direction of running motion which is the de-facto standard for doing video motion detection on Linux. There are also variants of motion such as MotionEye or motionEyeOS which provide a nicer UI on top of motion.

    Motion requires some horsepower to handle the video processing to detect motion, and also to run the web server and other features. On the modest hardware on the Raspberry Pi, I was only able to reliably achieve 4-10 frames-per-second at 800×600, depending on the Raspberry Pi model in use.

    Using this technique below, my camera system is now able to get closer to the full resolution for each Raspberry Pi camera which is 1920×1080 at 30 frames per second – and reliably running for years without issue.

    (more…)

  • Raspberry Pi phone home with IP address

    Sometimes it’s a pain to keep track of your Raspberry Pi’s IP address. Maybe you want to plug it in on a work or friend’s network without having to plug in a keyboard and mouse. This technique is what I am using to know the IP address of my Raspberry Pi’s no matter how often they change or what the IP address is.

    (more…)