Schlagwort: raspberrypi

  • Astrophotography Autoguider project showcase

    Astrophotography Autoguider project showcase

    Reading Time: 4 minutes

    Creating stunning photographs of the night sky requires planning, patience, and reliable star-tracking equipment. A desire to travel a little lighter led keen amateur astronomer Joe Kutner to embark on his first Raspberry Pi project.

    Joe Kutner (aka Codefinger) is a software architect at Salesforce.com, where he works primarily with Java and other open-source technologies. He’s published several books about programming with Ruby and Java. He enjoys amateur astronomy, mostly observationally, but he also dabbles in astrophotography. 

    Joe Kutner is a keen amateur astronomer and astrophotographer. He's lucky enough to live somewhere he can capture stunning images of the night sky from his own driveway

    Joe says there’s nothing worse than taking hours of astrophotography images only to find out your telescope was drifting, causing the stars to look more like lines than points. To protect against this kind of misalignment, he needed an autoguider: a computer and camera that track a star in the telescope’s field of view to ensure that it stays in the same position throughout the session.

    The Horsehead Nebula and Flame Nebula, photographed from Joe’s Alabama driveway with the help of his Raspberry Pi-controlled autoguider

    “The main goal of my project was to get rid of the laptop,” Joe tells us. “I needed to control my telescope in the field. I spend enough time in front of a computer at work, and the laptop took the fun out of observing. It served an important function, though: controlling both my camera and my mount. Without it I would only be able to take very short exposures of the moon and planets.”

    Joe considered using an iPad or a Microsoft Surface instead, but both were far too expensive. He wanted to keep the build cost below $100, and neither worked well with his chosen software.

    Instead Joe picked up a Raspberry Pi, a case, and a touchscreen for less than $100, and added a red plastic cover so he was still able to use the setup in night-vision mode. These work alongside the various bits of astronomy kit Joe uses regularly on his stargazing missions.

    Raspberry Pi in a case with a red plastic overlay so it can be used at night

    Under open skies

    Joe made extensive use of general purpose open-source software such as Raspbian Stretch and Git, plus astronomy-specific open-source tools Libnova, INDI, and PHD2 (openphdguiding.org) telescope guiding software.

    He wrote scripts to automate the software so he could just use the touchscreen, without a mouse or keyboard. But for the most part, things worked without customisation. 

    “Every step in the process had its challenges,” Joe recalls. “I would install one piece of software and then find out it wasn’t compatible with some version of another piece of software I needed. When I finally got everything running, it wouldn’t talk to my telescope until I installed yet another version of the software. There were dozens of these little paper-cuts, but in the end it was worth working through them.”

    Joe also says the hardware he chose worked perfectly from day one. Any tweaks he made were “mostly minor issues like figuring out how to install the correct version of a particular camera driver”.

    His Raspberry Pi now has an on-board autoguiding system for his astrophotography rig. Because Raspberry Pi attaches to the base of the mount, it’s easily accessible. Unlike using a laptop, there’s no need for an extra table or complicated wiring. Joe says the setup is perfect for his needs: “I can roll my telescope onto my driveway and start imaging in just a few minutes.”

    The lightweight nature of Joe’s astrophotography setup makes it easy to move around

    International expansion

    Now that Joe has successfully built a fairly portable astrophotography rig, he sees its potential for explorations further afield. He’s keen to try out his autoguider with other types of astrophotography kit such as the ultra-compact Sky-Watcher Star Adventurer series of mounts. “When combined with my Raspberry Pi,” he says, “I could take the whole rig on an airplane as carry-on. That would give me access to some very dark skies.” 

    Lagoon Nebula (Messier 8), a giant interstellar cloud located in the constellation of Sagittarius

    Build an autoguider

    1. Start with a fresh installation of Raspbian and download the package for libnova 0.14. You can find the install instructions at Joe’s GitHub page.

    2. Use the GitHub instructions to build INDI, the software to connect Raspberry Pi to your digital camera and mount. Install the Atik camera driver if needed. 

    3. Install and build PHD2 autoguiding software, then start the INDI server so it looks for the camera and mount. Save the profile for future reference. 

    Lacerta MGEN II is a good alternative if you don’t want to build your own autoguider

    Quick facts

    • Raspberry Pi records over several hours while Joe sleeps in his tent

    • Joe recommends Lacerta MGEN II if you don’t want to build your own autoguider

    • Many of his astronomy photos are taken from home in Huntsville, Alabama

    • He’s using Raspberry Pi to attempt to image an exoplanet transit

    • He also blogs about coders’ fitness and nutrition at healthyprog.com

    Whirlpool Galaxy (Messier 51) taken by Joe using his auto guided rig at the Texas Star Party 2019 in Fort Davis

  • GPIO Xmas Tree review

    GPIO Xmas Tree review

    Reading Time: < 1 minute

    The GPIO Xmas Tree is something like that – and probably the easiest one to code yet! It’s also nice and small, sitting over six GPIO pins rather than taking up all 40. This way, you can add a little festive flair to your Raspberry Pi, while still working on other projects that require the use of some GPIO pins.

    Easy coding

    One of the unique things about this tree is that you can program it with Scratch! Scratch on Raspberry Pi has a built-in GPIO library, allowing you to code physical objects, including this tree’s five LEDs.

    This is one of the few cases, though, where something so simple is much easier to do via Python, especially thanks to the GPIO Zero library, requiring less than ten lines of code to create a wonderful twinkling effect!

    We quite adore this little tree – it’s cheap and cheerful and could be someone’s first Raspberry Pi project on Christmas morning, with a quick and very cool result.

    Verdict

    9/10

    This fun little project will make your Raspberry Pi work desk festive, or make a young maker’s first steps at Christmas wonderful.

  • Retro computing with Raspberry Pi 4 in The MagPi issue 88

    Retro computing with Raspberry Pi 4 in The MagPi issue 88

    Reading Time: 3 minutes

    PJ Evans shows you how to put a Raspberry Pi inside an old ZX Spectrum+ computer, hooking it up to the innards. Discover how to connect a Raspberry Pi GPIO pins to the keyboard of a classic machine and use it to emulate the original computer.

    Plus! Discover where to find classic games and the best accessories for retro computing fans.

    Click here to buy The MagPi magazine issue #88

    Retro computing with Raspberry Pi 4

    Thermal testing Raspberry Pi 4

    Raspberry Pi 4 runs faster than any other Raspberry Pi computer. The Raspberry Pi team has been hard at work bringing the temperature down, and keeping the speed up. In this in-depth feature, we heat- and speed-test each Raspberry Pi 4 firmware update, and see how they are keeping the temperature down. It’s a wonderful feature packed with information on how the Raspberry Pi works, and has insider information on heat clocking. We even have a rare interview with Tim Gover, the software engineer at Raspberry Pi responsible for firmware, power management, and displays.

    Thermal testing the new Raspberry Pi firmware

    Astrophotography Autoguider

    We have the best projects in Raspberry Pi, like this astrophotography kit made by Joe Kutner in Alabama. With it, Joe has been capturing the night sky with stunning results.

    Astrophotography autoguider

    Make a smart Christmas tree

    It’s Christmas! Or at it least it will be very shortly. If you’re getting the tree out, putting up the tinsel, and tasting the chocolate, then why not use Raspberry Pi to create smart lighting? Our very own Rob Zwetsloot explains how to add voice activation to your Christmas tree lights.

    Smart Christmas tree lights

    The top 10 Christmas projects

    Christmas is a great time to be a Raspberry Pi fan, and many a maker has built glittering, all-singing and dancing projects for the festive period. From smart gingerbread houses to massive outdoor light displays, we look at the 10 best Christmas projects.

    The 10 best Christmas projects

    Community interview: Liz Clark aka Blitz City DIY

    Liz has only been making Raspberry Pi projects since 2016, but she has created some stunning builds. On her YouTube channel you’ll find teardowns, 3D printer projects, CircuitPython projects, and quirky DIY builds. Liz’s tale is an inspiration to anybody who feels late to the party. You can always make up for it with interesting makes.

    Liz Clark aka Blitz City DIY

    Plus! Win a PiArm Robot Arm Kit

    The MagPi is available as a free digital download, or you can purchase a print edition online or in stores.

  • Win a PiArm robot arm kit!

    Win a PiArm robot arm kit!

    Reading Time: < 1 minute

    Subscribe

  • DNA Gel Imager project showcase

    DNA Gel Imager project showcase

    Reading Time: 5 minutes

    Research labs and hospitals use multimillion-pound equipment for detailed DNA tests, but when part of the kit goes wrong, a low-cost alternative may be urgently needed. Dr Lindsay Clark found herself in exactly this situation when the gel imager she relied on to expose DNA samples broke down.

    Dr Lindsay Clark is a plant geneticist

    The machine that broke down was another lab’s imaging equipment, and “carrying somewhat hazardous ethidium bromide gel from place to place” had never been ideal.

    While we mainly think of DNA as useful for catching criminals and identifying possible blood relatives using ancestry testing kits, its main use is for genetic research. Cystic fibrosis researchers use it to test for patterns in DNA clusters, for example (see magpi.cc/Cmkj9F).

    DNA research helps us find out more about plants, animals and ourselves.

    Dr Lindsay Clark holds a PhD in Genetics. She studies DNA information about plants, animals, and microbes. Her work on plant genetics focuses on environmental and agricultural issues.

    In all cases, the DNA material extracted needs to be visualised and, in this case, Lindsay needed her own replacement imager, fast.

    As a Raspberry Pi enthusiast, and Python and R programmer, she soon came up with a plan. Lindsay’s interest in Raspberry Pi began when she and her husband wanted a webcam that wouldn’t steal their data. Despite scant knowledge of optics, some online research soon gave her all the details she needed.

    Sizing things up

    “A typical gel imaging system costs tens of thousands of dollars, but it is essentially a camera mounted over a transilluminator, attached to a computer for taking digital images,” she explains. “We had a transilluminator we’d inherited from an emeritus professor. The only components left then were a camera and a computer, which could be done very cheaply with a Raspberry Pi.” Since Raspberry Pi uses an HDMI output, she also needed an HDMI to DVI converter costing a princely $8.

    “We needed to be able to take close-up, reasonably focused images of an orange-fluorescing compound, filtering out other wavelengths of light. The images didn’t need to be publication quality (we could always use another lab’s transilluminator if we really needed to), but they needed to be good enough for us to document approximate DNA fragment sizes.”

    The DNA gel imager exposes elements of DNA suspended in agarose gel

    Optical collusion

    Lindsay first set up her Raspberry Pi 3B camera kit with a fresh Raspbian installation. The only software needed was the standard raspistill command, so she didn’t need to write any custom code. The +2.00 lens used came from an old pair of spectacles. (A stronger lens may have worked even better, she thinks.)

    Lindsay then added a lens filter which she bought cheaply online. This was simply to cut out any glare from the transilluminator lamp. The whole setup was housed in a cut-up Styrofoam box. In all, the device cost $150 including the Raspberry Pi 3 and Camera Module, monitor, keyboard, and mouse.

    “The biggest challenge was making sure that it could focus on the gel up close,” recalls Lindsay; it can focus from 1 m to infinity. “I tested it out by holding the reading glasses in front of the camera and taking pictures of some flyers.” The imager she’s built can’t zoom or focus but, as she says, “the camera is positioned such that it can get a decent picture of any gel.”

    Such has been the project’s success, Lindsay’s colleagues without any Raspberry Pi knowledge have easily made use of it too. She taped instructions on the wall explaining how to trigger the camera using Raspbian, but rarely has anyone asked how to use her DIY setup.

    She also encourages others to create their own bespoke equipment. “There’s a great tradition of scientists building their own equipment. Don’t let the existence of a commercial version deter you from building your own!”

    The final DNA gel imager setup - a low-cost Raspberry Pi-based alternative to the commercial lab version that was unexpectedly out of action

    Warning

    However, Lindsay warns, “Ethidium bromide is a carcinogen, not to mention that a lot of specialised equipment and reagents are needed to get DNA to the point where it could be visualised with my little imager. For example, the most common method of DNA extraction involves using chloroform in a fume hood, and then PCR is typically done after that before visualisation on a gel.”

    So the DNA gel imager isn’t something you could easily replicate at home and you should definitely do your research about ethidium bromide. Nonetheless, the idea of using a Raspberry Pi for medical applications has merit.

    Making your own imager

    1. Set up the Raspberry Pi 3 B Camera Module and install Raspbian. You’ll also need the raspistill command to trigger the Raspberry Pi camera. 

    Raspberry Pi Camera Module

    2. Cut a hole in the bottom of a Styrofoam box to form an aperture and carve out one seating for the lens filter and a second to hold the glasses lens. Mount the Raspberry Pi camera and secure it in place using paper clips or other adjustable fastening. Lindsay found the gel imager needed to sit 12 inches above the transilluminator, for example.

    Cut out a hole in a Styrofoam box for one lens and make a recess to keep the other half of the glasses in place

    3. Trace around the camera filter, position one of the lenses in the middle of where the filter was, then trace around the reading glasses. Connect the Raspberry Pi and Camera Module and place the camera over the lens.

    Connect the Raspberry Pi and Camera Module and then carefully position the camera on top of the glasses lens

    Quick facts

    • Lindsay and her husband bought Raspberry Pi boards as anniversary gifts

    • She publishes open-source software for the genetics community

    • She recently built a RetroPie for a friend

    • Lindsay loves solving genetics’ real-world logic problems…

    • such as DNA sequence alignments in allopolyploid organisms!

  • UK train departure screen

    UK train departure screen

    Reading Time: 4 minutes

    Given the time of year, we can perhaps expect some leaves on the line, slippery rain or maybe, if the weather takes a real turn for the worse, the wrong type of snow. But in any case, Chris Hutchinson will be as prepared as any commuter can be thanks to his Raspberry Pi computer. 

    Maker Chris Hutchinson has a life-long interest in railways and is principal engineer at The Times and Sunday Times newspapers

    Chris has had an interest in trains since he was a child and he is the principal engineer at The Times and The Sunday Times newspapers.

    The railway enthusiast has developed a miniature real-time train departure board that resembles the ones adorning stations across the world. “I wanted to be aware of any delays or cancellations on the trains before heading out of the house,” he explains. “I knew I could use an app on my phone, but where’s the fun in that?”

    At first, Chris took videos of the dot matrix displays at the stations he visited, making a note of the quirks in their displays and paying attention to spacing and the wording they used. “I must have taken videos of 10 or 15 different departure board variations from across the UK,” he tells us. “Based on those, I worked out the minimum dataset I’d need to display the next two services from my local station, and started looking into APIs that provided the data.”

    A Raspberry Pi 3B+ connected to a £25 dot-matrix display shows real-time train departure times pulled from the TransportAPI using Python 3

    Tunnel vision

    Chris decided to use TransportAPI and he soon got down to coding using Python 3. He’s already found the perfect display for the project – a 256×64 SSD1322 OLED screen which he liked because it was affordable, low power, and comes in different colours. “The yellow one looked like a perfect match to the videos I had been taking,” he says. “So I ordered one, excitedly waited for the post every morning and once it arrived, I wired it up, got my code running, and couldn’t believe how brilliant it looked.”

    In the meantime, Chris had found an open-source Python library for displaying graphics on OLED screens – one he says is typically used for small animations or displaying debugging data. It also had a software simulator using Pygame under the hood. “It allowed me to test my code before the real screen arrived,” Chris recalls. He’d also stumbled across an open-source set of fonts created by Daniel Hart that replicated real dot matrix departure boards and these only needed some tweaks to their size.

    The SSD1322 OLED screen supports different coloured displays and is easy to connect to a Raspberry Pi computer

    “Most of the heavy lifting is managed in the code and there are two key parts to it,” Chris reveals. “The first is data loading and parsing, making the appropriate network requests for my station and transforming it into a useful data structure. Second is the rendering code where I take the data and turn it into pixels on the screen.”

    Now it’s up and running, Chris keeps an eye on the display ahead of his daily London commute: “The board has prevented me from getting stuck out in the rain on more than one occasion.”

    Chris' real-time train departure board has prevented him getting stuck out in the rain on more than one occasion

    On the rails

    It also seems to have struck a chord with others. “After I first got it up and running, I shared a video of the build on Twitter and the response was phenomenal. It turns out the crossover between Raspberry Pi and train enthusiasts is pretty significant and there are already a number of forks.“ For example, enthusiasts have expressed a desire to connect the project to bus departure times and non-UK railway networks. „It’s been a real honour to see so many people engage with the product and take it in their own directions“, says Chris.  

    Quick facts

    • The screen can be bought for about £25

    • Python 3.6+ is needed to run the code

    • TransportAPI has a free tier for makers

    • An API call is made every 1–2 minutes

    • Chris’s boss wants one for The Times office

    More Raspberry Pi-based smart tech ideas you could try:

  • Cryptography ICE Cube experiment

    Cryptography ICE Cube experiment

    Reading Time: 4 minutes

    In space, nobody can hear you scream, but there are some people who are determined to eavesdrop on communication being sent back and forth between Earth and orbiting satellites. As such, there is a danger that security and safety can become compromised, which is why a team of researchers at the European Space Agency (ESA) have sought to enhance cybersecurity for future space missions.

    “There is a risk of satellites being intercepted and hacked, which leaves them susceptible to being controlled by a rogue third party,” explains ESA software product assurance engineer, Emmanuel Lesser. “That presents a big risk for a mission and it’s also a problem commercially since satellites are very expensive and the data that is transmitted is sensitive. It’s important that we protect it.”

    ESA engineer Emmanuel Lesser provides software product assurance for the Copernicus Earth observation programme

    Emmanuel’s role at the European Space Agency is to provide software product assurance for the Copernicus Earth observation programme and the Biomass mission.

    The right shape

    One of the cybersecurity solutions being explored by ESA involves Raspberry Pi Zero, and it is being worked on by a team headed by Emmanuel. Called the Cryptography ICE Cube experiment, or CryptIC for short, the aim is to make encryption-based secure communication feasible for even the smallest of space missions, and it is currently operational in the Columbus space laboratory module of the ISS.

    “We wanted the experiment to have a small footprint and a relatively modest energy consumption,” Emmanuel says. “We also wanted to achieve secure communication using the cheapest components. We knew that smaller missions, such as those which use CubeSats [miniaturised satellites for space research], utilise signals that are unencrypted. That leaves them vulnerable, so we looked at the possibilities.”

    Since the ICE Cubes facility in Columbus offers plug-and-play installation for cube-sized experiments, the idea was to fit CryptIC into a beige box measuring 10 cm on all sides. “We were able to make use of a Raspberry Pi Zero just as it comes out-of-the-box,” Emmanuel says. “On that is a space-hardened version of Raspbian which has been previously commissioned by ESA. It removes the unnecessary parts of the system so it has fewer libraries, some of which we had to reinstall. But our main task after that was to write the software in Python using some of the existing libraries as well as our own.”

    CryptIC

    Cryptic clues

    The project’s Raspberry Pi Zero also needed to be covered with a plastic ‘conformal’ coating. “This is an ISS requirement and it merely prevents fire hazards – you wouldn’t know it’s there unless you looked really hard,” Emmanuel says. The computer is controlled from a laptop based on Earth at ESA’s ESTEC technical centre in the Netherlands, with data sent back and forth in near real time via the ICE Cubes operator Space Applications Services in Brussels. “We’re not sending any real sensitive data – just strings of ‘hello world’, articles, and images,” Emmanuel continues. It is testing the feasibility of using a backup key that can’t be compromised from the ground, while studying whether microprocessor cores that are based around field-programmable gate arrays are able to offer redundancy if a core is affected by radiation.”

    The experiments began to run continuously from September and Emmanuel says the team is looking to stick with a Raspberry Pi Zero in the future too. “Ideally, we’d like to have more RAM and a version without WiFi – we had to buy an older one on eBay because the ISS doesn’t allow WiFi without a special procedure – but it’s near-perfect for what we want,” he concludes. 

    CryptIC uses the space-specific Raspbian Hardened OS

    Quick facts

    • Communication with satellites isn’t always secure

    • CryptIC is a way of boosting mission safety

    • Its form factor is near-identical to CubeSats

    • This is connected to – and powered by – the ISS

    • Its Raspberry Pi Zero is the first in space

    ESA engineer Lukas Armborst with the CryptIC

  • Top 10 AI projects

    Top 10 AI projects

    Reading Time: 4 minutes

    Machine learning and AI are just a normal part of the world now, which in some ways is kind of hard to process. On the plus side, it means we can have computers do really fun, useful (and useless) stuff for us. Here are ten ways to get your Raspberry Pi to learn and do. 

    Robot cartoon-hunter

    Waldo – or Wally as we call him in the UK – is a very elusive man who likes to travel around the world. The puzzle books asking young folks to find Wally in a busy crowd of people are very popular and can be tricky to solve; that is, unless you’re an AI character hunter.

    There's Waldo robot cartoon character hunter

    Self-driving racers

    A lot of Raspberry Pi robots aren’t autonomous – the Formula Pi racers are, though: using computer vision and your own bits of code, the aim is to make your robot the fastest and most accurate racer.

    MonsterBorg robots being used at a Formula Pi autonomous racing event

    Magical item identifier

    This project uses Microsoft’s Cognitive Services to look at a picture for identification. When it works, it’s pretty magical; however, it doesn’t always work. Still, it will then use text-to-speech software to tell you what’s in front of you. A future product for blind people, maybe?

    Seeing Wand checks items held in front of it against an image database and then announces what they are

    Computer chess IRL

    The ‘Mechanical Turk’ was a magic trick where chess players would manipulate mechanical arms to make it look like people were facing a machine that could play chess. The Raspberry Turk is no magic trick – it does it for real.

    Raspberry Turk mechanical chess opponent

    Computer-aided vegetable categorisation

    One of the promises of AI is that it can help people out with more mundane parts of work. The cucumber sorter allows a farmer to quickly and efficiently categorise his cucumber harvest. We’ve seen it in action and it is fun.

    Better than a bean counter, this device efficiently sorts out your veg as you harvest it

    Self-driving boat

    Using GPS and a series of sensors and motor controllers, the Sailbot is one of a few autonomous sailing-boats that makes use of Raspberry Pi to control itself in races around the world.

    The UBS Sailbot is one of several Raspberry Pi-controlled yachts

    Fish-controlled robot tank

    Living in a fish bowl must feel a bit limiting. So Alex Kent decided to allow his goldfish to move with the help of a computer vision project that senses where the fish is swimming, and moves its tank accordingly. Does it notice? Or just forget?

    Just Keep Swimming mobile fish tank heads whichever the direction its resident does

    Land-mine clearing project

    This incredible project uses a low-cost robot design to probe abandoned (and extremely dangerous) minefields by sniffing out the mines and then detonating them. While this does result in each robot’s heroic demise, it’s much more cost-effective than other solutions.

    The C-Turtle landmine-clearing robot detects and safely detonates hidden explosives

    Self-driving drone

    This project didn’t quite achieve full autonomy for a quadcopter/drone, but it got pretty close. Maybe you can build upon this design and create incredible aerial spectacles with a few drones?

    This University of Warwick quadcopter came tantalisingly close to functioning autonomously

    Testing breathable tubes

    Stents are little tubes used to keep a patient’s airway open. As they are vital, they need to be tested to extremes – this robot is able to control clamps that squish and compress the stent hundreds of thousands of times and monitor if and when it breaks.

    Stents keep patients' airways clear. This robot rigorously tests them

  • Alex Mous interview

    Alex Mous interview

    Reading Time: 3 minutes

    One of the original purposes of Raspberry Pi was to help ignite a passion for computing in young people today, and Alex is definitely one of these people.

    “In 2014, I received my first Raspberry Pi (a Model B+) for Christmas,” he tells us. “I started out by teaching myself Python using the projects in Adventures in Raspberry Pi. Using this knowledge of Python, I created several apps (both for Raspberry Pi and Windows). After that, I became interested in web design. I still do a lot of web design today, as shown in the recently completed coded-from-scratch website, eikyutsuho.com. The next language I tackled was C/C++, and I am still learning the ins and outs of it.”

    Five years later and, at the age of 15, Alex is already working on an Associate Degree in Electrical and Computer Engineering, and he’s also giving back to the community by helping out with the Seattle Raspberry Jam.

    Alex Mous is an electrical and computer engineering student and co-hosts Seattle Raspberry Jam meetings

    Why did you start co-organising the Seattle Raspberry Jam?

    I began co-organising the Seattle Raspberry Jam in May because only a few people were showing up to each meeting. I thought that with some time and effort, I could increase the membership to something more respectable, such as 10 members, for example.

    How long has the Jam been running?

    A makerspace called Jigsaw Renaissance started the Seattle Raspberry Jam in August 2013. Sadly, in July 2015, the makerspace decided that they no longer wanted to run the Jam. Stephen (my co-organiser) started up meetings again in August of 2015. I first joined the club in mid-2016 (I found out about it through the Jam Map).

    What kind of attendees do you get at the Jam?

    We get just about everyone, from seasoned programmers who began coding during the days of punch cards to first-time programmers and Raspberry Pi users. People often come in confused about how to get started with Raspberry Pi and we try to point them in the right direction.

    The people who do come seem to enjoy it. We have just joined up with the ideaX Makerspace; they are happy to support our Raspberry Jam. We’re hoping that ideaX Makerspace will give our Jam more visibility.

    Seattle Raspberry Jam details

    The Seattle Raspberry Jam takes place every third Wednesday of the month at the Bellevue Library. Entry is free, and it’s a great way to learn something about Raspberry Pi and geek out with your fellow makers and coders!

    Seattle Raspberry Jam accepts anyone as a member

    What’s your favourite Raspberry Pi project you’ve made?

    My favourite completed project is an instant camera, christened the PolarPiBerry. It uses a thermal printer, touchscreen, arcade-style button, and multiple battery packs (a future improvement is to combine the power sources) for the hardware, and a custom Python WX GUI as the interface with a live stream from the camera.

    PolarPiBerry Raspberry Pi-controlled instant print camera designed by Alex Mous

    I am currently working on a self-balancing robot for under $50. It uses the cheap yellow geared DC motors, an L298 dual H-bridge, an MPU6050 IMU, a DC-DC boost converter, and a 6×AA battery pack. I have designed and 3D-printed the chassis, but I am still working on the code.  

    Alex Mous shows off his self-balancing robot to Seattle Raspberry Jam members

  • Build a Raspberry Pi cluster computer

    Build a Raspberry Pi cluster computer

    Reading Time: 7 minutes

    Raspberry Pi computers are famously cheap and cheerful. Great for playing around with and the odd little project, right? Well, sometimes. 

    However, our little friend is a surprisingly powerful computer and when you get lots of them working together, amazing things can happen. 

    The concept of computer ‘clusters’ (many computers working together as one) is nothing new, but when you have a device as affordable as Raspberry Pi, you can start to rival much more expensive systems by using several in parallel. Here, we’ll learn how to make a cluster computer from a lot of little computers.

    You’ll need

    Four Raspberry Pi 4 computers
    A cluster case
    Ethernet switch
    Multi-port USB PSU
    Four USB C cables  
    Four Ethernet cables

    Cluster assemble!

    A cluster of Raspberry Pi computers can start with as little as two and grow into hundreds. For our project, we’re starting with a modest four. Each one, known as a ‘node’, will carry out part of our task for us and they all work in parallel to produce the result a lot quicker than a single node ever could. Some nice ‘cluster cases’ are available, and we start here by assembling our Raspberry Pi 4B computers into a four-berth chassis. Many different configurations are available, including fan cooling.

    A dedicated inexpensive switch will speed up communications. Raspberry Pi 4 computers can take advantage of full-bandwidth Gigabit Ethernet

    Power up

    Consider the power requirements for your cluster. With our four nodes it’s not going to be ideal to have four PSUs driving them. As well as being ugly, it’s inefficient. Instead, track down a good-quality, powerful multi-port USB charger that is capable of powering your chosen number of computers. Then all you need are the cables to link them and you’re using a single mains socket. USB units are available that can handle eight Raspberry Pi computers without breaking a sweat. Do be careful of the higher demands of Raspberry Pi 4. 

    Get talking

    A cluster works by communication. A ‘master’ node is in charge of the cluster and the ‘workers’ are told what to do and to report back the results on demand. To achieve this we’re using wired Ethernet on a dedicated network. It’s not essential to do it this way, but for data-intensive applications it’s advisable for the cluster to have its own private link-up so it can exchange instructions without being hampered by wireless LAN or other network traffic. So, in addition to wireless LAN, we’re linking each node to an isolated Gigabit Ethernet switch.

    Inexpensive cluster cases like this one are available in a wide range of configurations

    Raspbian ripple

    We’re going to access each node using wireless LAN so the Ethernet port is available for cluster work. For each ‘node’, burn Raspbian Buster Lite to a microSD card, boot it up, and make sure it’s up to date with sudo apt -y update && sudo apt -y upgrade. Then run sudo raspi-config and perform the following steps:

    Change the ‘pi’ user password.

    Under ‘Networking’, change the hostname to nodeX, replacing X with a unique number (node1, node2 etc.). Node1 will be our ‘master’.

    Enable WiFi if desired.

    Exit and reboot when prompted.

    Get a backbone

    The wired Ethernet link is known as the cluster’s ‘backbone’. You need to manually enable the backbone, as there is no DHCP server to help. We’re going to use the 10.0.0.0 subnet. If your regular network uses this, choose something different like 192.168.10.0. For each node, from the command line, edit the network configuration:

    sudo nano /etc/dhcpcd.conf Go to the end of file and add the following:

    interface eth0

    static ip_address=10.0.0.1/24

    For each node, replace the last digit of ’10.0.0.1’ with a new unique value: 10.0.0.2, 10.0.0.3, and so on. Reboot each node as you go. You should be able to ping each node – for example, from 10.0.0.1:

    ping 10.0.0.2

    Brand new key

    For the cluster to work, each worker node needs to be able to talk to the master node without needing a password to log in. To do this, we use SSH keys. This can be a little laborious, but only needs to be done once. On each node, run the following:

    ssh-keygen -t rsa

    This creates a unique digital ‘identity’ (and key pairs) for the computer. You’ll be asked a few questions; just press RETURN for each one and do not create a passphrase when asked. Next, tell the master (node1, 10.0.0.1 in our setup) about the keys by running the following on every other node:

    ssh-copy-id 10.0.0.1

    Finally, do the same on the master node (node1, 10.0.0.1) and copy its key to every other node in the cluster.

    Use a multi-port USB charger to power your cluster nodes, but make sure your choice of unit has enough amps

    Install MPI

    The magic that makes our cluster work is MPI (Message Passing Interface). This protocol allows multiple computers to delegate tasks amongst themselves and respond with results. We’ll install MPI on each node of our cluster and, at the same time, install the Python bindings that allow us to take advantage of its magical powers.

    On each node, run the following:

    sudo apt install mpich python3-mpi4py Once complete, test MPI is working on each node

    mpiexec -n 1 hostname

    You should just get the name of the node echoed back at you. The -n means ‘how many nodes to run this on’. If you say one, it’s always the local machine.

    Let’s get together

    Time for our first cluster operation. From node1 (10.0.0.1), issue the following command:

    mpiexec -n 4 –hosts 10.0.0.1,10.0.0.2,10.0.0.2,10.0.0.4 hostname

    We’re asking the master supervisor process, mpiexec, to start four processes (-n 4), one on each host. If you’re not using four hosts, or are using different IP addresses, you’ll need to change this as needed. The command hostname just echoes the node’s name, so if all is well, you’ll get a list of the four members of the cluster. You’ve just done a bit of parallel computing!

    Is a cluster of one still a cluster?

    Now we’ve confirmed the cluster is operational, let’s put it to work. The prime.py program is a simple script that identifies prime numbers. Enter the code shown in the listing (or download it from magpi.cc/EWASJx) and save it on node1 (10.0.0.1). The code takes a single argument, the maximum number to reach before stopping, and will return how many prime numbers were identified during the run. Start by testing it on the master node:

    mpiexec -n 1 python3 prime.py 1000

    Translation: ‘Run a single instance on the local node that runs prime.py testing for prime numbers up to 1000.’

    This should run pretty quickly, probably well under a second, and find 168 primes.

    Our cluster works by assigning a master node. The master assigns tasks to its member nodes and waits for them to report their results.

    Multiplicity

    In order for the cluster to work, each node needs to have an identical copy of the script we need to run, and in the same place. So, copy the same script to each node. Assuming the file is in your home directory, the quick way to do this is (from node1):

    scp ~/prime.py 10.0.0.x:

    Replace x with the number of the node required: scp (secure copy) will copy the script to each node. You can check this has worked by going to each node and running the same command we did on node1. Once you are finished, we are ready to start some real cluster computing.

    Compute!

    To start the supercomputer, run this command from the master (node1):

    mpiexec -n 4 –host 10.0.0.1,10.0.0.2,10.0.0.3,10.0.0.4 python3 prime.py 100000

    Each node gets a ‘rank’: a unique ID. The master is always 0. This is used in the script to allocate which range of numbers each node processes, so no node checks the same number for ‘primeness’. When complete, each node reports back to the master detailing the primes found. This is known as ‘gathering’. Once complete, the master pulls all the data together and reports the result. In more advanced applications, different data sets can be allocated to the nodes by the master (‘scattering’).

    Final scores

    You may have noticed we asked for all the primes up to 1000 in the previous example. This isn’t a great test as it is so quick to complete. 100,000 takes a little longer. In our tests, we saw that a single node took 238.35 seconds, but a four-node cluster managed it in 49.58 seconds – nearly five times faster! 

    Cluster computing isn’t just about crunching numbers. Fault-tolerance and load-balancing are other concepts well worth investigating. Some cluster types act as single web servers and keep working, even if you unplug all the Raspberry Pi computers in the cluster bar one. 

    Top tip: Load balancing

    Clusters are also useful for acting as a single web server and sharing traffic, such as Mythic Beast’s Raspberry Pi web servers.

    Top tip: Fault tolerance

    Certain cluster types, such as Docker Swarm or Kubernetes, allow individual nodes to fail without disrupting service.

    Each Raspberry Pi in the cluster is known as a node and works in parallel with the others to produce faster results than they could individually

  • Perpetual Chimes project showcase

    Perpetual Chimes project showcase

    Reading Time: 3 minutes

    The Perpetual Chimes project is very clever – a set of augmented wind chimes which, since they are indoors, require the user to interact with them in order to create an escapist soundscape played through headphones.

    Frazer Merrick, a sound artist and educator, Frazer enjoys circuit bending, field recording, and physical computing. He came up with the idea for the chimes while experimenting with ways of creating interactive musical instruments, and exploring how sounds can transform a space. “At the time I was really interested in escapism,” he recalls, “so I knew I wanted to make a headphone-based interactive installation that captivated the player/listener – something that didn’t make much acoustic sound, but instead something just for the player.”

    Perpetual Chimes rely on human interaction to move them

    Frazer initiated the idea back in 2016, creating a prototype where the chimes were suspended from a brake disc hanging from a mic stand. Keen to improve on this first version, Frazer and a collaborator from @LimboEducation began work again in 2018 to revive and improve the project: “We set to work making it far more robust and, importantly, standalone.”

    The sound of music

    So, how do the chimes work? Frazer explains, “When you hit one of the chimes, it strikes a disc in the middle. Both these elements are connected to a Makey Makey (the central disc being ‘earth’), which then triggers a key press on [the project’s] Raspberry Pi. I programmed a patch in Scratch to play audio files when it receives these key presses, which you then hear over the headphones. There is no acoustic sound other than the dull clunk of stainless steel and copper pipes hitting one another. However, in the headphones is an atmospheric soundscape of calming field recordings and synthesizer drones.”

    When a chime hits the central disc, it completes a circuit and triggers a key press on the Raspberry Pi

    Frazer made the recordings using the Alchemy synthesizer in Logic Pro. “I used the amplitude of a waterfall recording (which I made in the Isle of Mull) to affect different parameters of the synthesizer,” he says. “In Scratch, there’s a variable counting every time the chimes ‘strike’ and when this is a modulus of 25, one of three large pulsating bass notes plays too, adding an element of surprise to the installation and encouraging you to keep playing and discovering more combinations of notes. Alongside this is a subtle field recording of the coastline from the same peaceful trip to the Isle of Mull, completing the escapist soundscape.”

    Heavenly harmonies

    Sounds idyllic, and Frazer has clearly enjoyed seeing people explore the possibilities of the chimes: “It’s so rewarding to see people playing and smiling with the chimes, creating their own soundscapes by activating them (some harder than others). My favourite comment was someone who called the work ‘curious’, as this summed up my work so much better than I ever could.”

    Perpetual Chimes produce a calming soundscape to be enjoyed using headphones

    Frazer admits that it was a challenge to fit all of the components inside the head unit of the chimes, but “after cutting down a few cables and shuffling things around, I managed to fit it all in. Thankfully the support system is designed so I can easily adjust the hanging height from the beam above, which is very useful when installing in different venues.”

    It was also his first project with a Raspberry Pi, which he used “because I wanted the chimes to be unmanned and to be installed for long periods of time, all without having to worry about securing a laptop somewhere behind the scenes.” 

    A Makey Makey and Raspberry Pi 3B are housed in a 3D-printed case

    Quick facts

    • Frazer 3D-printed the case for the electronics

    • Frazer exhibited the chimes at Colchester School of Art

    • A lot of holes needed to be drilled in the project!

    • The Scratch code can be found at magpi.cc/gPpuw4

    • Frazer plans to switch from Scratch to Pure Data for better audio quality

  • Flirc Raspberry Pi 4 case review

    Flirc Raspberry Pi 4 case review

    Reading Time: 3 minutes

    Here’s where things get clever: inside the case is a protruding heat sink that reaches down to Raspberry Pi 4’s CPU. This turns the whole of the aluminium case into a giant heat sink, cooling down your Raspberry Pi 4.

    Inside the pack is a square thermal pad (similar in substance to Blu Tack). You use this to squidge the Raspberry Pi to the heat sink. Putting together the case is ludicrously simple: you simply drop a Raspberry Pi in the bottom half, attach the thermal paste, squidge down the lid, and use four screws to hold everything together.

    Flirc claims that this is “the most beautifully crafted Raspberry Pi 4 case” and it’s not a wholly unwarranted claim. It certainly has a sense of style. Everything is neatly constructed from high-quality materials and there’s considerable charm to the heat sink. The microSD card slot is easily accessible, and a small cut-out on the enclosure enables the LEDs to shine through.

    On the box

    One downside to the sealed approach is that the GPIO pins are hidden away inside the case. Unlike the official case, the lid cannot be quickly removed to provide access to the pins. To Flirc’s credit, it has addressed this issue via a small gap on the underneath of the Flirc Raspberry Pi 4 case, which could be used with a breakout I/O cable. But it’s an ungainly addition to such a lovely looking case.

    If you plan to use Raspberry Pi as a desktop computer, then this might be a valid trade-off. However, for many of us, GPIO pins are the very essence of Raspberry Pi.

    Under pressure

    We stress-tested a Raspberry Pi 4 board on its own vs a Raspberry Pi 4 inside the Flirc case to see what temperatures it reported.

    WARNING!: Stress testing should only be done for short periods. Watch your Raspberry Pi and restart afterwards.

    We used stress (apt install stress) and the following script from Core Electronics to test our Raspberry Pi 4 while measuring temperature:

    while true; do vcgencmd measure_clock arm; vcgencmd measure_temp; sleep 10; done& stress -c 4 -t 300s

    This puts all four cores of Raspberry Pi 4 under stress. For each test, we left the Raspberry Pi to run for five minutes. Warning! Don’t do this at home without doing your research first. Unsurprisingly, the Raspberry Pi with no heat sink attached quickly went up to 79 °C and hovered at that level for the rest of the test, nudging up against (but not pushing over) the level where Raspbian starts to throttle the CPU.

    Next, we put a Raspberry Pi into the Flirc Raspberry Pi 4 case and ran the same test. This time it idled at a mere 28 °C and our five-minute stress test took it up to a mere 46 °C. Because this is comfortably below the threshold, it opens up a world of overclocking (something that has been reintroduced on Raspberry Pi 4).

    We took the CPU clock speed up to 1.75GHz. The overclocked Raspberry Pi (inside the Flirc case) idled at 41 °C, and running our five-minute stress test took it up to 67 °C. Again, comfortably within a threshold. We also played around with CPU clock speeds up to 2.0GHz, which idled at 48 °C and maxed out at 69 °C.

    We’re going to experiment some more with overclocking, which makes this a fun case. Expect a tutorial shortly.

    Verdict

    8/10

    We love the style of the Flirc case, and its heat sink opens up a world of overclocking. If only the GPIO pins remained accessible. If that’s not a deal-breaker for you, though, then this is a great case to get.

  • Code Club India collaboration success

    Code Club India collaboration success

    Reading Time: 2 minutes

    Over the last few months, Pratham Education Foundation and Code Club have successfully piloted a programme across 40 villages in rural areas of two Indian states, supporting children and young volunteers there to get hands-on with coding. 

    Pratham (pratham.org.in) is one of India’s largest NGOs (non-governmental organisations). It was established in 1995 with the aim of providing educational opportunities for young people living in the slums of Mumbai. 

    To lay the groundwork for their collaboration with Code Club, Pratham first held a series of village meetings at which 16- to 25-year-olds could sign up to become Code Club volunteers. They attended a training session to build their confidence and learn how to set up a Raspberry Pi computer, use Code Club Scratch projects, and share their coding skills with young people attending their Code Clubs. 

    The kits needed for these Code Clubs each contained a Raspberry Pi computer, keyboard, monitor, and a mouse and were provided by Pratham.

    Pratham Education supplied Raspberry Pi-based computing kits for Code Club members to use

    Success story

    The initiative was a remarkable success: 1109 Code Club members took part and 50 young adults trained as volunteers. The Pratham Code Club project has now funded 244 Code Clubs across 40 villages in Uttar Pradesh and Maharashtra. 

    The aim was to introduce youngsters to coding and digital technology, while adults learned how to become Code Club leaders. 

    A youth volunteer demonstrates her newly-acquired coding skills at Code Club India

    One of the youth volunteers summed up the Code Club’s importance: “It is only because of these sessions that I was introduced to this world of computers and I know what coding means.”

    To partner with Raspberry Pi in India, email india@raspberrypi.org. To help Code Club grow in other countries, email hello@codeclubworld.org

  • Homebrew retro gaming: legal ROMs for RetroPie and Lakka

    Homebrew retro gaming: legal ROMs for RetroPie and Lakka

    Reading Time: 6 minutes

    Free legal ROMs for RetroPie and Lakka

    Many ROMs are protected by copyright, and it is illegal to download copyrighted ROMs from the internet. But there are lots and lots of legal ROMs for RetroPie and Lakka. We use these ROMs to test out Lakka and RetroPie, and to demonstrate how to set up games consoles. We thought it’d be a great idea to put all these ROMs in one place where our readers can find them.

    See also:

    Homebrew games for Raspberry Pi

    Some holders of the original copyright have given their blessing for games to be distributed across the internet. There is also a new kind of game, called ‘homebrew’. These are modern games that are developed for classic hardware. If you think retro gaming is just about old games, then we’ve got some great news. Thanks to the homebrew scene, new games for old systems are appearing all the time. Original games rub shoulders with ‘demakes’, modern games on old systems. We’ve picked a few of our favourites and provided links for finding out more.

    Blade Buster (NES)

    This is one of our favourite homebrew games for Raspberry Pi. Blade Buster is a vertical shoot-‚em-up. Developed by High Level Challenge, it pushes the classic NES system to its limits, with incredibly high production values.

    Blade Buster

    Nozedyve (ZX Spectrum)

    Charlie Brooker’s Black Mirror episode Bandersnatch made headlines with its innovative ‘choose your own adventure’ format. It was riddled with references to the home computer scene of the 1980s, ‘Tuckersoft’ being based on Liverpool powerhouse Imagine. ZX Spectrum enthusiast Matt Westcott was commissioned to bring one of the featured games, Nozedyve, to life.

    Nohzdyve

    Alter Ego (PC, Linux, ZX Spectrum, NES)

    In this platform game, you control our hero and his mirrored twin (the ‚alter ego‘). When you move, the alter ego moves in the opposite direction and you can switch between both characters. Click here to get Alter Ego.

    Alter Ego

    Anguna (Nintendo DS, Gameboy Advance)

    This homebrew role-playing game (RPG) features five dungeons and a large overworld to explore. In Anguna, you’ll explore hidden rooms and fight enemies and boss monsters. Like most RPGs you’ll find multiple weapons and swords, plus magic boots and other items.

    Anguna

    Nova The Squirrel (NES)

    Fancy a platformer for the NES? Then Nova The Squirrel is the one to get. Completely open, you can view its source code on GitHub. With a bit of investigation you should be able to make your own levels. There is also a generic version of the engine, which you could use as a starting point to build your own NES platform game.

    Nova The Squirrel

    Super Boss Gaiden (SNES Playstation)

    Super Boss Gaiden is a game made for the ultra-rare Nintendo Playstation prototype console that never made it to market. In the game, a company president learns about the existence of the prototype and goes on a rampage.

    Super Boss Gaiden

    Tanglewood Demo (Sega Mega Drive / Genesis)

    Tanglewood is a brand new puzzle-platform game for the classic Sega Mega Drive console. You can purchase the game as a cartridge, and it’s going to be coming soon to PC, Mac, and Linux. A demo for the game is available via free download.

    Tanglewood

    Hibernated One (ZX Spectrum / Commodore 64 / Amstrad CPC)

    In Stefan Vogt’s Hibernated One adventure you play Olivia, awakened from hibernation when an alien spacecraft traps her ship, Polaris-7, in a tractor beam. With no communication from the other craft and surrounded by death and decay, can she escape? This is a text adventure in the classic style and the opening chapter in an ongoing series.

    Hibernated One

    Halo 2600 (Atari 2600)

    Yes, you read that correctly and yes, we are talking about Microsoft’s legendary Halo franchise. Remarkably, unlike many demakes that can infringe copyright, Halo 2600 was written by Ed Fries, leader of the original Xbox project, and has been given Microsoft’s blessing. Some cartridges were manufactured by AtariAge, although you can download the game for free.

    Halo 2600

    Teeter Torture (MAME)

    Teeter Torture is an original from 1982 which has now been released free of charge for non-commercial use by Exidy. It has mysterious origins and only one cabinet is known to exist, which luckily still works! You control a cannon on a trolley that balances on a barrel of TNT. Shoot the aliens or they’ll topple you over, triggering the detonator.

    Teeter Torture

    Relentless (Commodore 64)

    Relentless 64 is a homebrew of a homebrew. Originally, the Amstrad CPC version was the winner of a 16kB cartridge competition in 2013 and was so well received it was commercially released on cassette. The game is a classic shoot-’em-up and lives up to its name as there’s no pause and no bosses – it just gets harder and harder.

    Relentless 64

    More legal ROMs for RetroPie / Lakka

    Need more games for your console? These sites are full of homebrew and legal downloads.

    World of Spectrum

    The admins of this site have been thorough in getting clearance to host the many thousands of games available.

    MAME Official Site

    A selection of legal ROM downloads of classic arcade machines can be found on the MAME website.

    Vintage Is The New Old

    A massive collection of homebrew software for many different platforms can be found on Vintage Is The New Old.

    Homebrew Legends

    A community-focused site, Homebrew Legends is essential for keeping up with the latest releases
    .

    Gremlin Graphics World

    Gremlin Graphics was one of the great British video game development houses of the 1980s. Gremlin Graphics World has permission to distribute all Gremlin Graphics video games with „permission from the software house itself“. Rediscover old classics such as Monty Mole, Thing on a Spring, and Lotus Esprit Turbo Challenge.

    Gremlin Interactive

    A warning on downloading ROMs

    Remember. It is illegal to download copyrighted ROMs from the internet. The MagPi does not endorse video game piracy and strongly recommends that you stick to emulators that do not use any protected software, such as BIOS files, and stick to game downloads that are offered with the consent of the rights holder.

  • Design retro game maps and levels in PICO-8

    Design retro game maps and levels in PICO-8

    Reading Time: 6 minutes

    In this tutorial we will be turning our simple one-screen space shooter into a scrolling shoot-’em-up! You’ll learn how to use PICO‑8’s handy map editor to quickly and easily draw out levels, and how to use the sprite editor to create terrain tiles. We’ll talk about using sprite flags to distinguish between background and foreground and how to spawn enemies. Speaking of which, we’ll also talk about level design basics and introduce a new turret enemy type to add extra spice and challenge to your game. There’s lots to get through, so let’s get started!

    You’ll need

    • PICO-8

    • Raspberry Pi

    • Keyboard and mouse

    • To have completed the earlier parts of this retro game design tutorial

    • Download the code for this tutorial here

    A blank canvas

    Much like every other aspect of game development, PICO-8 has a quick and easy solution for designing levels. Switch to the map editor by selecting it from the editor menu at the top right. At first glance, it looks a lot like the sprite editor, with the same sprite sheets and drawing tools at the bottom of the screen. The difference is that, instead of plotting coloured pixels, the map editor paints with our finished sprites. Try this out by selecting a sprite and drawing on the canvas above.

    Chunks of dirt

    We can’t build a level out of enemy and player sprites – that would be sheer insanity! PICO-8’s map editor is grid based, so we’ll need to create some new terrain sprites that we put together as tiles. Figure 1 shows a 3×3 square of sprites that can be tiled easily, with a couple of variations along the side. Switch to the sprite editor and create something similar. We’ve chosen suitably weird-looking purple asteroids for our terrain, and we’ve also created simple background sprites out of a chequer-board ‘dither’ pattern that we can use to imply depth.

    Figure 1 A big block of terrain tiles makes a good palette with which to paint your levels. Distinguish between background and foreground with sprite flags

    Tiles for miles

    Now we have our raw level-making material, let’s start working with it. Switch back to the map editor. You can zoom the canvas with the mouse wheel and pan with the pan tool. Hit the SPACE bar to view gridlines, and you’ll see that your canvas is 128×64 tiles, with grid reference (0, 0) being the top-left tile. As PICO-8’s screen resolution is 128×128 pixels, and each tile is 8×8 pixels, a single screen in PICO-8 is 16×16 tiles. Use your terrain sprites to draw some asteroids in the top-left 16×16 tiles of the canvas.

    Mapping it all out

    Let’s see what this looks like in game. First of all, comment out the enemy wave code, so that we can explore our level without being rudely interrupted by space blobs. You can use –[[..]] for block comments. Next, add map(0,0,0,0,128,64) to _draw() just after where we draw the background stars. This function tells PICO-8 to draw a 128×64 block of tiles starting from tile reference (0,0) on the map to coordinates (0,0) on the screen. Run your game and you should now see your asteroids. Great work, but it’s all rather static – let’s get this level scrolling!

    Look into the camera

    To turn our game into a scrolling shoot-’em-up, we will need to use a scrolling camera. Declare new variables camx,camy = 0,0 in _init() for the camera’s coordinates. Next, add camx+=1 to the start of _draw(), followed by camera(camx,camy) which sets the top left of PICO-8’s built-in camera to these coordinates. We’ve modified our player, laser, and draw background, score, and game-over message code to be locked to the new camera coordinates. As the map is only eight screens long, we’ve also written a cheeky bit of code to move the camera and player to the next row on the map when it reaches the end.

    Draw your level in PICO-8’s map editor for enemy and terrain placement

    A red flag

    Modifying the code is mainly a matter of changing boundaries to be set to camx and camy instead of arbitrary values; we’ll also add player.x+=1 to _update() so that the player scrolls with the camera. See the code listing for more details. You’ll have probably noticed that we can fly straight through the terrain unimpeded, so let’s add terrain collision detection. We’ll use sprite flags to do this. Set the sprite flags (those radial buttons above the sprite sheet tabs in the sprite editor) of each of your terrain tiles so that flag 0 is on. It should light up red.

    Deep impacts

    Sprite flags are a way of ‘marking’ sprites. In this case, we will treat any sprite with flag 0 as solid terrain that our player can crash into. To actually detect the collision, we’ll create a new function player_terrain_collision() which will check four points of a square around the player’s coordinates, retrieve whatever sprite is there, and return true if that sprite has flag 0 activated. Then we’ll add few lines in our update loop that’ll call that new function and kill the player if it returns true. We nearly have everything in place!

    Enemy placement

    Next, we want to slightly modify our enemy code so that instead of spawning in endless waves, we can place them in our level and they will attack when they appear on camera. See the code listing for the changes. To place enemies in the level, we will use one of our existing enemy sprites in the map editor. Then we will add a few lines to _init() that will check every map tile for enemy sprites and spawn enemies when it finds them – simple! Now that we can place terrain and enemies, we can begin the level design proper.

    Flow state

    Level design is as much an art as it is a science. For every rule of good level design, there are a hundred examples to prove it wrong. That being said, for your first few levels there are certainly some guiding principles you can follow. It’s a good idea to start simple and gradually increase the challenge as your players become better at the game. This is to keep players in a satisfying state of ‘flow’ where a level is not too easy as to be boring, or too hard to be frustrating.

    Difficulty curve

    In our space shooter, difficulty is determined by the number and location of enemies and the placement of terrain. Modifying these factors allows us to control the challenge and ideally create a smooth ‘difficulty curve’. In our level, enemies are introduced singularly at first, then in increasing numbers. Terrain is then introduced, then enemies and terrain, and lastly challenging combinations of both. You can see how new elements are introduced one at a time and in situations that allow the player to learn their behaviour before the difficulty is increased.

    Our level introduces new elements one by one and increases in difficulty at the end of each segment

    Reinforcements

    Variety is the spice of life and although our green blobs from space have a certain appeal, it is the introduction of new elements, or new combinations, that keeps a level entertaining. That’s why we’ve created a new enemy type, the turret. You can see the code, but essentially it is a malignant mutant that fires a mucus projectile at the player every few seconds. How delightful! This gives us more possibilities for interesting combinations with the other elements in our game; for example, turrets in an asteroid field or amongst waves of enemies.

    A happy ever after?

    So, your player has defeated every wave of enemy, dodged every asteroid, and made it to the end of your level. What now? Well, the polite thing to do would be to reward them in some way, or give them one final gigantic boss battle. Either way, we will need a congratulations message to tell the player that they are the saviours of mankind. As a final touch, we’ve added a message that will show when the player makes it all the way to the end. Well done space fighters, the galactic federation thanks you!

    Top tip

    Sprite flags

    Sprite flags are extraordinarily useful for lots of things, such as distinguishing between drawing layers or marking objects that collide.

    Dan Lambton-Howard

    About the writer

    Dan Lambton-Howard is an independent game designer based in Newcastle upon Tyne, where he is lucky enough to make games for his PhD.

    For earlier parts of this retro game design tutorial click here.

    Code for this tutorial can be downloaded here.

  • Social Media without the Internet

    Social Media without the Internet

    Reading Time: 4 minutes

    If you’re anything like us, you probably spend many hours liking, following, and friending on social media. But have you ever pondered how this kind of digital interaction might transfer to the real world? It’s a concept that interactive artist Tuang Thongborisute wanted to explore, leading her to create the ‘Social Media without the Internet’ interactive performance art project.

    Tuang Thongborisute is a Raspberry Pi enthusiast, NCCE facilitator, teacher, and coder who enjoys creating new projects and hacks to inspire others to start learning.

    Tuang Thongborisute encourages people to 'like' her project by tapping the touchscreen on her jacket

    The original idea for the ‘Social Media without the Internet’ came from her research into a ‘digital sense’. “Its hypothesis says that people nowadays might gradually develop an additional sense to perceive digital contents,” she says.

    Social Media without the Internet was created “to investigate people’s familiarity of social media’s data and interactions in the physical world, and to explore the digital sense by applying it to the sense of touch.”

    Part of the inspiration also came from a curiosity to examine society’s sceptical thoughts about the lack of physical interaction in online communication and to see if physical interaction is significant to a meaningful connection.

    Giving a high five results in a 'like' shown on the touchscreen

    Social interactions

    To explore these themes, Tuang created the ‘Social Touch Suit’, a blazer featuring numerous electronic elements – controlled by a Raspberry Pi, aided by an Arduino – which enable people the wearer meets to engage in six social interactions.

    ‘Add friends’ is achieved by a handshake, connecting two conductive rings on the wearer’s fingers. “With some practice, it works naturally when interacting with people,” says Tuang.

    ‘Unfriending’ is easy: just a push of a button located on the left side – “near the heart, which most people [have had] broken at least once in a lifetime anyway.”

    ‘Following’ someone involves hand-holding, triggered by customised extendible strings with a microswitch. “Typically, people ask the wearer to follow them after they have followed the wearer for a while because at the end of the day, everybody also needs some attention back.”

    ‘Follow’ is a tap on a Velostat sheet (pressure-conductive resistant) on the right shoulder. “A good follower and friend would put their hand gently on the wearer’s shoulder.”

    A ‘Like’ can be achieved via two interactions: a high-five, triggered by FSR pad attached to the edge of the right sleeve, or tapping a button on the 7-inch touchscreen.

    ‘Dislike’ is also done via the touchscreen – “I don’t remember anyone intentionally disliking me… except my best friends, who did it several times.”

    In addition, three tiny cameras are attached to the blazer, to broadcast the interaction in real time using a local network for performing in a closed environment like an indoor gallery. “This feature mimics an action of social media users’ observation on other people’s interaction without any interference,” says Tuang.

    Tap the shoulder pad to follow the wearer; follow numbers are shown on the LCD

    Out and about

    When wearing the blazer in public, Tuang found that people were curious or confused. “Some may hesitate to ask or interact, but some partake in face-to-face conversation,” she tells us.

    “From these experiences, I think what’s interesting is that these data of physical interaction have more potential to come from a sincere feeling and determination after they understand how it works. Because no one can give this feedback remotely, there’s some work that needs to be done to give and receive the numbers and to actually do it face-to-face with one another.”  

    Tuang's interactive blazer prompts plenty of social media responses

    Quick facts

    • The electronics can be removed to wash the blazer

    • A 1 m strip of 144 RGB NeoPixels was used to light up the sleeves

    • Batteries are used to power Raspberry Pi and Arduino

    • The blazer’s Raspberry Pi runs Python and Processing code

    • Analogue input is read via an MCP3008 ADC

    Shake hands to become social media - real life - friends

  • PiArm review

    PiArm review

    Reading Time: 3 minutes

    You’ll need a spare hour or two to assemble the arm, using a large array of parts and different-sized screws. While the assembly guide booklet is well illustrated (and there’s a video guide online), we found a few confusing discrepancies, including an annoying bit where we assembled a section, only to have to dismantle it again to wire up the servos (as revealed on the next page).

    Nor was any servo wiring information supplied – SB Components says a video should be uploaded to the product page soon. Based on the single wiring image shown in the booklet, we daisy-chained the servos in the same way (wire from servo below going into left socket, then wire from right socket to next servo up) and it worked.

    The arm is mounted on a metal base with holes to secure a full-size Raspberry Pi. PiArm’s ‘shield’ board can then be mounted on the GPIO header, in which case it supplies power to your Raspberry Pi, or you can connect it via USB. The 7.5 V 5 A DC power supply has a barrel jack with an adapter with two wires that connect to two screw terminals on the shield – a slightly messy solution.

    The kit also includes metal mounts to add a sensor (e.g. ultrasonic) and Camera Module (not supplied), although these fit to the base rather than the arm itself. With the arm assembled, you can insert the preloaded 16GB microSD card supplied into the Raspberry Pi to get started. Our card was blank, however, so we needed to install Raspbian and clone the PiArm GitHub repo.

    Graphical interface

    While the software is based around a PiArm Python library, a GUI interface makes getting started much easier and lets you program command sequences. An image of the arm is shown on screen, with two number fields for each of the six servos. First, you need to input an address in the Port field to open up a serial connection to the arm: ttyS0 if Raspberry Pi is connected via GPIO; ttyUSB0 if via USB.

    One way to program the arm is to type in numbers for each servo to set an arm position. A far simpler way, however, is to disable the torque and then manually position the arm to the desired position with your hands and read in the numerical servo data. This enables you to quickly store a sequence of commands (called a ‘group’) which you can then play back; sequences can be saved as text files for future reuse.

    A GUI interface enables you to create sequences of commands; by disabling the torque, you can manually position the arm and read its position

    Picking it up

    The arm rotates smoothly on its base, thanks to ball bearings, and moves fairly quietly. We soon managed to get the arm to pick up a keyring with its claw and then put it back down again elsewhere. We did find the default speed a bit too much, though, with the arm’s more sudden movements sometimes being powerful enough to lift the base suckers off the table!

    Fortunately, we were able to reduce servo speed levels to a preferable level, counter-intuitively by raising the setting to 800. Other servo parameters, such as angle and voltage range, may also be altered using another GUI program, although it’s not advisable to do so with the arm assembled.

    A PlayStation-style wireless joypad is also supplied, enabling you to control the arm manually; in this case we found it slow to rotate and the arm automatically curled up while rising, but you can always alter the Python code to customise control. Indeed, you could use the PiArm Python library with your own programs.

    Verdict

    9/10

    Excellent metal components and smart servos raise this robotic arm well above the level of cheaper entry-level rivals. The GUI interface makes it easy to program sequences, while advanced users could create their own programs based on the Python library.

  • ALBATROS radio astronomy Product Showcase

    ALBATROS radio astronomy Product Showcase

    Reading Time: 5 minutes

    ALBATROS is one of our favourite daft things in science: a backronym. It was originally created to mean ‘Array of Long Baseline Antennas for Taking Radio Observations from the Subantarctic’, as it started on the island of Marion which has a lot of albatrosses.

    “We want to make a map of the sky at low frequencies, to lay the groundwork for future observations of the cosmic ‘dark ages’ – the time before stars formed,” Taj Dyson tells us. He’s a physics student at McGill University in Canada, and recently took a trip to the McGill Arctic Research Station (MARS) to take radio astronomy measurements using equipment made in labs at McGill.

    The team spends summers at MARS (McGill Arctic Research Station) preparing the site and retrieving data

    “What does frequency have to do with time?” Taj continues. “To understand, realise that the universe was mostly neutral hydrogen. This hydrogen naturally emits light, or ‘glows’, at a wavelength of 21 cm (or about 1400MHz in frequency). We know this frequency very precisely, and it’s emitted at the same frequency for all time. Due to the expansion of the universe, though, light from hydrogen that is further away is redshifted – that is, its frequency is reduced (in the Earth’s frame of reference). So, we can see light from hydrogen that is further away by ‘tuning’ our antenna lower in frequency.”

    Looking for hydrogen in this way allows us to look into the past of the universe. While this is a technique pioneered in the sixties, human-generated radio waves have created interference that make it harder to do unless you’re in remote areas. There are other factors as well, such as solar activity, that make the polar regions very attractive.

    “Getting several maps of the sky at several low frequencies would be the first step towards understanding a whole era of the universe that hasn’t been studied very extensively,” Taj explains, “laying the groundwork for future measurements that could provide insight into cosmological mysteries like dark matter or dark energy.”

     The full test kit checks interference at specific locations

    History in the stars

    At Marion Island in the subantarctic Indian Ocean, several radio antennas are currently in use taking measurements of the sky. Taj and his crew are looking at expanding the operation to MARS on the other side of the planet to create another ALBATROS – ‘Array of Long Baseline Antennas for Taking Radio Observations from the Seventy-ninth parallel.’

    “MARS is new to this project,” Taj says. “The first time we visited was last summer, and that was just to have a look at how much RFI [radio frequency interference] there is up there. A first look at the data suggests that MARS is very radio-quiet and will be an excellent place for future observations!”

    Next summer they will return to set up antennas, the data from which is processed through a Raspberry Pi.

    One of the systems that collects data from the antenna – a Raspberry Pi gets the data which is then recorded on a hard drive

    “Raspberry Pi has many desirable features for our application,” Taj mentions. “It can communicate directly with our field-programmable gate array (FPGA)…  the very expensive circuit board that turns analogue antenna signal into zeroes and ones according to rules we tell Raspberry Pi to send it… Configuring also prints out various bits of information useful for troubleshooting. 

    “Next, we run the actual data acquisition script (there are actually two types) on Raspberry Pi, which receives digitised signal from the FPGA through the Ethernet port. Raspberry Pi then writes that data to disk, either on the SD card for our small data volume mode, or on external SSDs for our huge ~10MB per second mode. 

    “Of course, our Raspberry Pi also saves logs from both of these programs to the SD, so they can be looked at later when something doesn’t work or gets forgotten. Raspberry Pi consumes a relatively small amount of power, which is nice considering we want to make autonomously powered stations.”

    Cosmic patience

    An experiment like this takes time, though – you can’t just turn on the antennas and get an instant readout of the universe. It may take years.

    “The short answer is I have no idea [how long it will take].” Taj admits. “We are funded to go to MARS for two more years, but we hope this is just the beginning of a much longer observing program. It’s going to take a lot of R&D, antennas, and time to reach our ultimate goal of mapping the universe during cosmic dawn and the dark ages.”

    The results will be worth the wait, however. “First [let’s] talk about cosmic dawn,” Taj continues. “When the first stars formed, their heat excited the hydrogen around them, causing it to absorb the cosmic microwave background (CMB) at a very specific wavelength. Since this event happened so long ago, the wavelength is now very long (again, due to redshift) and our low-frequency equipment can pick it up. So, we expect to see a slight dip in signal at a certain frequency (since we don’t know exactly how long ago this happened, we don’t know at exactly what frequency). [Other results] saw a dip that was about twice as deep as predicted, which means hydrogen absorbed more radiation than expected. This could have all sorts of cosmological implications. I’m not going to bet on whether [this] result was real or not.

    “[Secondly] the mapping of the dark ages is not going to test any theory; it’ll provide a baseline for future low-frequency measurements.”

    We look forward to seeing results in the not-so-far future to take a look into the very-distant past. 

    A main antenna collects the data from the radio waves, feeding it to a Raspberry Pi

    Testing the site

    1. “At MARS, we had a main antenna set up at the base camp, and that was our main data-gathering tool. However, we also took smaller, more portable antennas with us on a helicopter.”

    2. “[We took] a laptop and our data-gathering electronics – Raspberry Pi included – to take measurements in several different locations where we may put larger antennas in the future.”

    3. “We thought maybe local topography would shield us a little from RFI (it’s strange: one typically thinks of an observatory on a hill, but really, for radio astronomy, we want to be in as steep a valley as possible!), but we didn’t see a difference by eye, looking at the spectra, between valleys and crests of hills.”

    Quick facts

    • This method of measuring low frequencies was pioneered by Grote Reber

    • One person stays at the Marion site each year to maintain the generators

    • This kind of radio astronomy is nice and low-budget

    • The McGill team were joined by a member of EDGES from MIT

    • Taj has shown off other projects at Maker Faires in America

  • Build a 4K media player in The MagPi issue 87

    Build a 4K media player in The MagPi issue 87

    Reading Time: 3 minutes

    We asked Raspberry Pi specialist Wes Archer to run through the ideal build for a media player.

    Wes shows us the right hardware to buy, including cases, cables, and remote controls. He then walks through the LibreELEC setup process.

    Going above and beyond the basic setup, our Build a 4K Media Player feature demonstrates how to organise your media, add artwork, and automatically add information.

    Click here to buy The MagPi magazine issue 87

    Build a 4K Media Player

    Power up your kitchen with Raspberry Pi 

    Get ready for the holiday season with lots of projects designed to make the most of your kitchen. Build a smart temperature scale, discover a kitchen computer, control a microwave, and make the perfect cup of coffee. All with Raspberry Pi.

    Power up your kitchen with Raspberry Pi

    Use a UK train departure screen

    When one The MagPi maker wanted to find out the UK train times, they used Raspberry Pi and a small OLED screen to build a mini timetable departure board. Tapping into the Transport API enables this system to display the latest train times for any station.

    UK train departure screen

    Make a cluster computer

    What’s better than a Raspberry Pi 4 computer? Four Raspberry Pi computers, of course! Raspberry Pi expert maker PJ Evans shows us how to wire multiple Raspberry Pi computers together to build a ‚bramble‘ (a powerful cluster computer). Once it’s made, you can learn supercomputing skills used by some of the world’s most powerful supercomputers. 

    Build a Raspberry Pi cluster computer

    Hack a GraviTrax marble run

    The MagPi hacker Mike Cook makes an amazing marble run with this GraviTrax hack. Add servos and light detectors to track a ball bouncing around your run, and trigger sounds and animations.

    Hack GraviTrax with Raspberry Pi

    Learn to code with toys

    We learn through play, and what better way to learn to code a computer than playing with toys designed to teach children just that? We’ve brought together a bunch of board games, electric gadgets, and low-tech toys that can be used to learn computational thinking skills. Sounds serious? Far from it. This is a fun way to learn computing (suitable for kids of all ages).

    Learn to code with toys

    Plus! Win one of five SmartPi Touch 2 Touchscreen cases!

    The MagPi is available as a free digital download, or you can purchase a print edition online or in stores.

  • Win one of five SmartiPi Touch 2 cases!

    Win one of five SmartiPi Touch 2 cases!

    Reading Time: < 1 minute

    Subscribe

  • Powerful Raspberry Pi Projects: part III

    Powerful Raspberry Pi Projects: part III

    Reading Time: 6 minutes

    Radical robots

    We couldn’t leave our little robotic friends out of our powerful projects round-up, now could we?

    Robot Dinosaurs

    Maker: Dr Lucy Rogers

    It’s not often dinosaurs are disappointing, but when the animatronic dinosaurs of the Isle of Wight theme park Blackgang Chine kept failing, Lucy came to the rescue. Retrofitting the bespoke mechanics with off-the-shelf parts controlled by a Raspberry Pi, she made them easier and cheaper to maintain, with more movement options.

    Dr Lucy Rogers retrofitted the animatronic dinosaurs to give them more moves

    SoccerBots

    Maker: Neil Lambeth

    Neil wanted to show kids that robotics can be more than just a single ‘bot moving around, so he developed the SoccerBots, a pair of remote-controlled, ball-firing robots that try to score goals against each other. They’ve inspired hundreds of kids around the UK.

    SoccerBots demonstrate how robots can interact

    BioHex

    Maker: Harry Brenton

    Hydroponics is all the rage. Growing plants without soil produces amazing results, but requires careful monitoring and care. Harry’s BioHex is a 3D-printed modular plant-growing machine that uses a Raspberry Pi to analyse the environment, operate the air pump, and provide lighting control.

    BioHex is a clever hydroponic monitor and plant pot

    Open-Source Mars Rover

    Maker: NASA Jet Propulsion Laboratory

    Want your own Mars Rover? Of course, you do. After a successful educational outreach programme demonstrating a small version of its real rovers, NASA’s JPL created a new robot, ROVE-E, that is made of off-the-shelf parts and runs open-source software on a Raspberry Pi. It costs around $2500 to build.

    ROVE-E is NASA's off-the-shelf, Raspberry Pi-controlled, Mars Rover

    Incredible AI projects

    Build something super-smart with Raspberry Pi.

    Google Coral 

    Maker: Google

    Coral is a range of AI products and projects made by Google. The latest star is the USB Accelerator. This dongle adds a Google TPU to Raspberry Pi, which rapidly boosts real-time classification – all local on the Raspberry Pi. Check out Teachable Machine in The MagPi 79.

    

<p/>The Coral USB Accelerator and a Raspberry Pi „></a></p>
<h3>TensorFlow Cucumber Sorter </h3>
<p><b>Maker: </b><a href=Makoto Koike

    It’s lovely to see one maker put AI tech into practice to solve a problem. Makato’s father grows cucumbers and straight ones with lots of prickles command a high price. Makato trained an AI robot to spot and sort them. Perhaps there are a number of production lines that could benefit from a little AI.

    There’s Waldo 

    Maker: Matt Reed 

    Where’s Wally? (Or Waldo as he’s known in the US.) Matt Reed’s There’s Waldo robot is an irreverent demonstration of machine-learning. There’s Waldo uses OpenCV to extract all the faces from the page, and then sends them to Google Auto ML Vision service. This locates the striped one and sends it back to a Raspberry Pi, which points him out using a uArm metal arm.

    There's Waldo finds the hidden stripy fella for you

    Whoa! What is that?

    Some projects are just so ‘out there’, they defy categorisation.

    High-Altitude Ballooning

    Maker: Dave Akerman

    The world’s best computer is no stranger to space, often hitching a lift on the ISS. If you’d like to send a Raspberry Pi skyward, it’s easier than you think. Dave sends Raspberry Pi Zero computers up to 100,000 ft (30,480 m) in the air using helium balloons, taking amazing photos. His comprehensive blog shares an immense amount of knowledge.

    High altitude balloon Raspberry Pi photography

    3D Scanner

    Maker: Richard Garsthagen

    This project gets a special place on our ‘Whoa!’ list simply for 98 Raspberry Pi computers in use. Split over 19 poles, they provide a high-resolution 3D model of anything placed within the scanning area. Richard has not only written a great series of posts as the project has evolved, but has open-sourced many of the plans and code used.

    A mere 98 Raspberry Pis 3D scan objects placed in the scanning area

    Musical Tesla Coil

    Maker: Derek Woodroffe

    A Tesla coil as a musical instrument? Why not? Derek is famous in the community for his high-voltage antics. Here, a Raspberry Pi Zero can load MIDI files and convert each note to information that is sent to two coil driver boards. The result is your favourite tune rendered at 200 volts.

    Musical Tesla Coil plays MIDI files at 200 volts

    Flappy Brain

    Maker: Albert Hickey

    Mattel’s ‘Mind Flex’ toy appears to read your mind by measuring your brain wave activity. Egham Jam organiser Albert Hickey added an Arduino and Raspberry Pi to decode the output so you can play Flappy Bird. Move the bird down by thinking hard, then clear your mind to go up!

    Flood Network Sensor

    Maker: Ben Ward

    Citizen-scientist Ben Ward has invented a cheap, serviceable alternative to expensive flood-monitoring systems for his home town of Oxford, using Raspberry Pi computers. The system bounces sound waves off the water surface to calculate the level. The reading is then relayed by radio (LoRa) to a central database. The project is now spreading across the UK.

    Spin up a digital animation

    Maker: Brian Cortell

    Brian is an award-winning robot maker, active member of the Raspberry Pi community, and self-titled ‘head meat-bag’ of Coretec Robotics.

    He is a regular at Raspberry Pi events up and down the UK and is most often seen with his Pi Noon balloon-battling robots or FacePlant, the two-wheel balancing creation he entered in this year’s Pi Wars. There is another one of his builds that caught our attention, a digital zoetrope (an early animation machine) that threw up some real technical challenges, in particular trying to drive twelve screens from one Raspberry Pi. The images on the screens can be updated in real-time when the zoetrope is spun.

    Digital zoetrope passed on Eadward Muybridge's moving image machine

    What inspired you to build a zoetrope?

    While I was researching the images of Eadweard Muybridge and the history of moving images, I was reminded of the zoetrope. I had a crazy idea that I could make a digital version bringing Eadweard Muybridge’s images to life.

    What challenges did you face?

    I had to control 12 screens on a single Raspberry Pi and design a circuit to be able to select each screen. Then I needed to write software to render images for the screens, modifying the driver software to upload an image in four blocks.

    Are you happy with the result?

    I’m pleased with the way the Digital Zoetrope turn out after I changed the shiny black acrylic to matt black and the wiring to black. It ended up being as I first imagined it would be.

    Any improvements planned?

    To make it more interactive and be able to import cells by taking a photo of a hand-drawn sheet of a one-second short film.

    Are there any more zoetropes in your future?

    Well, I have two projects planned. Hopefully, I will be making a second, larger, version of the Digital Zoetrope, using e-paper displays for Electromagnetic Field 2020 camp as an art installation, using twelve Pi Zeros and a Raspberry Pi 4 networked together. And of course, my annual robot build for Pi Wars.  

    Brian's Digital Zoetrope features 12 Raspberry Pi-controlled screens

  • Steam Link on Raspberry Pi 4

    Steam Link on Raspberry Pi 4

    Reading Time: 2 minutes

    Essentially, it’s a local network streaming service that allows you to stream games from a gaming PC to another computer hooked up to a screen. There used to be dedicated hardware for this, but it has been available for Raspberry Pi (and other hardware) for a while now.

    With the release of Raspberry Pi 4 and Raspbian Buster, it’s taken some time to get a new version of the Steam Link app which works as well as it should. Over the last month or so, more stable versions have been released, so we thought it was time to give it a test.

    Stream Link

    Installing Steam Link is easy – it’s available from the Raspbian software repository so can be installed from the Terminal with a simple sudo apt install steamlink. We highly recommend a wired connection for this – and thanks to the Gigabit Ethernet on Raspberry Pi 4, it’s going to make a huge difference.

    So much so that our gameplay experience was only hampered by the computer to which we connected. A WiFi-connected laptop stuttered a little, and had some frame tearing; however, similar performance is experienced on an actual Steam Link. From a dedicated gaming PC hooked up over Ethernet, it was a different story.

    While the experience is not seamless and one to one, it was extremely good – definitely good enough if you have the odd PC game you’d rather play on your TV without lugging a massive tower around.

    Verdict

    8/10

    Not perfect, but near enough that if you have a spare Raspberry Pi 4 and want to play some PC games on your TV, there’s no reason not to give it a try!