Tag Archives: Raspberry Pi Zero/Zero W

Raspberry Pi Zero W turns iPod Classic into Spotify music player

via Raspberry Pi

Recreating Apple’s iconic iPod Classic as a Spotify player may seem like sacrilege but it works surprisingly well, finds Rosie Hattersley. Check out the latest issue of The MagPi magazine (pg 8 – 12) for a tutorial to follow if you’d like to create your own.

Replacement Raspberry Pi parts laying inside an empty iPod case to check they will fit
Replacement Raspberry Pi parts laying inside an empty iPod case to check they will fit

When the original iPod was launched, the idea of using it to run anything other than iTunes seemed almost blasphemous. The hardware remains a classic, but our loyalties are elsewhere with music services these days. If you still love the iPod but aren’t wedded to Apple Music, Guy Dupont’s Spotify hack makes a lot of sense. “It’s empowering as a consumer to be able to make things work for me – no compromises,” he says. His iPod Classic Spotify player project cost around $130, but you could cut costs with a different streaming option.

“I wanted to explore what Apple’s (amazing) original iPod user experience would feel like in a world where we have instant access to tens of millions of songs. And, frankly, it was really fun to take products from two competitors and make them interact in an unnatural way.” 

Guy Dupont
Installing the C-based haptic code on Raspberry Pi Zero, and connecting Raspberry Pi, display, headers, and leads
Installing the C-based haptic code on Raspberry Pi Zero, and connecting Raspberry Pi, display, headers, and leads

Guy’s career spans mobile phone app development, software engineering, and time in recording studios in Boston as an audio engineer, so a music tech hack makes sense. He first used Raspberry Pi for its static IP so he could log in remotely to his home network, and later as a means of monitoring his home during a renovation project. Guy likes using Raspberry Pi when planning a specific task because he can “program [it] to do one thing really well… and then I can leave it somewhere forever”, in complete contrast to his day job. 

Mighty micro

Guy seems amazed at having created a Spotify streaming client that lives inside, and can be controlled by, an old iPod case from 2004. He even recreated the iPod’s user interface in software, right down to the font. A ten-year-old article about the click wheel provided some invaluable functionality insights and allowed him to write code to control it in C. Guy was also delighted to discover an Adafruit display that’s the right size for the case, doesn’t expose the bezels, and uses composite video input so he could drive it directly from Raspberry Pi’s composite out pins, using just two wires. “If you’re not looking too closely, it’s not immediately obvious that the device was physically modified,” he grins.

All replacement parts mounted in the iPod case
All replacement parts mounted in the iPod case

Guy’s retro iPod features a Raspberry Pi Zero W. “I’m not sure there’s another single-board computer this powerful that would have fit in this case, let alone one that’s so affordable and readily available,” he comments. “Raspberry Pi did a miraculous amount of work in this project.” The user interface is a Python app, while Raspberry Pi streams music from Spotify via Raspotify, reads user input from the iPod’s click wheel, and drives a haptic motor – all at once. 

Guy managed to use a font for the music library that looks almost exactly the same as Apple’s original
Guy managed to use a font for the music library that looks almost exactly the same as Apple’s original

Most of the hardware for the project came from Guy’s local electronics store, which has a good line in Raspberry Pi and Adafruit components. He had a couple of attempts to get the right size of haptic motor, but most things came together fairly easily after a bit of online research. Help, when he needed it, was freely given by the Raspberry Pi community, which Guy describes as “incredible”.

Things just clicked 

Guy previously used Raspberry Pi to stream albums around his home
Guy previously used Raspberry Pi to stream albums around his home

Part of the fun of this project was getting the iPod to run a non-Apple streaming service, so he’d also love to see versions of the iPod project using different media players. You can follow his instructions on GitHub.

Next, Guy intends to add a DAC (digital to analogue converter) for the headphone jack, but Bluetooth works for now, even connecting from inside his jacket pocket, and he plans to get an external USB DAC in time. 

The post Raspberry Pi Zero W turns iPod Classic into Spotify music player appeared first on Raspberry Pi.

Low-cost Raspberry Pi Zero endoscope camera

via Raspberry Pi

Researchers at the University of Cape Town set about developing an affordable wireless endoscope camera to rival expensive, less agile options.

Endoscopic cameras are used to look at organs inside your body. A long, thin, flexible tube with a light at the end is fed down your throat (for example), and an inside view of all your organs is transmitted to a screen for medical review.

Problem is, these things are expensive to build. Also, the operator is tethered by camera wires and power cables.

Low cost endoscope camera
The prototype featured in Lazarus & Ncube research paper

With this low-cost prototype, the camera is mounted at the end with LEDs instead of fibre-optic lights. The device is battery powered, and can perform for two hours without needing a charge. Traditional endoscopes require external camera cables and a hefty monitor, so this wireless option saves space and provides much more freedom. Weighing in at just 184g, it’s also much more portable.

The prototype incorporates a 1280 × 720 pixel high-definition tube camera, and transmits video to a standard laptop for display. Perhaps this idea could be developed to support an even more agile display, such as a phone or a touchscreen tablet.

Thousands of dollars cheaper

This Raspberry Pi-powered wireless option also saves thousands of dollars. It was built for just $230, whereas contemporary wired options cost around $28,000.

Urologists at the University of Cape Town created the prototype. J. M. Lazarus & M. Ncube hope their design will be more accessible to medical settings that have less money available. You can read their research paper for an in-depth look at the whole process.

Traditional endescope camera cross section
A traditional endoscope. Image from Lazarus & Ncube’s original paper

The researchers focused on open-source resources to keep the cost low; we’ll learn more about the RaspAP software they used below. Affordability also led them to Raspberry Pi Zero W which, at just $10, is able to handle high-definition video.

What is RaspAP?

Billz, who shared the project on reddit, is one of the developers of RaspAP.

RaspAP is a wireless setup and management system that lets you get a wireless access point up and running quickly on Raspberry Pi. Here, the Raspberry Pi is receiving images sent from the camera and transmitting them to a display device.

An example of a Rasp A P dashboard
An example of a RaspAP dashboard

There is also Quick installer available for RaspAP. It creates a default configuration that “just works” on all Raspberry Pis with onboard wireless.

We wonder what other medical equipment could be greatly improved by developing an affordable wireless version?

The post Low-cost Raspberry Pi Zero endoscope camera appeared first on Raspberry Pi.

Remotely monitor freezer temperatures with Raspberry Pi

via Raspberry Pi

Elizabeth from Git Tech’d has shown us how to monitor freezers and fridges remotely with a temperature sensor and Raspberry Pi. A real-time temperature monitor dashboard lets you keep an eye on things, and text message alerts can be set up to let you know when the temperature is rising.

The idea came about after Rick Kuhlman‘s wife lost a load of breast milk she had stored in the freezer. To make sure that months of hard work was never wasted again, Rick came up with this $30 solution.

Kit list

The whole kit packed together in a transparent case
Everything packed together in the protective case

Setup

Easy does it: you just wire the temperature sensor directly to your Raspberry Pi. Rick has even made you a nice wiring diagram, so no excuses:

Wiring diagram for connecting Raspberry Pi Zero W to Adafruit BME280

There’s a little fiddling to make sure your Flat Flex cable attaches properly to the temperature sensor. The project walkthrough provides a really clear, illustrated step-by-step to help you.

The protoboard for the BME280 has 7 solder points, but the cable has 8 connectors
The temperature sensor has seven solder points but the cable has eight connectors, so you’ll need to get snippy

Software

Everything looks pretty simple according to the installation walkthrough. A couple of Python libraries accessed via Raspberry Pi OS and you’re there.

Screenshot of the temperature monitor
Initial State’s temperature monitor dashboard

You’ll need an access key from Initial State, but Rick explains you can get a free trial. The real-time temperature monitor dashboard is hosted on your Initial State account. If you want to have a poke around one that’s already up and running, have a look at Rick’s dashboard.

Alert!

You can configure your own alert parameters from within the dashboard. Set your desired temperature and how much leeway you can tolerate.

You’ll get a text alert if the temperature falls too far above or below your personal setting.

A phone screen showing a text alert that a freezer temperature has gone too high
Get alerts straight to your phone

We can see this affordable fix helping out science labs that need to keep their expensive reagents cold but don’t have the budget for freezers with built-in monitoring, as well as people who need to keep medication at a certain temperature at home. Or maybe food outlets that don’t want to risk losing loads of pricy perishables stacked up in a chest freezer. Nice work, Rick and Elizabeth!

The post Remotely monitor freezer temperatures with Raspberry Pi appeared first on Raspberry Pi.

Wes’s wonderful Minecraft user notification display

via Raspberry Pi

This Minecraft sign uses a Raspberry Pi to notify you when, and how many of, your friends are logged into your dedicated Minecraft server.

Let’s start by pointing out how wonderfully nostalgic many of Wes ‘Geeksmithing’ Swain’s projects are. From his Raspberry Pi–housing cement Thwomp that plays his favourite Mario games to The NES Project, his NES replica unit with a built-in projector — Wes makes the things we wished for as kids.

The NES Project covered in HackSpace magazine

We honestly wouldn’t be surprised if his next project is a remake of Duckhunt with servo-controlled ducks, or Space Invaders but it’s somehow housed in a flying space invader that shoots back with lasers. Honestly, at this point, we wouldn’t put it past him.

Making the Minecraft friend notification display

In the video, Wes covers the project in two parts. Firstly, he shows off the physical build of making the sign, including laser-cut acrylic front displayed with controllable LED lights, a Raspberry Pi Zero, and the wooden framing.

Secondly, he moves on to the code, in which he uses mcstatus, a Python class created by Minecraft’s Technical Director Nathan Adams that can be used to query servers for information. In this instance, Wes is using mcstatus to check for other players on his group’s dedicated Mincecraft server, but the class can also be used to gather mod information. You can find mcstatus on GitHub.

Each friend is assigned a letter that illuminates if they’re online.

Lucky for Wes, he has the same number of friends on his server as the number of letters in ‘Minecraft’, so for every friend online, he’s programmed the display to illuminate a letter of the Minecraft logo. And while the server is empty, he can also set the display to run through various light displays, including this one, a dedication to the new Minecraft Nether update.

If you’d like to try making this project yourself, you can: Wes goes into great detail in his video, and the code for the project can be found on his GitHub account.

And while we have your attention, be sure to subscribe to Geeksmithing on YouTube and show him some love for such a great project.

The post Wes’s wonderful Minecraft user notification display appeared first on Raspberry Pi.

These loo rolls formed a choir

via Raspberry Pi

Have all of y’all been hoarding toilet roll over recent weeks in an inexplicable response to the global pandemic, or is that just a quirk here in the UK? Well, the most inventive use of the essential household item we’ve ever seen is this musical project by Max Björverud.

Ahh, the dulcet tones of wall-mounted toilet roll holders, hey? This looks like one of those magical ‘how do they do that?’ projects but, rest assured, it’s all explicable.

Max explains that Singing Toilet is made possible with a Raspberry Pi running Pure Data. The invention also comprises a HiFiBerry Amp, an Arduino Mega, eight hall effect sensors, and eight magnets. The toilet roll holders are controlled with the hall effect sensors, and the magnets connect to the Arduino Mega.

In this video, you can see the hall effect sensor and the 3D-printed attachment that holds the magnet:

Max measures the speed of each toilet roll with a hall effect sensor and magnet. The audio is played and sampled with a Pure Data patch. In the comments on his original Reddit post, he says this was all pretty straight-forward but that it took a while to print a holder for the magnets, because you need to be able to change the toilet rolls when the precious bathroom tissue runs out!

Max began prototyping his invention last summer and installed it at creative agency Snask in his hometown of Stockholm in December.

The post These loo rolls formed a choir appeared first on Raspberry Pi.

Track your cat’s activity with a homemade speedometer

via Raspberry Pi

Firstly, hamster wheels for cats are (still) a thing. Secondly, Bengal cats run far. And Shawn Nunley on reddit is the latest to hit on this solution for kitty exercise and bonus cat stats.

Here is the wheel itself. That part was shop-bought. (Apparently it’s a ZiggyDoo Ferris Cat Wheel.)

Smol kitty in big wheel

Shawn has created a speedometer that tracks distance and speed. Every time a magnet mounted on the wheel passes a fixed sensor, a Raspberry Pi Zero writes to a log file so he can see how far and fast his felines have travelled. The wheel has six sensors, which each record 2.095 ft of travel. This project revealed the cats do about 4-6 miles per night on their wheel, and they reach speeds of 14 miles an hour.

Here’s your shopping list:

  • Raspberry Pi
  • Reed switch (Shawn got these)
  • Jumper wires
  • Ferris cat wheel

The tiny white box sticking out at the base of the wheel is the sensor

Shawn soldered a 40-pin header to his Raspberry Pi Zero and used jumper wires to connect to the sensor. He mounted the sensor to the cat wheel using hot glue and a pill box cut in half, which provided the perfect offset so it could accurately detect the magnets passing by. The code is written in Python.

Upcoming improvements include adding RFID so the wheel can distinguish between the cats in this two-kitty household.

Shawn also plans to calculate how much energy the Bengals are expending, and he’ll soon be connecting the Raspberry Pi to their Google Cloud Platform account so you can all keep up with the cats’ stats.

The stats are currently available only locally

And, get this – this was Shawn’s first ever time doing anything with Raspberry Pi or Python. OK, so as an ex-programmer he had a bit of a head start, but he assures us he hasn’t touched the stuff since the 1990s. He explains: “I was totally shocked at how easy it was once I figured out how to get the Raspberry Pi to read a sensor.” Start to finish, the project took him just one week.

The post Track your cat’s activity with a homemade speedometer appeared first on Raspberry Pi.