Schlagwort: Raspberry Pi Zero W

  • Raspberry Pi Zero W turns iPod Classic into Spotify music player

    Raspberry Pi Zero W turns iPod Classic into Spotify music player

    Reading Time: 4 minutes

    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. 

    Website: LINK

  • Low-cost Raspberry Pi Zero endoscope camera

    Low-cost Raspberry Pi Zero endoscope camera

    Reading Time: 3 minutes

    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.

    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?

    A banner with the words "Be a Pi Day donor today"

    Website: LINK

  • Remotely monitor freezer temperatures with Raspberry Pi

    Remotely monitor freezer temperatures with Raspberry Pi

    Reading Time: 3 minutes

    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.

    [youtube https://www.youtube.com/watch?v=hSwVGgmGjhU?feature=oembed&w=500&h=281]

    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!

    Website: LINK

  • What the blink is my IP address?

    What the blink is my IP address?

    Reading Time: 3 minutes

    Picture the scene: you have a Raspberry Pi configured to run on your network, you power it up headless (without a monitor), and now you need to know which IP address it was assigned.

    [youtube https://www.youtube.com/watch?v=XbJ5vT8FvXU?feature=oembed&w=500&h=281]

    Matthias came up with this solution, which makes your Raspberry Pi blink its IP address, because he used a Raspberry Pi Zero W headless for most of his projects and got bored with having to look it up with his DHCP server or hunt for it by pinging different IP addresses.

    How does it work?

    A script runs when you start your Raspberry Pi and indicates which IP address is assigned to it by blinking it out on the device’s LED. The script comprises about 100 lines of Python, and you can get it on GitHub.

    A screen running Python
    Easy peasy GitHub breezy

    The power/status LED on the edge of the Raspberry Pi blinks numbers in a Roman numeral-like scheme. You can tell which number it’s blinking based on the length of the blink and the gaps between each blink, rather than, for example, having to count nine blinks for a number nine.

    Blinking in Roman numerals

    Short, fast blinks represent the numbers one to four, depending on how many short, fast blinks you see. A gap between short, fast blinks means the LED is about to blink the next digit of the IP address, and a longer blink represents the number five. So reading the combination of short and long blinks will give you your device’s IP address.

    You can see this in action at this exact point in the video. You’ll see the LED blink fast once, then leave a gap, blink fast once again, then leave a gap, then blink fast twice. That means the device’s IP address ends in 112.

    What are octets?

    Luckily, you usually only need to know the last three numbers of the IP address (the last octet), as the previous octets will almost always be the same for all other computers on the LAN.

    The script blinks out the last octet ten times, to give you plenty of chances to read it. Then it returns the LED to its default functionality.

    Which LED on which Raspberry Pi?

    On a Raspberry Pi Zero W, the script uses the green status/power LED, and on other Raspberry Pis it uses the green LED next to the red power LED.

    The green LED blinking the IP address (the red power LED is slightly hidden by Matthias’ thumb)

    Once you get the hang of the Morse code-like blinking style, this is a really nice quick solution to find your device’s IP address and get on with your project.

    Website: LINK

  • Raspberry Pi + Furby = ‘Furlexa’ voice assistant

    Raspberry Pi + Furby = ‘Furlexa’ voice assistant

    Reading Time: 3 minutes

    How can you turn a redundant, furry, slightly annoying tech pet into a useful home assistant? Zach took to howchoo to show you how to combine a Raspberry Pi Zero W with Amazon’s Alexa Voice Service software and a Furby to create Furlexa.

    [youtube https://www.youtube.com/watch?v=aCOsM-4NEKs?feature=oembed&w=500&h=281]

    Furby was pretty impressive technology, considering that it’s over 20 years old. It could learn to speak English, sort of, by listening to humans. It communicated with other Furbies via infrared sensor. It even slept when its light sensor registered that it was dark.

    Furby innards, exploded

    Zach explains why Furby is so easy to hack:

    Furby is comprised of a few primary components — a microprocessor, infrared and light sensors, microphone, speaker, and — most impressively — a single motor that uses an elaborate system of gears and cams to drive Furby’s ears, eyes, mouth and rocker. A cam position sensor (switch) tells the microprocessor what position the cam system is in. By driving the motor at varying speeds and directions and by tracking the cam position, the microprocessor can tell Furby to dance, sing, sleep, or whatever.

    The original CPU and related circuitry were replaced with a Raspberry Pi Zero W

    Zach continues: “Though the microprocessor isn’t worth messing around with (it’s buried inside a blob of resin to protect the IP), it would be easy to install a small Raspberry Pi computer inside of Furby, use it to run Alexa, and then track Alexa’s output to make Furby move.”

    What you’ll need:

    Harrowing

    Running Alexa

    The Raspberry Pi is running Alexa Voice Service (AVS) to provide full Amazon Echo functionality. Amazon AVS doesn’t officially support the tiny Raspberry Pi Zero, so lots of hacking was required. Point 10 on Zach’s original project walkthrough explains how to get AVS working with the Pimoroni Speaker pHAT.

    Animating Furby

    A small motor driver board is connected to the Raspberry Pi’s GPIO pins, and controls Furby’s original DC motor and gearbox: when Alexa speaks, so does Furby. The Raspberry Pi Zero can’t supply enough juice to power the motor, so instead, it’s powered by Furby’s original battery pack.

    Software

    There are three key pieces of software that make Furlexa possible:

    1. Amazon Alexa on Raspberry Pi – there are tonnes of tutorials showing you how to get Amazon Alexa up and running on your Raspberry Pi. Try this one on instructables.
    2. A script to control Furby’s motor howchooer Tyler wrote the Python script that Zach is using to drive the motor, and you can copy and paste it from Zach’s howchoo walkthrough.
    3. A script that detects when Alexa is speaking and calls the motor program – Furby detects when Alexa is speaking by monitoring the contents of a file whose contents change when audio is being output. Zach has written a separate guide for driving a DC motor based on Linux sound output.
    Teeny tiny living space

    The real challenge was cramming the Raspberry Pi Zero plus the Speaker pHAT, the motor controller board, and all the wiring back inside Furby, where space is at a premium. Soldering wires directly to the GPIO saved a bit of room, and foam tape holds everything above together nice and tightly. It’s a squeeze!

    Zach is a maker extraordinaire, so check out his projects page on howchoo.

    Website: LINK

  • Boston Dynamics’ Handle robot recreated with Raspberry Pi

    Boston Dynamics’ Handle robot recreated with Raspberry Pi

    Reading Time: 3 minutes

    You in the community seemed so impressed with this recent Boston Dynamics–inspired build that we decided to feature another. This time, maker Harry was inspired by Boston Dynamics’ research robot Handle, which stands 6.5 ft tall, travels at 9 mph and jumps 4​ ​feet vertically. Here’s how Harry made his miniature version, MABEL (Multi Axis Balancer Electronically Levelled).

    MABEL has individually articulated legs to enhance off-road stability, prevent it from tipping, and even make it jump (if you use some really fast servos). Harry is certain that anyone with a 3D printer and a “few bits” can build one.

    MABEL builds on the open-source YABR project for its PID controller, and it’s got added servos and a Raspberry Pi that helps interface them and control everything.

    [youtube https://www.youtube.com/watch?v=DS-QJv-ae3s?feature=oembed&w=500&h=281]

    Installing MABEL’s Raspberry Pi brain and wiring the servos

    Thanks to a program based on the open-source YABR firmware, an Arduino handles all of the PID calculations using data from an MPU-6050 accelerometer/gyro. Raspberry Pi, using Python code, manages Bluetooth and servo control, running an inverse kinematics algorithm to translate the robot legs perfectly in two axes.

    Kit list

    If you want to attempt this project yourself, the files for all the hard 3D-printed bits are on Thingiverse, and all the soft insides are on GitHub.

    IKSolve is the class that handles the inverse kinematics functionality for MABEL (IKSolve.py) and allows for the legs to be translated using (x, y) coordinates. It’s really simple to use: all that you need to specify are the home values of each servo (these are the angles that, when passed over to your servos, make the legs point directly and straight downwards at 90 degrees).

    When MABEL was just a twinkle in Harry’s eye

    MABEL is designed to work by listening to commands on the Arduino (PID contoller) end that are sent to it by Raspberry Pi over serial using pySerial. Joystick data is sent to Raspberry Pi using the Input Python library. Harry first tried to get the joystick data from an old PlayStation 3 controller, but went with the PiHut’s Raspberry Pi Compatible Wireless Gamepad in the end for ease.

    Keep up with Harry’s blog or give Raspibotics a follow on Twitter, as part 3 of his build write-up should be dropping imminently, featuring updates that will hopefully get MABEL jumping!

    Website: LINK

  • Track your cat’s activity with a homemade speedometer

    Track your cat’s activity with a homemade speedometer

    Reading Time: 3 minutes

    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.

    Website: LINK

  • Watch Game of Thrones with a Raspberry Pi-powered Drogon

    Watch Game of Thrones with a Raspberry Pi-powered Drogon

    Reading Time: 2 minutes

    Channel your inner Targaryen by building this voice-activated, colour-changing, 3D-printed Drogon before watching the next episode of Game of Thrones.

    Winter has come

    This is a spoiler-free zone! I’ve already seen the new episode of season 8, but I won’t ruin anything, I promise.

    Even if you’ve never watched an episode of Game of Thrones (if so, that’s fine, I don’t judge you), you’re probably aware that the final season has started.

    And you might also know that the show has dragons in it — big, hulking, scaley dragons called Rhaegal, Viserion, and Drogon. They look a little something like this:Daenerys-Targaryen-game-of-thrones

    Well, not anymore. They look like this now:

    04_15_GameOfThrones_S07-920x584

    Raspberry Pi voice-responsive dragon!

    The creator of this project goes by the moniker Botmation. To begin with, they 3D printed modified a Drogon model they found on Thingiverse. Then, with Dremel in hand, they modified the print, to replace its eyes with RGB LEDs. Before drawing the LEDs through the hollowed-out body of the model, they soldered them to wires connected to a Raspberry Pi Zero W‘s GPIO pins.

    Located in the tin beneath Drogon, the Pi Zero W is also equipped with a microphone and runs the Python code for the project. And thanks to Google’s Speech to Text API, Drogon’s eyes change colour whenever a GoT character repeats one of two keywords: white turns the eyes blue, while fire turns them red.

    If you’d like more information about building your own interactive Drogon, here’s a handy video. At the end, Botmation asks viewers to help improve their code for a cleaner voice-activation experience.

    3D printed Drogon with LED eyes for Game of Thrones

    Going into the final season of Game of Thrones with your very own 3D printed Drogron dragon! The eyes are made of LEDs that changes between Red and Blue depending on what happens in the show. When you’re watching the show, Drogon will watch the show with you and listen for cues to change the eye color.

    Drogon for the throne!

    I’ve managed to bag two of the three dragons in the Pi Towers Game of Thrones fantasy league, so I reckon my chances of winning are pretty good thanks to all the points I’ll rack up by killing White Walker.

    Wait — does killing a White Walker count as a kill, since they’re already dead?

    Ah, crud.

    Website: LINK

  • Build your own Arthur satellite dish for tracking the ISS

    Build your own Arthur satellite dish for tracking the ISS

    Reading Time: 3 minutes

    Construct a 3D paper model of the iconic Arthur satellite dish that notifies you whenever the International Space Station passes overhead!

    Project_Arthur

    Project_Arthur is a fun project allowing you to construct a 3d paper model of the Antenna 1 dish called Arthur from Goonhilly. The model will track the location of the ISS (International Space Station) using an embedded Raspberry PI and notify you when it is over your chosen location!

    The Arthur satellite dish at Goonhilly Earth Satellite Station

    Based in Cornwall, UK, the Goonhilly Earth Satellite Station was once the largest satellite earth station in the world. It has been home to more than 60 dishes since its first dish, Arthur, was built in 1962.

    Arthur satellite dish

    Arthur is responsible for bringing many iconic moments in television history to the UK. For example, it transmitted man’s first steps on the moon on 20 July 1969. Since then, it’s become a protected Grade II listed structure.

    Project Arthur

    Apollo 50’s Project Arthur is an open-source 3D papercraft project that allows you to build your own desktop Arthur satellite dish model, complete with LED notifications via a Raspberry Pi Zero W.

    The entire body of the satellite dish is built using ten sheets of 160gsm cardstock, printed with the Arthur design that you can download for free from the Project Arthur website. A Raspberry Pi Zero W fits within the base of the model, and you can push a small LED through the feedhorn — the bit that sticks out the front of the dish.

    Arthur satellite dish - raspberry pi iss indicator

    The Apollo 50 team created a simple IFTTT web applet that accesses an API to find out the location of the International Space Station (ISS).

    The project uses a conditional web applet that we created on the IFTTT (If This Then That) platform. The applet monitors an API via NASA and Open Notify that we give a specific location on Earth (such as your home/school). It computes whether the ISS is overhead, and in that case sends a tweet to you with a particular hashtag (such as #ISS_overGoonhilly). When this hashtag is picked up by the code running on the Pi, the LED will flash to indicate that the ISS is overhead!

    Raspberry Pi and the International Space Station

    Our two Astro Pi units, Ed and Izzy, are currently aboard the International Space Station as part of the ongoing Astro Pi Challenge we’re running in partnership with the European Space Agency (ESA). The Astro Pi units consist of a Raspberry Pi 1 Model B+ and a Sense HAT inside a 6063-grade aluminium flight case, and they allow school children from all ESA member countries to write code to run experiments in space. You can learn more about the Astro Pi Challenge here.

    Astro Pi in space - Arthur satellite dish

    If you’d like to try out more space-themed Pi projects, our free project resources include ‘People in space’ indicator — a handy LED-packed gadget for checking how many people (that we know of 👽) are currently in space.

    Raspberry Pi ISS People in Space indicator - Arthur satellite dish

    There are many more free resources on our projects site, including our own take on an ISS tracker, and the files to print your own Astro Pi case. And you can learn more about papercraft in issue 6 of HackSpace magazine, our monthly maker publication available in print and as a free PDF download that makes a sneaky appearance in the Project Arthur video!

    Website: LINK