Everyone has to start somewhere, and this month we've put together a Getting Started with Raspberry Pi feature (page 30). Whether it's making Pong controllers (page 40), building a binary clock (page 58) or using sensors to build your own weather station (page 50), there are some great ideas here for Raspberry Pi fans.
Mini-guide to
Looking rosy
PROJECT SHOWCASE
Small but mighty
PicoLight
Alexandra Covor
In the limelight
We have been working a lot with Raspberry Pi development boards for various IoT projects,” says Constantin. They have also, generously, made this project open source, as Constantin explains: “We foresee using Raspberry Pi variants in many future projects as they offer so much flexibility and.
Big Boxes
Jangala's rugged Big Boxes provide web access in challenging environments and, with a recent Raspberry Pi upgrade, are now capable of providing connectivity to multiple users via almost any wireless means.
Rich Thanki
The Big Easy
The sturdy purple boxes are the size of a briefcase and packed with enough electronics to connect hundreds of users wirelessly. Upgrading from a previous system to the Raspberry Pi resulted in much more power, the need for a cooling system, and the ability to connect to anything from 2G to 5G.
Tech for good
Big Box basics
There's also a real cake underneath, after you're done with the virtual stuff. There is a delicious surprise behind this virtual birthday cake, although Rob Zwetsloot had to settle for the Minecraft-powered part.
Virtual
When all the candles are blown out, the birthday child can lift the model cake to reveal an edible cake that is mercifully free of children's saliva." I have always enjoyed making my children's birthday cakes, firmly believing that form and function are equal important as taste,” Stephen.
Stephen Thompson
While some (us) might argue that the best part of a birthday cake is the cake itself, there's definitely something to be said for an interactive model cake that does things in Minecraft. The virtual cake consists of a looping video of a cake created on Minecraft with nine candles that can be blown out by turning miniature windmills on a matching physical model cake.”
Virtualising baked goods
The guests quickly figured out what they had to do to blow out the candles.
Proof in the dessert
Cause and effect
I was approached [by Zilverstoom Farms] to find a solution to monitor a shipment of sweet potatoes on their sea journey to the Netherlands. The idea was to place a saw in a bin of sweet potatoes and record the environment in the bin for 40+ days, taking daily pictures of the load.
Environmental cargo logger
It's a long journey, and one farm wanted to find out what potatoes went through on their roughly 40-day journey. They wanted a visual of the interior of the cargo hold for the duration of the sea voyage.
Thinus Prinsloo
Potato stats
Turn on the bright LED and take a picture with the Pi camera and save it to the SD card - ◦ Turn off the bright LED and turn on. Write the temperature, humidity and atmospheric pressure measurements to a log file on the SD card - ◦Copy the log file to the flash drive.
Tuber analysis
Kamera
Bennet Fischer
Mechanical marvels
Analogue videotape is hard to come by, prompting Bennet to find a way to get the Super 8 camera back into use.
Movie making makeover
While Bennet's code is specific to the Super 8 camcorder, both the project idea and the Piccam API can be adapted for use with other camera and camcorder models.
Fantastic facsimile
SUBSCRIBE TODAY FROM ONLY £5
SUBSCRIPTION
JOIN FOR 12 MONTHS AND GET A
SUBSCRIBE
WITH YOUR FIRST
12-MONTH SUBSCRIPTION Subscribe in print
WORTH
Set up your Raspberry Pi with the latest version of the Raspberry Pi OS and discover all the new features. Whichever model of Raspberry Pi you have, it's part of the world's most creative computer family.
GET STARTED WITH
You can even control a sensor aboard the International Space Station if you submit an entry for Astro Pi missions (astro-pi.org). In this guide, we show you how to get started with the Raspberry Pi using the new Debian 'Bullseye' edition of the Raspberry Pi OS, as well as connect and control some basic electronics.
RASPBERRY PI
FEATURE
Unless your Raspberry Pi came with one already preloaded on a microSD card, you'll need to write the OS to the card. Once the setup is complete, you will be prompted to press Restart to reboot your Raspberry Pi.
Explore the desktop
Installing Raspberry Pi OS on a microSD card is easy using the Raspberry Pi Imager tool – download it on another computer (Windows, .Mac or Linux) from magpi.cc/imager. When the microSD card with the operating system on it is inserted into your Raspberry Pi's slot and powered on, it will first expand the file system before booting to the Raspberry Pi OS desktop.
USING RASPBERRY PI OS (BULLSEYE)
While other operating systems are available for Raspberry Pi (check out our feature in The MagPi. #111, magpi.cc/111), the official one is Raspberry Pi OS, which was recently updated to the. The Welcome to Raspberry Pi wizard will take you through configuration options, including language and time zone, ask you to change the default password, ask if all the taskbar fits on the screen, and ask you to connect to your wireless router using its enter password.
Install extra software
You will also be asked if you want to check for and install any software updates, which you can do now or skip. This time it will boot straight to the desktop, without the wizard, and be ready to use.
GET TO KNOW RASPBERRY PI OS’ INTERFACE
Installing Raspberry Pi OS
With the basics of the desktop GUI and core applications covered, let's take a look at some of the new features in Raspberry Pi OS Bullseye and the differences from previous versions.
How do I get Bullseye?
What if I want to get Buster?
OS BULLSEYE FAQ
How different does Bullseye look?
What’s new in Bullseye?
This means that any application written using the standard Linux display APIs should run on Raspberry Pi without the need for modification. Additionally, now that all the display drivers for Raspberry Pi OS are part of the Linux kernel, it should make it easier for custom display manufacturers to add support for Raspberry Pi.
Anything else new?
While you may not notice much change in the way video playback generally works or performs, a major advantage of using KMS is that it is the default open-source video driver used in Linux. The upgrade to Bullseye brings an update of Chromium to version 92, which is also optimized to use Raspberry Pi's hardware to speed up video playback.
Will my Raspberry Pi run faster?
Why doesn’t my Raspberry Pi have the new interface?
How do I manage notifications?
How should I keep Bullseye up-to-date?
Why is it ‘Bullseye’?
But the main difference users will notice is that OS releases from Bullseye onwards will no longer support the older camera and app system, instead libcamera apps for Raspberry Pi will be built and pre-installed. Before we continue, note that Raspberry Pi OS Buster is still available for download if you're not ready to use Bullseye.
What are libcamera-apps?
These very important changes mean less closed code and make it easier for people outside of the Raspberry Pi to develop new camera hardware and software; but they also mean that new releases of the Raspberry Pi OS will no longer support the familiar raspicam applications and the picamera Python library. A blog post on the Raspberry Pi website (magpi.cc/bullseyecamera) examines why and why you might not want to do this.
Raspberry Pi OS (Legacy)
When we released our first Raspberry Pi OS image based on Debian Bullseye, we pointed out a change that is hugely important to people writing code to use cameras with the Raspberry Pi: the driver that the Raspberry Pi uses to access for camera modules, has been replaced with libcamera. In place of this legacy camera system, the new and almost entirely open source camera stack is based on standard Linux frameworks such as V4L2 (Video for Linux) and libcamera.
Bullseye blog
Legacy Camera Support
There are a wide variety of HATs (Hardware Attached on Top) and other expansion boards available for Raspberry Pi. Because the Raspberry Pi 400's GPIO header is located on the back of the keyboard unit and sits slightly inward, you may need a ribbon cable or breakout adapter to connect a HAT.
CONNECTING ELECTRONICS
This is available on every Raspberry Pi model, including the tiny Zero 2 W and also the Pi 400. On most Raspberry Pi models, the HAT simply fits on top of the GPIO pins and sits above the PC PCB.
JAM HAT
While the Raspberry Pi can be used as an effective desktop computer, a big bonus is that it can easily connect to electronic circuits and add-on boards (often called HATs) via its 40-pin GPIO header.
Push the button
The Maker Plate will allow you to more easily connect the Raspberry Pi to the main structure of your dashboard (this is an optional extra). Now you need to power your Raspberry Pi using the 7.5V jack on the Build HAT, which will allow you to use the motors.
02 Motor encoders
Raspberry Pi to it using M2 bolts and nuts, making sure your Raspberry Pi is mounted on the side without the 'edge'. Mounting the Raspberry Pi this way allows easy access to the ports as well as the SD card slot.
01 Set up Build HAT
Align the Build HAT with your Raspberry Pi, ensuring you can see the 'This way up' label.
Richard Hayler
Marc Scott
Make a Build HAT game controller
TUTORIAL
Remove the while True: loop from your program and create this simple function that prints the absolute position of the motor. In the main Thonny window above the shell, you can use the commands you already know to find the absolute position of the engine.
You’ll Need
If a motor has an encoder, it means you can precisely set the position of the shaft. It also allows you to use the motor as an input device so that if something changes the position of the axis, this can be recorded and used to trigger other actions in a computer program.
05 Move the ball
This creates a rectangular window 400 pixels wide by 340 pixels high, with 0 in the center (see Figure 1). The ball must start in the middle of the screen and must not draw a line as it moves.
04 Make your Pong screen
Next, you can make a ball using a turtle set to be a white circle.
Top Tip
06 Control the paddle
You should be able to bounce the ball off your paddle and play a solo 'pumpkin' game. First of all, connect a second LEGO Technic engine to the Build HAT (port B) and program it.
07 Paddle collisions
Change the lines in your program that allow this so that the ball is reset to the center instead. Now add a similar condition for the right paddle as you did for the left to handle collisions.
DOWNLOAD THE FULL CODE
Add a variable for the right paddle position, a function for the paddle, and the line to call the function when the right motor is moved. Find the two conditions for each of the scoring situations – when the ball is missed by a paddle and goes left or right – and update the score by rewriting the new value.
09 Adding a buzzer
Add the following to your program after creating the paddle and ball turtles, but before the while loop True:. If you run your program now, the Pong score and legend should appear, but the scores themselves will not update.
08 Improve your project
You can refer to the documentation for the Turtle library to see what other options are available for displaying text.
10 Improve the Pong game
The DHT11 combines a digital thermistor with a capacitive humidity sensor and outputs digital readings for ease of use. With the power off, connect the DHT11 sensor to the Raspberry Pi as in Figure 1.
02 Install DHT11 library
We supply it with power from the Raspberry Pi's 3V3 pin, and ground it with a GND pin (both via the breadboard side rails), and the digital output (labeled DOUT on the sensor) goes to GPIO 14.
03 Temperature and humidity test
01 Connect DHT11 sensor
Phil King
Explore the
With the power to the Raspberry Pi off, it's time to connect the ADC. We've placed our DHT11 sensor on the breadboard, but you can connect it directly to the Raspberry Pi's GPIO pins.
05 Connect the UV sensor
07 UV index level
08 Bringing it together
We can use both the RPi.GPIO and GPIO Zero libraries (the latter is based on the former), but we need to initialize the GPIO pins before setting the GPIO Zero values.
09 Take it outside
Taking it further
The Raspberry Pi Zero 2 W continues support for composite video, making it a great candidate for retro projects. Every full-size Raspberry Pi model has included some form of composite video output, from the RCA connector of the original to the integrated 3.5mm video/audio jack of current models.
01 Choose and prepare your operating system
Composite video with Raspberry Pi Zero 2 W
02 Find the pads
PJ Evans
This boils down to "shorter is better" as the composite video signal degrades with distance. Since we don't want to re-solder to small pads in the future, be careful about how much wiring you need (although always allow a little extra for mistakes).
04 Prepare your wiring
Since we are using very thin wire in this project, you may also want to consider an additional sleeve or heat shrink cap for additional signal protection.
05 Get soldering
06 Tidy up and wire up
Warning!
Alert!
We chose this screw-block RCA connector for its simplicity, but you can also solder one in place if you prefer. The wire from GND goes to the negative (-) terminal and the other wire to the positive.
07 Configure Raspberry Pi OS
08 Screen adjustments
09 Troubleshooting
10 Try out a retro game!
12 Over to you
01 Hack the hardware
Nik Rawlinson
Make a binary clock
If you're using a Raspberry Pi without integrated GPIO pins, you'll need to add your own. If you are soldering the GPIO header, be careful with high temperature soldering iron and melting point.
02 Attach the diffuser
If you find the refresh seconds distracting, delete lines 34 through 40 and adjust the hour and minute block heights to fill the gap.
03 Enable the interface
04 Install the libraries
05 Write the code
06 Start a loop
07 Extract the binary variables
08 Strip out the surplus characters
09 Understand the layout
10 Build your blocks
11 Output the time
12 Launch at boot
We will build on this and create a MIDI instrument, the "Pico musical cheese box" as shown in Figure 1. The musical cheese box uses a ring of twelve pixels to display notes and twelve buttons for user input.
Make a Pico musical cheese box
Make a Pico music cheese box magpi.cc 63 the Pico device, the other end was fixed inside. You can download the software for the box from the GitHub page for this project: hsmag.cc/CheeseBox.
Look for statements in the program (they're near the bottom) and change the GP and pixel values to match your hardware. The Voice classes (Keyboard and Rhythm) control the information for the voice tracks that are played.
Different elements in the application are managed by software objects called classes
When a track is selected, the pixel next to its selection button lights up in the color of the button. Once the green, blue or yellow track is selected, use the white buttons to set steps in the sequence.
A NOTE ABOUT SCALES
When the red track is selected, you can play notes by just pressing white buttons. Each of them gets a pixel and. the value of the setting selected by stepping through the colors for that setting.
You can use the cheese box with any synthesizer, but you
You can also change the mode of a rhythm track to play notes instead of drums. You can use the cheesebox with any synthesizer, but you can also use it with a specially written Pure Data patch.
CHEESE BOX
You will notice that the node numbers in the selected object are the same as those in Figure 7. Currently the node generators only output simple sine waves, but in the next issue of HackSpace magazine we will find out how to use Pure Data to produce more interesting sounds and create a biscuit controller to match the cheese.
RASPBERRY PIRASPBERRY PI
GAMINGGAMING
Steam Link tips!
Xbox Cloud Gaming
Install on Raspberry Pi OS
Install on RetroPie
Micropolis
Freeciv
SuperTuxKart
Pingus
Hurrican
Ben Was Assimilated
Art Treachery
Zombusters
Raspberry Pi Edition
SpaceTrader
You can use them directly from the Raspberry Pi thanks to the community making them ARM friendly.
Doom (1993)
Beneath a Steel Sky (1994)
Arena (1999)
Minecraft (2011)
GAMES!
Retro Gaming with Raspberry Pi shows you how to configure a Raspberry Pi to play classic games. Build your own full-size game console or arcade cabinet, install emulation software, and download classic arcade games with our step-by-step guides.
Basic directional control, selection, volume and standard navigation work together with a power button that works out of the box with any Raspberry Pi 4, regardless of operating system.
More than media
PJ Evans sits back on his sofa and gets clicking
10Verdict
REVIEW
While the Raspberry Pi 400 has a number of ports on the back, one notable absence is a dedicated audio output jack. While it's fairly obvious which way the board should go, care must be taken to correctly align its header with the GPIO pins - with a small gap appearing at the end of Pin 1.
Let there be sound
Get it wrong and not only will you not hear the sound, but you can damage the board. This is something manufacturer OSA Electronics will address in the second series of boards by introducing a small bump in the middle to line up with the notch in the GPIO header periphery.
AUDIO FEATURES
INPUT/
OUTPUT
GPIO
SPECS
SAVE 35% UP TO
SUBSCRIBE AND
ISSUE #50
OUT NOW
These Raspberry Pi kits help you take the first steps on your manufacturing journey. Here are some great kits to help you get started right with a Raspberry Pi or Raspberry Pi Pico.
Picade
Autonomous
Robotics Platform for Pico
Grow Kit
RESOURCES
Pico Explorer Base
Discovery Kit for Raspberry Pi Pico
Grove Starter Kit for Raspberry Pi Pico
Raspberry Pi Pico
MicroPython Learning Kit
Monk Makes Project Box 1
Bright colors and a variety of projects you can get stuck into make Scratch the ideal first step into coding. Raspberry Pi offers a bunch of projects and games to help you learn Scratch that complement those offered by MIT.
Scratch courses
These projects challenge you to beat the buzzer, press certain keys corresponding to colors to create sounds, or record how many birds of a certain hue appear in your virtual wildlife camera.
COURSERA
CS FIRST
UDEMY
Raspberry Pi Foundation
Harvard
Learn along with others
SCRATCHED
CODERDOJO
Stewart Watkiss
INTERVIEW
It was really in 2012 when I first got the Raspberry Pi that my production started. At the time, I wanted to write a book, and writing for MagPi was a great way to get more experience.
Stewart’s stuff
In 2008 I bought my first Arduino, which greatly simplified electronics and expanded the scope of what a home electronics enthusiast could achieve. This was a mini beast project for school that used some tabs to position a model bee.
MagPi
Monday
THIS MONTH IN RASPBERRY PI
Best of the rest!
SCIENCE BY SOLAR
PICOMITE: BASIC COMPILER
YOUR LETTERS
3 ISSUES FOR £5
Contact us!
THE OFFICIAL
Terms & Conditions
Head here to enter: magpi.cc/win
Learn more: magpi.cc/picosystem
PICOSYSTEM CONSOLES!
IN ASSOCIATION WITH PIMORONI
ONE OF FIVE
COMPETITION
NEXT MONTH EDITORIAL
ADVERTISING
DESIGN
CONTRIBUTORS
PUBLISHING
DISTRIBUTION
SUBSCRIPTIONS
THE MAGPI #114 ON SALE 27 JANUARY
LEARN TO CODE WITH
Python programming
DON’T MISS OUT!
Plus!
A few months before streaming Netflix in the UK, I read about the upcoming Raspberry Pi and became quite intrigued. When the Raspberry Pi came out, I had just started writing for a long-defunct Linux magazine at a now-defunct publisher, and we were instantly hooked.
Late bloomer
When I first heard about Raspberry Pi, it was late 2011 and the technology landscape was very different. For years I've written tutorials using a 256 MB Raspberry Pi 1 Model B - turning Raspberry Pi into robots, media centers, file servers, routers, BOINC nodes and much more.
Now where?
The Motorola Atrix and I had no idea what I could use it for, but I knew I could definitely use it for something, even if a Twitter acquaintance thought it would flop like the Ouya (they've since deleted the tweet, ending with ' it doesn't even have a battery').
Rob Zwetsloot
Decade
THE FINAL WORD
HIGHPI PRO