Schlagwort: Raspberry Pi Zero WH

  • Monitor your GitHub build with a Raspberry Pi pumpkin

    Monitor your GitHub build with a Raspberry Pi pumpkin

    Reading Time: 4 minutes

    GitHub’s Martin Woodward has created a spooky pumpkin that warns you about the thing programmers find scariest of all — broken builds. Here’s his guest post describing the project:

    “When you are browsing code looking for open source projects, seeing a nice green passing build badge in the ReadMe file lets you know everything is working with the latest version of that project. As a programmer you really don’t want to accidentally commit bad code, which is why we often set up continuous integration builds that constantly check the latest code in our project.”

    “I decided to create a 3D-printed pumpkin that would hold a Raspberry Pi Zero with an RGB LED pHat on top to show me the status of my build for Halloween. All the code is available on GitHub alongside the 3D printing models which are also available on Thingiverse.”

    Components

    • Raspberry Pi Zero (I went for the WH version to save me soldering on the header pins)
    • Unicorn pHat from Pimoroni
    • Panel mount micro-USB extension
    • M2.5 hardware for mounting (screws, male PCB standoffs, and threaded inserts)

    “For the 3D prints, I used a glow-in-the-dark PLA filament for the main body and Pi holder, along with a dark green PLA filament for the top plug.”

    “I’ve been using M2.5 threaded inserts quite a bit when printing parts to fit a Raspberry Pi, as it allows you to simply design a small hole in your model and then you push the brass thread into the gap with your soldering iron to melt it securely into place ready for screwing in your device.”

    Threaded insert

    “Once the inserts are in, you can screw the Raspberry Pi Zero into place using some brass PCB stand-offs, place the Unicorn pHAT onto the GPIO ports, and then screw that down.”

    pHAT install

    “Then you screw in the panel-mounted USB extension into the back of the pumpkin, connect it to the Raspberry Pi, and snap the Raspberry Pi holder into place in the bottom of your pumpkin.”

    Inserting the base

    Code along with Martin

    “Now you are ready to install the software.  You can get the latest version from my PumpkinPi project on GitHub. “

    “Format the micro SD Card and install Raspberry Pi OS Lite. Rather than plugging in a keyboard and monitor, you probably want to do a headless install, configuring SSH and WiFi by dropping an ssh file and a wpa_supplicant.conf file onto the root of the SD card after copying over the Raspbian files.”

    “You’ll need to install the Unicorn HAT software, but they have a cool one-line installer that takes care of all the dependencies including Python and Git.”

    \curl -sS https://get.pimoroni.com/unicornhat | bash

    “In addition, we’ll be using the requests module in Python which you can install with the following command:”

    sudo pip install requests

    “Next you want to clone the git repo.”

    git clone https://github.com/martinwoodward/PumpkinPi.git

    “You then need to modify the settings to point at your build badge. First of all copy the sample settings provided in the repo:”

    cp ~/PumpkinPi/src/local_settings.sample ~/PumpkinPi/src/local_settings.py

    “Then edit the BADGE_LINK variable and point at the URL of your build badge.”

    # Build Badge for the build you want to monitor

    BADGE_LINK = "https://github.com/martinwoodward/calculator/workflows/CI/badge.svg?branch=main"

    # How often to check (in seconds). Remember - be nice to the server. Once every 5 minutes is plenty.

    REFRESH_INTERVAL = 300

    “Finally you can run the script as root:”

    sudo python ~/PumpkinPi/src/pumpkinpi.py &

    “Once you are happy everything is running how you want, don’t forget you can run the script at boot time. The easiest way to do this is to use crontab. See this cool video from Estefannie to learn more. But basically you do sudo crontab -e then add the following:”

    @reboot /bin/sleep 10 ; /usr/bin/python /home/pi/PumpkinPi/src/pumpkinpi.py &

    “Note that we are pausing for 10 seconds before running the Python script. This is to allow the WiFi network to connect before we check on the state of our build.”

    “The current version of the pumpkinpi script works with all the SVG files produced by the major hosted build providers, including GitHub Actions, which is free for open source projects. But if you want to improve the code in any way, I’m definitely accepting pull requests on it.”

    “Using the same hardware you could monitor lots of different things, such as when someone posts on Twitter, what the weather will be tomorrow, or maybe just code your own unique multi-coloured display that you can leave flickering in your window.”

    “If you build this project or create your own pumpkin display, I’d love to see pictures. You can find me on Twitter @martinwoodward and on GitHub.”

    Website: LINK

  • Remote humidity detector

    Remote humidity detector

    Reading Time: 3 minutes

    We know crawl spaces are creepy, sweaty, and confining but, hear us out…

    You need to keep an eye on the humidity level in your crawl space, as it can seriously affect the whole house’s overall health. It’s ideal to be able to do this remotely (given the creepy, sweaty atmosphere of the space), and a Raspberry Pi allows this.

    Jamie Bailey took to Medium to share his Raspberry Pi setup that allows him to monitor the humidity of the crawl space in his home from a mobile device and/or laptop. His setup lets you check on the current humidity level and also see the historical data over time. You can also set alarms to be sent to you via text or email whenever the humidity level exceeds a certain threshold.

    The hardware you need

    • Power outlet or extension cord in your crawl space
    • Raspberry Pi (3 or 4) or Raspberry Pi Zero W (or WH)
    • BME280 temperature/humidity sensor
    • Female-to-female jumper wires

    The software you need

    Jamie’s walk-through is extensive and includes all the command line code you’ll need too, so make sure to check it out if you attempt this build.

    Assembly

    The BME280 sensor has four pins you need to connect to your Raspberry Pi. This will send the humidity data to your Raspberry Pi, which you’ll have already set up to let you know what’s happening remotely.

    • BME280 VIN pin connects to GPIO pin 1 (3.3V)
    • BME280 GND pin connects to GPIO pin 6 (GND)
    • BME280 SCL pin connects to GPIO pin 5 (SCL)
    • BME280 SDA pin connects to GPIO pin 3 (SDA)
    You can see the Raspberry Pi in a black case hanging in the centre against a floor joist.

    Once you have all your software sorted and your hardware connected, turn your Raspberry Pi off and take it down to your crawl space (monitor, keyboard, and mouse are no longer necessary). Jamie advises hanging your Raspberry Pi from the floor joists instead of letting it touch the ground, to avoid contact with any water. He put a nail in one of the floor joists and draped the power cord over the nail (see above). Turn your tiny computer on, make sure data starts flowing into your dashboard, and you’ve got yourself remote humidity sensor!

    PS We’re English so… is a crawl space the same as an attic or what? Asking for a friend!

    Never mind, Alex asked her American girlfriend.

    Website: LINK

  • AIY Projects 2: Google’s AIY Projects Kits get an upgrade

    AIY Projects 2: Google’s AIY Projects Kits get an upgrade

    Reading Time: 3 minutes

    After the outstanding success of their AIY Projects Voice and Vision Kits, Google has announced the release of upgraded kits, complete with Raspberry Pi Zero WH, Camera Module, and preloaded SD card.

    Google AIY Projects Vision Kit 2 Raspberry Pi

    Google’s AIY Projects Kits

    Google launched the AIY Projects Voice Kit last year, first as a cover gift with The MagPi magazine and later as a standalone product.

    Makers needed to provide their own Raspberry Pi for the original kit. The new kits include everything you need, from Pi to SD card.

    Within a DIY cardboard box, makers were able to assemble their own voice-activated AI assistant akin to the Amazon Alexa, Apple’s Siri, and Google’s own Google Home Assistant. The Voice Kit was an instant hit that spurred no end of maker videos and tutorials, including our own free tutorial for controlling a robot using voice commands.

    Later in the year, the team followed up the success of the Voice Kit with the AIY Projects Vision Kit — the same cardboard box hosting a camera perfect for some pretty nifty image recognition projects.

    For more on the AIY Voice Kit, here’s our release video hosted by the rather delightful Rob Zwetsloot.

    AIY Projects adds natural human interaction to your Raspberry Pi

    Check out the exclusive Google AIY Projects Kit that comes free with The MagPi 57! Grab yourself a copy in stores or online now: http://magpi.cc/2pI6IiQ This first AIY Projects kit taps into the Google Assistant SDK and Cloud Speech API using the AIY Projects Voice HAT (Hardware Accessory on Top) board, stereo microphone, and speaker (included free with the magazine).

    AIY Projects 2

    So what’s new with version 2 of the AIY Projects Voice Kit? The kit now includes the recently released Raspberry Pi Zero WH, our Zero W with added pre-soldered header pins for instant digital making accessibility. Purchasers of the kits will also get a micro SD card with preloaded OS to help them get started without having to set the card up themselves.

    Google AIY Projects Vision Kit 2 Raspberry Pi

    Everything you need to build your own Raspberry Pi-powered Google voice assistant

    In the newly upgraded AIY Projects Vision Kit v1.2, makers are also treated to an official Raspberry Pi Camera Module v2, the latest model of our add-on camera.

    Google AIY Projects Vision Kit 2 Raspberry Pi

    “Everything you need to get started is right there in the box,” explains Billy Rutledge, Google’s Director of AIY Projects. “We knew from our research that even though makers are interested in AI, many felt that adding it to their projects was too difficult or required expensive hardware.”

    Google is also hard at work producing AIY Projects companion apps for Android, iOS, and Chrome. The Android app is available now to coincide with the launch of the upgraded kits, with the other two due for release soon. The app supports wireless setup of the AIY Kit, though avid coders will still be able to hack theirs to better suit their projects.

    Google has also updated the AIY Projects website with an AIY Models section highlighting a range of neural network projects for the kits.

    Get your kit

    The updated Voice and Vision Kits were announced last night, and in the US they are available now from Target. UK-based makers should be able to get their hands on them this summer — keep an eye on our social channels for updates and links.

    Website: LINK

  • Zero WH: pre-soldered headers and what to do with them

    Zero WH: pre-soldered headers and what to do with them

    Reading Time: 3 minutes

    If you head over to the website of your favourite Raspberry Pi Approved Reseller today, you may find the new Zero WH available to purchase. But what it is? Why is it different, and what can you do with it?

    Raspberry Pi Zero WH

    “If you like pre-soldered headers, and getting caught in the rain…”

    Raspberry Pi Zero WH

    Imagine a Raspberry Pi Zero W. Now add a professionally soldered header. Boom, that’s the Raspberry Pi Zero WH! It’s your same great-tasting Pi, with a brand-new…crust? It’s perfect for everyone who doesn’t own a soldering iron or who wants the soldering legwork done for them.

    What you can do with the Zero WH

    What can’t you do? Am I right?! The small size of the Zero W makes it perfect for projects with minimal wiggle-room. In such projects, some people have no need for GPIO pins — they simply solder directly to the board. However, there are many instances where you do want a header on your Zero W, for example in order to easily take advantage of the GPIO expander tool for Debian Stretch on a PC or Mac.

    GPIO expander in clubs and classrooms

    As Ben Nuttall explains in his blog post on the topic:

    [The GPIO expander tool] is a real game-changer for Raspberry Jams, Code Clubs, CoderDojos, and schools. You can live boot the Raspberry Pi Desktop OS from a USB stick, use Linux PCs, or even install [the Pi OS] on old computers. Then you have really simple access to physical computing without full Raspberry Pi setups, and with no SD cards to configure.

    Using the GPIO expander with the Raspberry Pi Zero WH decreases the setup cost for anyone interested in trying out physical computing in the classroom or at home. (And once you’ve stuck your toes in, you’ll obviously fall in love and will soon find yourself with multiple Raspberry Pi models, HATs aplenty, and an area in your home dedicated to your new adventure in Raspberry Pi. Don’t say I didn’t warn you.)

    Other uses for a Zero W with a header

    The GPIO expander setup is just one of a multitude of uses for a Raspberry Pi Zero W with a header. You may want the header for prototyping before you commit to soldering wires directly to a board. Or you may have a temporary build in mind for your Zero W, in which case you won’t want to commit to soldering wires to the board at all.

    Raspberry Pi Zero WH

    Your use case may be something else entirely — tell us in the comments below how you’d utilise a pre-soldered Raspberry Pi Zero WH in your project. The best project idea will receive ten imaginary house points of absolutely no practical use, but immense emotional value. Decide amongst yourselves who you believe should win them — I’m going to go waste a few more hours playing SLUG!

    Website: LINK