You can now install and use Scratch 3 Desktop for Raspberry Pi OS on your Raspberry Pi!
Scratch 3 was released in January this year, and since then we and the Scratch team have put lots of work into creating an offline version for Raspberry Pi.
The new version of Scratch has a significantly improved interface and better functionality compared to previous versions. These improvements come at the cost of needing more processing power to run. Luckily, Raspberry Pi 4 has delivered just that, and with the software improvements in the newest version of Raspberry Pi OS, Buster, we can now deliver a reliable Scratch 3 experience on our computer.
Coding for kids in Scratch
Your kids can learn to code in Scratch with our free learning paths. These paths guide them to make fun projects and gain independence as coders and makers.
- Introduction to Scratch: sprites, scripts, and loops: This path is for beginners and introduces Scratch and coding concepts step by step as they make animations, a game, an app, and a book
- More Scratch: broadcasts, decisions, and variables: On this path, kids can build on the skills they’ve learning in the Intro path to take their Scratch creations further as they code apps, games, and simulations
- Further Scratch: clones, my blocks, and boolean logic: On this path, young coders take advantage of all the tools in Scratch to code a range of different programs including simulations, games, and computer-generated art
Scratch and electronics with a Raspberry Pi computer
If you think your kids would like to learn how to build physical projects they can program in Scratch, then take a look at our Physical computing with Scratch and Raspberry Pi path. In these six projects, your young people will learn how to use Scratch on a Raspberry Pi computer to control LEDs, buttons, and buzzers to make interactive games, displays, and instruments.
Which Raspberry Pi can I use?
Scratch 3 needs at least 1GB of RAM to run, and we recommend a Raspberry Pi 4 with at least 2GB RAM. While you can run Scratch 3 on a Raspberry Pi 2, 3, 3B+, or a Raspberry 4 with 1GB RAM, performance on these models is reduced, and depending on what other software you run at the same time, Scratch 3 may fail to start due to lack of memory.
The Scratch team is working to reduce the memory requirements of Scratch 3, so we will hopefully see improvements to this soon.
How to install Scratch 3
You can only install Scratch 3 on Raspbian Buster and on newer Raspberry Pi OS versions.
First, update Raspberry Pi OS!
- If you’ve yet to upgrade to Raspbian Buster, we recommend installing a fresh version of Raspberry Pi OS onto your SD card instead of upgrading from your current version.
- If you’re already using Raspberry Pi OS, but you’re not sure your running the latest version, update your OS by following this tutorial:
Once you’re running the latest version of Raspberry Pi OS, you can install Scratch 3 either using the Recommended Software application or apt on the terminal.
How to install Scratch 3 using the Recommended Software app
Open up the menu, click on Preferences > Recommended Software, and then select Scratch 3 and click on OK.
How to install Scratch 3 using the terminal
Open a terminal window, and type in and run the following commands:
sudo apt-get update sudo apt-get install scratch3
What can I do with Scratch 3 and Raspberry Pi?
Scratch 3 Desktop for Raspbian comes with new extensions to allow you to control the GPIO pins and Sense HAT with Scratch code!
GPIO extension is a replacement for the existing extension in Scratch 2. Its layout and functionality is very similar, so you can use it as a drop-in replacement.
The GPIO extension gives you the flexibility to connect and control a whole host of electronic devices.
Simple Electronics extension
If you are looking to add something simple, like an LED or button controller for a game, you should find the new Simple Electronics extension easier to use than the GPIO extension. The Simple Electronics extension is the first version of a beginner-friendly extension for interacting with Raspberry Pi’s GPIO pins. Taking lessons from the implementation of
gpiozero for Python, this new extension provides a simpler way of using electronic components: currently buttons and LEDs.
In this example, an LED connected to GPIO pin 17 is controlled by a button connected between pin 2 and GND.
Sense HAT extension
We’ve improved the Sense HAT extension to take advantage of new features in Scratch 3, and the updated version of the extension also introduces a number of new blocks to allow you to:
- Sense tilting, shaking, and orientation
- Use the joystick
- Measure temperature, pressure, and humidity
- Display text, characters, and patterns on the LED matrix
micro:bit and LEGO extensions
The micro:bit and LEGO extensions will become available later on Scratch 3 Desktop. This is because Scratch Link, the software which allows Scratch to talk to Bluetooth devices, is not yet available for Linux-type operating systems like Raspbian. A version of Scratch Link for Raspbian is part of our plans but, as yet, we don’t have a release date.
A round of thanks
It has been a long ambition of both the Scratch and Raspberry Pi teams to have Scratch 3 running on Raspberry Pi, and it’s amazing to see it released!
A big thank you to Raspberry Pi engineer Simon Long for building and packaging Scratch 3, and to the Scratch team for their support in getting over some of the problems we faced along the way.