Tag Archives: Your Projects

Pumpkin Pi Build Monitor

Post Syndicated from Ashley Whittaker original https://www.raspberrypi.org/blog/pumpkin-pi-build-monitor/

Following on from Rob Zwetsloot’s Haunted House Hacks in the latest issue of The MagPi magazine, 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.”

The post Pumpkin Pi Build Monitor appeared first on Raspberry Pi.

Raspberry Pi High Quality security camera

Post Syndicated from Ashley Whittaker original https://www.raspberrypi.org/blog/raspberry-pi-high-quality-security-camera/

DJ from the element14 community shows you how to build a red-lensed security camera in the style of Portal 2 using the Raspberry Pi High Quality Camera.

The finished camera mounted on the wall

Portal 2 is a puzzle platform game developed by Valve — a “puzzle game masquerading as a first-person shooter”, according to Forbes.

DJ playing with the Raspberry Pi High Quality Camera

Kit list

No code needed!

DJ was pleased to learn that you don’t need to write any code to make your own security camera, you can just use a package called motionEyeOS. All you have to do is download the motionEyeOS image, pop the flashed SD card into your Raspberry Pi, and you’re pretty much good to go.

Dj got everything set up on a 5″ screen attached to the Raspberry Pi

You’ll find that the default resolution is 640×480, so it will show up as a tiny window on your monitor of choice, but that can be amended.

Simplicity

While this build is very simple electronically, the 20-part 3D-printed shell is beautiful. A Raspberry Pi is positioned on a purpose-built platform in the middle of the shell, connected to the Raspberry Pi High Quality Camera, which sits at the front of that shell, peeking out.

All the 3D printed parts ready to assemble

The 5V power supply is routed through the main shell into the base, which mounts the build to the wall. In order to keep the Raspberry Pi cool, DJ made some vent holes in the lens of the shell. The red LED is routed out of the side and sits on the outside body of the shell.

Magnetising

Raspberry Pi 4 (centre) and Raspberry Pi High Quality Camera (right) sat inside the 3D printed shell

This build is also screwless: the halves of the shell have what look like screw holes along the edges, but they are actually 3mm neodymium magnets, so assembly and repair is super easy as everything just pops on and off.

The final picture (that’s DJ!)

You can find all the files you need to recreate this build, or you can ask DJ a question, at element14.com/presents.

The post Raspberry Pi High Quality security camera appeared first on Raspberry Pi.

Global sunrise/sunset Raspberry Pi art installation

Post Syndicated from Ashley Whittaker original https://www.raspberrypi.org/blog/global-sunrise-sunset-raspberry-pi-art-installation/

24h Sunrise/Sunset is a digital art installation that displays a live sunset and sunrise happening somewhere in the world with the use of CCTV.

Image by fotoswiss.com

Artist Dries Depoorter wanted to prove that “CCTV cameras can show something beautiful”, and turned to Raspberry Pi to power this global project.

Image by fotoswiss.com

Harnessing CCTV

The arresting visuals are beamed to viewers using two Raspberry Pi 3B+ computers and an Arduino Nano Every that stream internet protocol (IP) cameras with the use of command line media player OMXPlayer.

Dual Raspberry Pi power

The two Raspberry Pis communicate with each other using the MQTT protocol — a standard messaging protocol for the Internet of Things (IoT) that’s ideal for connecting remote devices with a small code footprint and minimal network bandwidth.

One of the Raspberry Pis checks at which location in the world a sunrise or sunset is happening and streams the closest CCTV camera.

The insides of the sleek display screen…

Beam me out, Scotty

The big screens are connected with the I2C protocol to the Arduino, and the Arduino is connected serial with the second Raspberry Pi. Dries also made a custom printed circuit board (PCB) so the build looks cleaner.

All that hardware is powered by an industrial power supply, just because Dries liked the style of it.

Software

Everything is written in Python 3, and Dries harnessed the Python 3 libraries BeautifulSoup, Sun, Geopy, and Pytz to calculate sunrise and sunset times at specific locations. Google Firebase databases in the cloud help with admin by way of saving timestamps and the IP addresses of the cameras.

Hardware

The artist stood infront of the two large display screens
Image of the artist with his work by fotoswiss.com

And, lastly, Dries requested a shoutout for his favourite local Raspberry Pi shop Gotron in Ghent.

The post Global sunrise/sunset Raspberry Pi art installation appeared first on Raspberry Pi.

It’s a brand-new NODE Mini Server!

Post Syndicated from Ashley Whittaker original https://www.raspberrypi.org/blog/its-a-brand-new-node-mini-server/

NODE has long been working to create open-source resources to help more people harness the decentralised internet, and their easily 3D-printed designs are perfect to optimise your Raspberry Pi.

NODE wanted to take advantage of the faster processor and up to 8GB RAM on Raspberry Pi 4 when it came out last year. Now that our tiny computer is more than capable of being used as as a general Linux desktop system, the NODE Mini Server version 3 has been born.

As for previous versions of NODE’s Mini Server, one of their main goals for this new iteration was to package Raspberry Pi in a way which makes it a little easier to use as a regular mini server or computer. In other words, it’s put inside a neat little box with all the ports accessible on one side.

Black is incredibly slimming

Slimmer and simpler

The latest design is simplified compared to previous versions. Everything lives in a 92mm × 92mm enclosure that isn’t much thicker than Raspberry Pi itself.

The slimmed-down new case comprises a single 3D-printed piece and a top cover made from a custom-designed printed circuit board (PCB) that has four brass-threaded inserts soldered into the corners, giving you a simple way to screw everything together.

The custom PCB cover

What are the new features?

Another goal for version 3 NODE’s Mini Server was to include as much modularity as possible. That’s why this new mini server requires no modifications to the Raspberry Pi itself, thanks to a range of custom-designed adapter boards. How to take advantage of all these new features is explained at this point in NODE’s YouTube video.

Ooh, shiny and new and new and shiny

Just like for previous versions, all the files and a list of the components you need to create your own Mini Server are available for free on the NODE website.

Leave comments on NODE’s YouTube video if you’d like to create and sell your own Mini Server kits or pre-made servers. NODE is totally open to showcasing any add-ons or extras you come up with yourself.

Looking ahead, making the Mini Server stackable and improving fan circulation is next on NODE’s agenda.

The post It’s a brand-new NODE Mini Server! appeared first on Raspberry Pi.

Raspberry Pi Off-World Bartender

Post Syndicated from Ashley Whittaker original https://www.raspberrypi.org/blog/raspberry-pi-off-world-bartender/

Three things we like: Blade Runner, robots, and cocktails. That’s why we LOVE Donald Bell‘s Raspberry Pi–packed ‘VK-01 Off-World Bartender‘ cocktail making machine.

This machine was due to be Donald’s entry into the Cocktail Robotics Grand Challenge, an annual event in San Francisco. By the time the event was cancelled, he was too deep into his awesome build to give up, so he decided to share it with the Instructables community instead.

Donald wanted users to get as much interaction and feedback as possible, rather than simply pressing a button and receiving a random drink. So with this machine, the interaction comes in four ways: instructions provided on the screen, using a key card to bypass security, placing and removing a cup on the tray, and entering an order number on the keypad.

In addition to that, feedback is provided by way of lighting changes, music, video dialogue, pump motors whirring, and even the clicks of relays at each stage of the cocktail making process.

Ordering on the keypad

close up of the black keypad

The keypad allows people to punch in a number to trigger their order, like on a vending machine. The drink order is sent to the Hello Drinkbot software running on the Raspberry Pi 3B that controls the pumps.

Getting your cup filled

Inside the cup dispenser sensor showing the switch and LEDs
The switch under the lid and ring of LEDs on the base

In order for the machine to be able to tell when a vessel is placed under the dispenser spout, and when it’s removed, Donald built in a switch under a 3D-printed tray. Provided the vessel has at least one ice cube in it, even the lightest plastic up is heavy enough to trigger the switch.

The RFID card reader

Cocktail machine customers are asked to scan a special ID card to start. To make this work, Donald adapted a sample script that blinks the card reader’s internal LED when any RFID card is detected.

Interactive video screen

close up of the interactive screen on the machine showing Japanese style script

This bit is made possible by MP4Museum, a “bare-bones” kiosk video player software that the second Raspberry Pi inside the machine runs on boot. By connecting a switch to the Raspberry Pi’s GPIO, Donald enabled customers to advance through the videos one by one. And yes, that’s an official Raspberry Pi Touch Display.

Behind the scenes of the interactive screen with the Raspberry Pi wired up
Behind the scenes of the screen with the Raspberry Pi A+ running the show

The Hello Drinkbot ‘bartender’

screen grab of the hello drinkbot web interface

Donald used the Python-based Hello Drinkbot software as the brains of the machine. With it, you can configure which liquors or juices are connected to which pumps, and send instructions on exactly how much to pour of each ingredient. Everything is configured via a web interface.

Via a bank of relays, microcontrollers connect all the signals from the Touch Display, keypad, RFID card reader, and switch under the spout.

Here’s the Fritzing diagram for this beast

Supplies

Donald shared an exhaustive kit list on his original post, but basically, what you’re looking at is…

Pencil sketches of the machine from different angles
Donald’s friend Jim Burke‘s beautiful concept sketches

And finally, check out the Raspberry Pi–based Hello Drinkbot project by Rich Gibson, which inspired Donald’s build.

The post Raspberry Pi Off-World Bartender appeared first on Raspberry Pi.

Steampunk ‘Help is coming’ Raspberry Pi alert system

Post Syndicated from Ashley Whittaker original https://www.raspberrypi.org/blog/steampunk-help-is-coming-raspberry-pi-alert-system/

Tom Lee decided to combine his household with his sister-in-law during lockdown so that she could help him make childcare more manageable. The problem was, Tom’s household was a smidge frantic in the mornings, as the family struggled to be up and ready in time for his sister-in-law’s arrival.

Enter this Raspberry Pi–powered tracking device, which tells Tom when the family car is on its way with childcare support. The DIY appliance helps his household manage childcare routines like clockwork.

The magic is in the wooden box, but the light cage and electrical meter are all part of the show

When the family car is moving, a light turns on, and an antique electrical meter points to 30…20…10 to show the estimated minutes until the driver arrives. The movements of the car come in from a cellular Sinotrack OBD2 dongle pointed at a traccar server running on Raspberry Pi 3.

We see you in there, Raspberry Pi…

Tom explains: “I have not found traccar to be the greatest to work with, but you can make it forward everything it decodes to your own script pretty easily.”

Materials:

  • Arduino microcontrollers (ATMega328P & ESP8266 based)
  • Raspberry Pi (Model 1 and 3)
  • Dongle device in car (with SIM card and cellular service)
  • Light device with bulb and solid state relay
  • Antique electrical meter (for the steampunks among you – any similar device will do the job!) 
The light safety cage was rescued from an old workshop

The case (below) is a lasercut design Tom had made by online laser cutting business Ponoko.

Inside there’s a solid state relay and a first-generation Raspberry Pi (hidden under the black cable in the photo below). This Raspberry Pi model doesn’t have wireless connectivity, and Tom found that getting wireless working was a bit tricky for this project.

Tom produced a nice long webinar to show you exactly how this all works. So if you’d like to give this project a try, watch it for yourself.

You’ll learn how to…

Code resources

Oh, and he’s only gone and uploaded every single bit of code you’ll need on GitHub (what an angel):

The post Steampunk ‘Help is coming’ Raspberry Pi alert system appeared first on Raspberry Pi.

Mini Raspberry Pi Boston Dynamics–inspired robot

Post Syndicated from Ashley Whittaker original https://www.raspberrypi.org/blog/mini-raspberry-pi-boston-dynamics-inspired-robot/

This is a ‘Spot Micro’ walking quadruped robot running on Raspberry Pi 3B. By building this project, redditor /thetrueonion (aka Mike) wanted to teach themself robotic software development in C++ and Python, get the robot walking, and master velocity and directional control.

Mike was inspired by Spot, one of Boston Dynamics’ robots developed for industry to perform remote operation and autonomous sensing.

What’s it made of?

  • Raspberry Pi 3B
  • Servo control board: PCA9685, controlled via I2C
  • Servos: 12 × PDI-HV5523MG
  • LCD Panel: 16×2 I2C LCD panel
  • Battery: 2s 4000 mAh LiPo, direct connection to power servos
  • UBEC: HKU5 5V/5A ubec, used as 5V voltage regulator to power Raspberry Pi, LCD panel, PCA9685 control board
  • Thingiverse 3D-printed Spot Micro frame

How does it walk?

The mini ‘Spot Micro’ bot rocks a three-axis angle command/body pose control mode via keyboard and can achieve ‘trot gait’ or ‘walk gait’. The former is a four-phase gait with symmetric motion of two legs at a time (like a horse trotting). The latter is an eight-phase gait with one leg swinging at a time and a body shift in between for balance (like humans walking).

Mike breaks down how they got the robot walking, right down to the order the servos need to be connected to the PCA9685 control board, in this extensive walkthrough.

Here’s the code

And yes, this is one of those magical projects with all the code you need stored on GitHub. The software is implemented on a Raspberry Pi 3B running Ubuntu 16.04. It’s composed on C++ and Python nodes in a ROS framework.

What’s next?

Mike isn’t finished yet: they are looking to improve their yellow beast by incorporating a lidar to achieve simple 2D mapping of a room. Also on the list is developing an autonomous motion-planning module to guide the robot to execute a simple task around a sensed 2D environment. And finally, adding a camera or webcam to conduct basic image classification would finesse their creation.

The post Mini Raspberry Pi Boston Dynamics–inspired robot appeared first on Raspberry Pi.

Track your punches with Raspberry Pi

Post Syndicated from Ashley Whittaker original https://www.raspberrypi.org/blog/track-your-punches-with-raspberry-pi/

‘Track-o-punches’ tracks the number of punches thrown during workouts with Raspberry Pi and a Realsense camera, and it also displays your progress and sets challenges on a touchscreen.

In this video, Cisco shows you how to set up the Realsense camera and a Python virtual environment, and how to install dependencies and OpenCV for Python on your Raspberry Pi.

How it works

A Realsense robotic camera tracks the boxing glove as it enters and leaves the frame. Colour segmentation means the camera can more precisely pick up when Cisco’s white boxing glove is in frame. He walks you through how to threshold images for colour segmentation at this point in the video.

Testing the tracking

All this data is then crunched on Raspberry Pi. Cisco’s code counts the consecutive frames that the segmented object is present; if that number is greater than a threshold, the code sees this as a particular action.

Raspberry Pi 4 being mounted on the Raspberry Pi 7″ Touch Display

Cisco used this data to set punch goals for the user. The Raspberry Pi computer is connected to an official Raspberry Pi 7″ Touch Display in order to display “success” and “fail” messages as well as the countdown clock. Once a goal is reached, the touchscreen tells the boxer that they’ve successfully hit their target. Then the counter resets and a new goal is displayed. You can manipulate the code to set a time limit to reach a punch goal, but setting a countdown timer was the hardest bit to code for Cisco.

Kit list

Jeeeez, it’s hard to get a screen grab of Cisco’s fists of fury

A mobile power source makes it easier to set up a Raspberry Pi wherever you want to work out. Cisco 3D-printed a mount for the Realsense camera and secured it on the ceiling so it could look down on him while he punched.

The post Track your punches with Raspberry Pi appeared first on Raspberry Pi.

Auto-blow bubbles with a Raspberry Pi-powered froggy

Post Syndicated from Ashley Whittaker original https://www.raspberrypi.org/blog/auto-blow-bubbles-with-a-raspberry-pi-powered-froggy/

8 Bits and a Byte created this automatic bubble machine, which is powered and controlled by a Raspberry Pi and can be switched on via the internet by fans of robots and/or bubbles.

They chose a froggy-shaped bubble machine, but you can repurpose whichever type you desire; it’s just easier to adapt a model running on two AA batteries.

Raspberry Pi connected to the relay module

Before the refurb, 8 Bits and a Byte’s battery-powered bubble machine was controlled by a manual switch, which turned the motor on and off inside the frog. If you wanted to watch the motor make the frog burp out bubbles, you needed to flick this switch yourself.

After dissecting their plastic amphibian friend, 8 Bits and a Byte hooked up its motor to Raspberry Pi using a relay module. They point to this useful walkthrough for help with connecting a relay module to Raspberry Pi’s GPIO pins.

Now the motor inside the frog can be turned on and off with the power of code. And you can become controller of bubbles by logging in here and commanding the Raspberry Pi to switch on.

A screenshot of the now automated frog in situ as seen on the remo dot tv website

To let the internet’s bubble fans see the fruits of their one-click labour, 8 Bits and a Byte set up a Raspberry Pi Camera Module and connected their build to robot streaming platform remo.tv.

Bubble soap being poured into the plastic frog's mouth
Don’t forget your bubble soap!

Kit list:

The only remaining question is: what’s the best bubble soap recipe?

The post Auto-blow bubbles with a Raspberry Pi-powered froggy appeared first on Raspberry Pi.

Remote humidity detector

Post Syndicated from Ashley Whittaker original https://www.raspberrypi.org/blog/remote-humidity-detector/

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.

Crawl space humidity monitor dashboard — live version at https://go.init.st/fcpp6ll

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.

Crawl space humidity mobile dashboard — live version at https://go.init.st/ol4pfy0

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.

The post Remote humidity detector appeared first on Raspberry Pi.

Who needs vinyl records when you’ve got Raspberry Pi and NFC?

Post Syndicated from Ashley Whittaker original https://www.raspberrypi.org/blog/who-needs-vinyl-records-when-youve-got-raspberry-pi-and-nfc/

Redditor Mark Hank missed the tactile experience of vinyl records so he removed the insides of an old Sonos Boost to turn it into a Raspberry Pi- and NFC-powered music player. Yes, this really works:

The Sonos Boost was purchased for just £3 on eBay. Mark pulled all the original insides out of it and repurposed it as what they call a ‘vinyl emulator’ to better replicate the experience of playing records than what a simple touchscreen offers.

The Boost now contains a Raspberry Pi 3A+ and an ACR122U NFC reader, and it plays a specific album, playlist, or radio station when you tap a specific NFC tag on it. It’s teamed with Sonos speakers, and NTAG213 NFC tags. The maker recommends you go with the largest tags you can find, as it will improve read performance; they went with these massive ones.

One of the album covers printed onto thick card

The tags are inside printouts mounted on 1mm thick card (those album cover artwork squares getting chucked at the Sonos in the video), and they’re “super cheap” according to the maker.

You’ll need to install the node-sonos-http-api package on your Raspberry Pi; it’s the basis of the whole back-end of the project. The maker provides full instructions on their original post, including on how to get Spotify up and running on your Raspberry Pi.

The whole setup neatened up

Rather than manually typing HTTP requests into a web browser, the maker wanted to automate the process so that the Raspberry Pi does it when presented with certain stimulus (aka when the NFC reader is triggered). They also walk you through this process in their step-by-step instructions.

How the maker hid the mess under the display table

The entire build cost around £50, and the great thing is that it doesn’t need to sit inside an old Sonos Boost if you don’t want it to. The reader works through modest-width wood, so you can mount it under a counter, install it in a ‘now listening’ stand, whatever — it’s really up to you.

Full instructions are available on hackster.io! And here’s all the code you’ll need, handily stored on GitHub.

The post Who needs vinyl records when you’ve got Raspberry Pi and NFC? appeared first on Raspberry Pi.

Go sailing with this stop-motion 3D-printed boat

Post Syndicated from Ashley Whittaker original https://www.raspberrypi.org/blog/go-sailing-with-this-stop-motion-3d-printed-boat/

Shot on a Raspberry Pi Camera Module, this stop-motion sequence is made up of 180 photos that took two hours to shoot and another hour to process.

The trick lies in the Camera Module enabling you to change the alpha transparency of the overlay image, which is the previous frame. It’s all explained in the official documentation, but basically, the Camera Module’s preview permits multiple layers to be rendered simultaneously: text, image, etc. Being able to change the transparency from the command line means this maker could see how the next frame (or the object) should be aligned. In 2D animation, this process is called ‘onion skinning’.

You can see the Raspberry Pi Camera Module on the bottom left in front of Yuksel’s hand

So why the Raspberry Pi Camera Module? Redditor /DIY_Maxwell aka Yuksel Temiz explains: “I make stop-motion animations as a hobby, using either my SLR or phone with a remote shutter. In most cases I didn’t need precision, but some animations like this are very challenging because I need to know the exact position of my object (the boat in this case) in each frame. The Raspberry Pi camera was great because I could overlay the previously captured frame into the live preview, and I could quickly change the transparency of the overlay to see how precise the location and how smooth the motion.”

You can easily make simple, linear stop-motion videos by just capturing your 3D printer while it’s doing its thing. Yuksel created a bolting horse (above) in that way. The boat sequence was more complicated though, because it rotates, and because pieces had to be added and removed.

The official docs are really comprehensive and span basic to advanced skill levels. Yuksel even walks you through getting started with the installation of Raspberry Pi OS.

Yuksel’s Raspberry Pi + Lego microscope

We’ve seen Yuksel’s handiwork before, and this new project was made in part by modifying the code from the open-source microscope (above) they made using Raspberry Pi and LEGO. They’re now planning to make a nice GUI and share the project as an open-source stop-motion animation tool.

The post Go sailing with this stop-motion 3D-printed boat appeared first on Raspberry Pi.

Travel the world with a retro musical phone

Post Syndicated from Ashley Whittaker original https://www.raspberrypi.org/blog/travel-the-world-with-a-retro-musical-phone/

This rotary phone features a built-in Raspberry Pi that communicates with radiooooo.com (a musical time machine) and an Arduino working behind the map to control the selection of the country. Just pick up the phone, choose a country and a decade, and listen to some great music!

How does it work?

The Raspberry Pi:

  • Plays music through radiooooo.com
  • Detects when the handset is picked up/put down
  • Detects the numbers that are dialled in

The Arduino:

  • Detects which country is selected on the map (via jack connectors)
  • Sends the info to the Raspberry Pi over serial

We saw this project on hackster.io and loved how maker Caroline Buttet dug into the finer detail of an old-fashioned rotary phone’s pick-up/put-down mechanism, as well as how the phone knows which numbers you’re dialling. She goes into more detail about that aspect in the second build video, above.

An audio jack being plugged into a world map mounted on a board

Some countries have a jack pin -- this is how you select the music

Other bits you’ll need

As well as a Raspberry Pi 4 and Arduino UNO, you’ll need a world map (obviously) and something to mount it on which can be drilled into. This is because the jack pins you can see in the image above need to poke out of different countries.

Caroline’s grandma donated the old rotary phone she used for this project. You should be able to pick one up from a second-hand shop or, if you can get a new handset made in the retro style online.

The shopping list for this build also includes: jumper wires; audio/video cable assembly; LED, breadboard; jack socket 3-pin; resistors

A simplified visual representation of how everything works

In her original post, Caroline explains in detail how to connect the rotary phone’s switches to the pins on your Raspberry Pi, how to build in audio sockets on the board you glue your map to, how to run the necessary Python script from the command line, and what a Chrome extension to use to make radiooooo.com work with your Raspberry Pi.

The Raspberry Pi inside the rotary phone

And yes, Caroline is one of those most magical of makers who deposits all the code needed for this build on GitHub!

And here’s the Arduino mounted onto the back of the map, with the audio jacks taped up to the holes drilled into different countries

The post Travel the world with a retro musical phone appeared first on Raspberry Pi.

Deep learning cat prey detector

Post Syndicated from Ashley Whittaker original https://www.raspberrypi.org/blog/deep-learning-cat-prey-detector/

We’ve all been able to check on our kitties’ outdoor activities for a while now, thanks to motion-activated cameras. And the internet’s favourite cat flap even live-tweets when it senses paws through the door.

A nightvision image of a cat approaching a cat flap with a mouse in its mouth

“Did you already make dinner? I stopped on the way home to pick this up for you.”

But what’s eluded us “owners” of felines up until now is the ability to stop our furry companions from bringing home mauled presents we neither want nor asked for.

A cat flap bouncer powered by deep learning

Now this Raspberry Pi–powered machine learning build, shared by reddit user u/eee_bume, can help us out: at its heart, there’s a convolutional neural network cascade that detects whether a cat is trying to enter a cat flap with something in its maw. (No word from the creators on how many half-consumed rodents the makers had to dispose of while training the machine learning model.)

The neural network first detects the whole cat in an image; then it hones in on the cat’s maw. Image classification is performed to detect whether there is anything in or around the maw. If the network thinks the cat is trying to smuggle caught contraband into the house, it’s a “no” from this virtual door bouncer.

The system runs on Raspberry Pi 4 with an infrared camera at an average detection rate of  around 1 FPS. The PC-Val value, representing the certainty of the prey classification => prey/no_prey certainty threshold, is 0.5.

The home made set up including small camera lights and sensors

The infrared camera setup, powered by Raspberry Pi

How to get enough training data

This project formed Nicolas Baumann’s and Michael Ganz’s spring semester thesis at the Swiss Federal Institute of Technology. One of the problems they ran into while trying to train their device is that cats are only expected to enter the cat flap carrying prey 3% of the time, which leads to a largely imbalanced classification problem. It would have taken a loooong time if they had just waited for Nicolas and Michael’s pets to bring home enough decomposing gifts.

Lots of different cats faces close up, some with prey in their mouths, some without

The cutest mugshots you ever did see

To get around this, they custom-built a scalable image data gathering network to simplify and maximise the collection of training data. It features multiple distributed Camera Nodes (CN), a centralised main archive, and a custom labeling tool. As a result of the data gathering network, 40GB of training data have been amassed.

What is my cat eating?!

The makers also took the time to train their neural network to classify different types of prey. So far, it recognises mice, lizards, slow-worms, and birds.

Infrared shots of one cat while the camera decides if it has prey in its mouth or not

“Come ooooon, it’s not even a *whole* mouse, let me in!”

It’s still being tweaked, but at the moment the machine learning model correctly detects when a cat has prey in its mouth 93% of the time. But it still falsely accuses kitties 28% of the time. We’ll leave it to you to decide whether your feline companion will stand for that kind of false positive rate, or whether it’s more than your job’s worth.

The post Deep learning cat prey detector appeared first on Raspberry Pi.

Be a better Scrabble player with a Raspberry Pi High Quality Camera

Post Syndicated from Ashley Whittaker original https://www.raspberrypi.org/blog/be-a-better-scrabble-player-with-a-raspberry-pi-high-quality-camera/

One of our fave makers, Wayne from Devscover, got a bit sick of losing at Scrabble (and his girlfriend was likely raging at being stuck in lockdown with a lesser opponent). So he came up with a Raspberry Pi–powered solution!

Using a Raspberry Pi High Quality Camera and a bit of Python, you can quickly figure out the highest-scoring word your available Scrabble tiles allow you to play.

Hardware

  • Raspberry Pi 3B
  • Compatible touchscreen
  • Raspberry Pi High Quality Camera
  • Power supply for the touchscreen and Raspberry Pi
  • Scrabble board

You don’t have to use a Raspberry Pi 3B, but you do need a model that has both display and camera ports. Wayne also chose to use an official Raspberry Pi Touch Display because it can power the computer, but any screen that can talk to your Raspberry Pi should be fine.

Software

Firstly, the build takes a photo of your Scrabble tiles using raspistill.

Next, a Python script processes the image of your tiles and then relays the highest-scoring word you can play to your touchscreen.

The key bit of code here is twl, a Python script that contains every possible word you can play in Scrabble.

From 4.00 minutes into his build video, Wayne walks you through what each bit of code does and how he made it work for this project, including how he installed and used the Scrabble dictionary.

Fellow Scrabble-strugglers have suggested sneaky upgrades in the comments of Wayne’s YouTube video, such having the build relay answers to a more discreet smart watch.

No word yet on how the setup deals with the blank Scrabble tiles; those things are like gold dust.

In case you haven’t met the Raspberry Pi High Quality Camera yet, Wayne also did this brilliant unboxing and tutorial video for our newest piece of hardware.

And for more projects from Devscover, check out this great Amazon price tracker using a Raspberry Pi Zero W, and make sure to subscribe to the channel for more content.

The post Be a better Scrabble player with a Raspberry Pi High Quality Camera appeared first on Raspberry Pi.

Raspberry Pi High Quality Camera powers up homemade microscope

Post Syndicated from Ashley Whittaker original https://www.raspberrypi.org/blog/raspberry-pi-high-quality-camera-powers-up-homemade-microscope/

Wow, DIY-Maxwell, wow. This reddit user got their hands on one of our new Raspberry Pi High Quality Cameras and decided to upgrade their homemade microscope with it. The brains of the thing are also provided by a Raspberry Pi.

Key features

  • Raspberry Pi OS
  • 8 MegaPixel CMOS camera (Full HD 30 fps video)
  • Imaging features from several centimetres to several micrometers without changing the lens
  • 6 stepper motors (X, Y, tilt, rotation, magnification, focus)
  • Variable speed control using a joystick controller or keyboard
  • Uniform illumination for imaging reflective surface
  • Modular design: stages and modules can be arranged in any configuration depending on the application

Here’s what a penny looks like under this powerful microscope:

Check out this video from the original reddit post to see the microscope in action.

Bill of materials

Click image to enlarge

The user has put together very detailed, image-led build instructions walking you through how to create the linear actuators, camera setup, rotary stage, illumination, title mechanism, and electronics.

The project uses a program written in Python 3 (MicroscoPy.py) to control the microscope, modify camera settings, and take photos and videos controlled by keyboard input.

Click image to enlarge

Here is a quick visual to show you the exact ports you need for this project on whatever Raspberry Pi you have:

Click image to enlarge

In the comments of the original reddit post, DIY_Maxwell explains that $10 objective lens used in the project limited the Raspberry Pi High Quality Camera’s performance. They predict you can expect even better images with a heavier investment in the lens.

The project is the result of a team at IBM Research–Europe, in Zurich, who develop microfluidic technologies for medical applications, needing to provide high-quality photos and videos of their microfluidic chips.

In a blog for IEEE Spectrum, IBM team member Yuksel Temiz explains: “Taking a photo of a microfluidic chip is not easy. The chips are typically too big to fit into the field of view of a standard microscope, but they have fine features that cannot be resolved using a regular camera. Uniform illumination is also critical because the chips are often made of highly reflective or transparent materials. Looking at publications from other research groups, it’s obvious that this is a common challenge. With this motivation, I devoted some of my free time to designing a multipurpose and compact lab instrument that can take macro photos from almost any angle.”

Here’s the full story about how the Raspberry Pi-powered creation came to be.

And for some extra-credit homework, you can check out this document comparing the performance of the microscope using our Raspberry Pi Camera Module v2 and the High Quality Camera. The key takeaway for those wishing to upgrade their old projects with the newer camera is to remember that it’s heavier and 50% bigger, so you’ll need to tweak your housing to fit it in.

The post Raspberry Pi High Quality Camera powers up homemade microscope appeared first on Raspberry Pi.

Learning with Raspberry Pi — robotics, a Master’s degree, and beyond

Post Syndicated from Ashley Whittaker original https://www.raspberrypi.org/blog/learning-with-raspberry-pi-robotics-a-masters-degree-and-beyond/

Meet Callum Fawcett, who shares his journey from tinkering with the first Raspberry Pi while he was at school, to a Master’s degree in computer science and a real-life job in programming. We also get to see some of the awesome projects he’s made along the way.

I first decided to get a Raspberry Pi at the age of 14. I had already started programming a little bit before and found that I really enjoyed the language Python. At the time the first Raspberry Pi came out, my History teacher told us about them and how they would be a great device to use to learn programming. I decided to ask for one to help me learn more. I didn’t really know what I would use it for or how it would even work, but after a little bit of help at the start, I quickly began making small programs in Python. I remember some of my first programs being very simple dictionary-type programs in which I would match English words to German to help with my German homework.

Learning Linux, C++, and Python

Most of my learning was done through two sources. I learnt Linux and how the terminal worked using online resources such as Stack Overflow. I would have a problem that I needed to solve, look up solutions online, and try out commands that I found. This was perhaps the hardest part of learning how to use a Raspberry Pi, as it was something I had never done before, but it really helped me in later years when I would use Linux more than Windows. For learning programming, I preferred to use books. I had a book for C++ and a book for Python that I would work through. These were game-based books, so many of the fun projects that I did were simple text-based games where you typed in responses to questions.

A family robotics project

The first robot Callum made using a Raspberry Pi

By far the coolest project I did with the Raspberry Pi was to build a small robot (shown above). This was a joint project between myself and my dad. He sorted out the electronics and I programmed the robot. It was a great opportunity to learn about robotics and refine my programming skills. By the end, the robot was capable of moving around by itself, driving into objects, and then reversing and trying a new direction. It was almost like an unintelligent Roomba that couldn’t hoover, but I spent many hours improving small bits and pieces to make it as easy to use as possible. My one wish that I never managed to achieve with my robot was allowing it to map out its surroundings. This was a very ambitious project at the time, since I was still quite inexperienced in programming. The biggest problem with this was calibrating the robot’s turning circle, which was never consistent so it was very hard to have the robot know where in the room it was.

Sense HAT maze game

Another fun project that I worked on used the Sense HAT developed for the Astro Pi computers for use on the International Space Station. Using this, I was able to make a memory maze game (shown below), in which a player is shown a maze for several seconds and then has to navigate that maze from memory by shaking the device. This was my first introduction to using more interactive types of input, and this eventually led to my final-year project, which used these interesting interactions to develop another way of teaching.

Learning programming without formal lessons

I have now just finished my Master’s degree in computer science at the University of Bristol. Before going to university, I had no experience of being taught programming in a formal environment. It was not a taught subject at my secondary school or sixth form. I wanted to get more people at my school interested in this area of study though, which I did by running a coding club for people. I would help others debug their code and discuss interesting problems with them. The reason that I chose to study computer science is largely because of my experiences with Raspberry Pi and other programming I did in my own time during my teenage years. I likely would have studied history if it weren’t for the programming I had done by myself making robots and other games.

Raspberry Pi has continued to play a part in my degree and extra-curricular activities; I used them in two large projects during my time at university and used a similar device in my final project. My robot experience also helped me to enter my university’s ‘Robot Wars’ competition which, though we never won, was a lot of fun.

A tool for learning and a device for industry

Having a Raspberry Pi is always useful during a hackathon, because it’s such a versatile component. Tech like Raspberry Pi will always be useful for beginners to learn the basics of programming and electronics, but these computers are also becoming more and more useful for people with more experience to make fun and useful projects. I could see tech like Raspberry Pi being used in the future to help quickly prototype many types of electronic devices and, as they become more powerful, even being used as an affordable way of controlling many types of robots, which will become more common in the future.

Our guest blogger Callum

Now I am going on to work on programming robot control systems at Ocado Technology. My experiences of robot building during my years before university played a large part in this decision. Already, robots are becoming a huge part of society, and I think they are only going to become more prominent in the future. Automation through robots and artificial intelligence will become one of the most important tools for humanity during the 21st century, and I look forward to being a part of that process. If it weren’t for learning through Raspberry Pi, I certainly wouldn’t be in this position.

Cheers for your story, Callum! Has tinkering with our tiny computer inspired your educational or professional choices? Let us know in the comments below. 

The post Learning with Raspberry Pi — robotics, a Master’s degree, and beyond appeared first on Raspberry Pi.

Raspberry Pi–powered bonsai watering system

Post Syndicated from Ashley Whittaker original https://www.raspberrypi.org/blog/raspberry-pi-powered-bonsai-watering-system/

Bonsai trees are the most glorious of miniature shrubbery. But caring for them takes seriously green fingers. Luckily, this Raspberry Pi–powered bonsai watering system doesn’t require much to get started. Also, the Reddit user who shared the project is named Lord-of-the-Pis, so, we love.

You will need:

  • Raspberry Pi
  • Submersible water pump
  • Jumper wires

The Pimoroni Explorer HAT Pro isn’t essential to make this project work, it just makes things a whole lot easier by removing the need for a relay. It also comes with a Python library for interfacing with Raspberry Pi. The project uses an I2C connection, so it would also be possible to not use the HAT and instead plug a moisture sensor into an analogue-to-digital converter and then into Raspberry Pi’s GPIO pins.

How was it done?

Lord-of-the-Pis explains: “I used the Pimoroni Explorer HAT Pro in order to make the entire system on a small breadboard on top of  Raspberry Pi. The Explorer HAT has inbuilt analogue inputs over I2C, which I used for the input of the moisture sensor (two wires pushed into the soil as probes). Furthermore, the output GPIO pins on this HAT sink all current to ground when activated so they can be used as a transistor to power the small 5V motor (which was also attached to the 5V power pins on Raspberry Pi).”

Using the HAT also allowed this maker to simply hook the pump up to the GPIO pins and turn these on and off, so there’s no need for an on/off switch.

How does it work?

This project’s code is in Python 3, and you can find it all on GitHub.

The main watering program (plantWater.py) takes input from the moisture sensor, and if the soil moisture level is below a set amount, the bonsai gets watered.

Lord-of-the-Pis built a simple web interface for the project on a  localhost site that’s hosted using Apache. Apache SSI is used to execute the Python scripts. Due to the use of SSI, the index page is called index.shtml.

An image of the website. The Dip and then steadiness of the graph is due to the faulty moisture sensor. The maker has ordered another!

A lot more detail about the hardware and software involved is available in this second reddit post about the project.

Lord-of-the-Pis is now working on a dashboard that plots the soil moisture over time, as well as tracking other things like light intensity, temperature, and humidity.

May no other plant perish due to overwatering on our watch ever again!

The post Raspberry Pi–powered bonsai watering system appeared first on Raspberry Pi.

Raspberry Pi-powered wedding memories record player

Post Syndicated from Ashley Whittaker original https://www.raspberrypi.org/blog/raspberry-pi-powered-wedding-memories-record-player/

We’re a sentimental bunch and were bowled over by this intricate, musical wedding gift. It’s powered by a Raspberry Pi and has various other bits of geeky goodness under the hood. Honestly, the extra features just keep coming — you’ll see.

This beautifully crafted ‘record player’ plays one pair of newlyweds’ Spotify accounts, and there’s a special visual twist when their ‘first dance’ wedding song plays.

Midway through the build process

First, a little background: the newlyweds, Holly and Dougie, have been sweethearts since early highschool days. Their wedding took place on a farm near the village they grew up in, Fintry in rural Scotland.

No Title

No Description

Throughout the wedding day, the phrase “Music is a huge deal” was repeated often, which gave the bride’s older brother Ben Howell the idea for a homemade, Raspberry Pi–powered gift.

Custom tagline laser-cut and spray-painted

He built the couple a neatly finished music box, known as HD-001 (HD for ‘Holly Dougie’ of course) and home to a ‘smart turntable’. It can connect to a wireless network and has a touch screen where the record label would normally sit. When you lift the lid and switch it on, it asks “Hello. Who’s listening?”

Once you tap on the picture of either the bride or groom, it accesses their Spotify account and fetches the album artwork of whatever song it plays.

What’s inside?

The main brain is Raspberry Pi 3 running Raspberry Pi OS. The interface is built as a web page in mostly PHP and JavaScript. It uses the Spotify API to get the ‘now playing’ track of the bride’s or groom’s account, and to fish out the album artwork URL from the return data so it can display this on a rotating panel.

The audio side is a powered by a 50W Bluetooth amplifier, which is entirely independent from the Raspberry Pi computer.

The build details

The enclosure is all custom-designed and built using scrap wood wrapped in green faux leather material. Ben sourced most of the other materials — rubber feet, hinges, switches, metal grille — on Amazon.

The HD-001 also features a hand-built 4-way speaker system and a custom-made speaker grille with that famous phrase “Music is a huge deal” on the front.

The lettering on the grille was laser-cut by a company in Glasgow to order, and Ben spray-painted it metallic grey. The LCD panel and driver board are also from Amazon.

To play and pause music, Ben sourced a tone-arm online and routed cabling from the Raspberry Pi GPIO pins through to a micro-switch where the original needle should sit. That’s how lifting the arm pauses playback, and replacing it resumes the music.

Getting the audio to work

Ben explains: “Essentially, it’s a fancy Bluetooth speaker system disguised as an old-fashioned turntable and designed to behave and work like an old-fashioned turntable (skeuomorphism gone mad!).”

Oh, and our favourite adorable bonus feature? If the first dance song from Holly’s and Dougie’s wedding is played, the album artwork on the LCD panel fades away, to be replaced by a slideshow of photos from their wedding.

And for extra, extra big brother points, Ben even took the time to create a manual to make sure the newlyweds got the most out of their musical gift.

We have it on good authority that Ben will entertain anyone who would like to place a pre-order for the HD-002.

The post Raspberry Pi-powered wedding memories record player appeared first on Raspberry Pi.

Vulkan update: now with added source code

Post Syndicated from Eben Upton original https://www.raspberrypi.org/blog/vulkan-update-now-with-added-source-code/

Today we have a guest post from Igalia’s Iago Toral, who has spent the past year working on the Mesa graphic driver stack for Raspberry Pi 4.

It is almost five months since we announced the Vulkan effort for Raspberry Pi 4. It was great to see how many people were excited about this, and today we would like to give you a status update on our progress over these last months.

When we announced the effort back in January we were at the point of rendering a coloured triangle, which required only minimal coverage of the Vulkan 1.0 API in the driver. Today, we are passing over 70,000 tests from the Khronos Conformance Test Suite for Vulkan 1.0 and we have an implementation for a significant subset of the Vulkan 1.0 API.

Progress so far, in pictures

While I could detail here all the features that we have implemented, I am sure that list would get long and boring very quickly for most of you. So, instead, we would like to show you our progress through pics taken from a bunch of the popular Vulkan demos by Sascha Willems running on Raspberry Pi 4:

Hopefully that is more entertaining than a feature checklist and will help you visualize better where we are now compared to January’s coloured triangle.

Before you get too excited though, while these demos are nice, they are still a far cry from actual games and applications. We still have a lot of work to do before the driver can handle these more complex workloads. Even some of Sascha’s demos don’t run yet, whether because of driver bugs or unimplemented Vulkan features. We still have a lot of work ahead of us.

Next up

I would also like to give you an overview of some of the things we will be working on in the coming months:

Our first priority is to support the basic Vulkan 1.0 feature set. This will involve, at least, supporting compute shaders, input attachments, texel buffers, storage images, pipeline caches, and multisampling. There are some other features that we need to support in Vulkan 1.0, such as robust buffer access etc, but those are probably the largest ones we are currently missing.

Once we are feature-complete we will probably move focus to CTS conformance, which will be all about bugfixing, and making sure we handle spec corner cases. And once we are close to conformance, the driver should hopefully be stable and robust enough that we should probably start testing actual Vulkan applications and games to drive further bugfixing work.

Finally, there will be a lot of performance tuning and optimization work that we will probably tackle in the last stages of development.

So as I said before, we still have a long way to go!

Moving development to an open repository

Before we end this post, I would also like to share another important piece of news: starting today, we are moving development of the driver to an open repository. You can find instructions on how to build and install the driver here. I know this is something that many of you have been asking for, and I am sorry that it took us a few months to get here. But I think that now that we have a more stable driver infrastructure in place, and we don’t feel like we are constantly making large changes every other day, development should be a lot friendlier to external contributors than it may have been a few months ago.

So that’s everything we wanted to share today – I hope you are still excited about Vulkan and looking forward to future updates. In the meantime, if you have questions or are interested in contributing to the driver, join us on irc.freenode.net, #videocore channel.

The post Vulkan update: now with added source code appeared first on Raspberry Pi.