Raspberry Pi Blog

This is the official Raspberry Pi blog for news and updates from the Raspberry Pi Foundation, education initiatives, community projects and more!

Code your own path-following Lemmings in Python | Wireframe issue 17

Learn how to create your own obedient lemmings that follow any path put in front of them. Raspberry Pi’s own Rik Cross explains how.

The original Lemmings, first released for the Amiga, quickly spread like a virus to just about every computer and console of the day.

Lemmings

Lemmings is a puzzle-platformer, created at DMA Design, and first became available for the Amiga in 1991. The aim is to guide a number of small lemming sprites to safety, navigating traps and difficult terrain along the way. Left to their own devices, the lemmings will simply follow the path in front of them, but additional ‘special powers’ given to lemmings allow them to (among other things) dig, climb, build, and block in order to create a path to freedom (or to the next level, anyway).

Code your own lemmings

I’ll show you a simple way (using Python and Pygame) in which lemmings can be made to follow the terrain in front of them. The first step is to store the level’s terrain information, which I’ve achieved by using a two-dimensional list to store the colour of each pixel in the background ‘level’ image. In my example, I’ve used the ‘Lemcraft’ tileset by Matt Hackett (of Lost Decade Games) – taken from opengameart.org – and used the Tiled software to stitch the tiles together into a level.

The algorithm we then use can be summarised as follows: check the pixels immediately below a lemming. If the colour of those pixels is the same as the background colour, then the lemming is falling. In this case, move the lemming down by one pixel on the y-axis. If the lemming isn’t falling, then it’s walking. In this case, we need to see whether there is a non-ground, background-coloured pixel in front of the lemming for it to move onto.

Sprites cling to the ground below them, navigating uneven terrain, and reversing direction when they hit an impassable obstacle.

If a pixel is found in front of the lemming (determined by its direction) that is low enough to get to (i.e. lower than its climbheight), then the lemming moves forward on the x-axis by one pixel, and upwards on the y-axis to the new ground level. However, if no suitable ground is found to move onto, then the lemming reverses its direction.

The algorithm is stored as a lemming’s update() method, which is executed for each lemming, each frame of the game. The sample level.png file can be edited, or swapped for another image altogether. If using a different image, just remember to update the level’s BACKGROUND_COLOUR in your code, stored as a (red, green, blue, alpha) tuple. You may also need to increase your lemming climbheight if you want them to be able to navigate a climb of more than four pixels.

There are other things you can do to make a full Lemmings clone. You could try replacing the yellow-rectangle lemmings in my example with pixel-art sprites with their own walk cycle animation (see my article in issue #14), or you could give your lemmings some of the special powers they’ll need to get to safety, achieved by creating flags that determine how lemmings interact with the terrain around them.

Here’s Rik’s code, which gets those path-following lemmings moving about in Python. To get it running on your system, you’ll first need to install Pygame Zero. And to download the full code, go here.

Get your copy of Wireframe issue 17

You can read more features like this one in Wireframe issue 17, available now at Tesco, WHSmith, and all good independent UK newsagents.

Or you can buy Wireframe directly from Raspberry Pi Press — delivery is available worldwide. And if you’d like a handy digital version of the magazine, you can also download issue 17 for free in PDF format.

Make sure to follow Wireframe on Twitter and Facebook for updates and exclusive offers and giveaways. Subscribe on the Wireframe website to save up to 49% compared to newsstand pricing!

5 Comments

Really awesome Raspberry Pi 4 X-ray radiographs

“I got my Pi in the post yesterday morning and I was desperately waiting until the end of the workday to get home and play with it! Took a few quick radiographs before I left because I had to.”

And we’re really happy that Reddit user xCP23x did. How cool are these?

“I work for a company that makes microfocus X-ray/CT systems!” xCP23x explained in their Reddit post. “Most of the images are from a 225kV system (good down to 3 microns).”

They used a Nikon XT H 225 ST: 225kV 225W X-ray source for the majority of the images. You can learn more about how the images were produced via the comments on their Reddit user page.

You can see the full Reddit post here, and more radiographs of the Raspberry Pi 4 here.

21 Comments

Your Back-to-School Bootcamp with our free online training

Are you ready FEEL THE BURN…of your heating laptop? And MAX THOSE REPS…using forever loops? Then get your programming muscles into the best shape possible with our free online training courses.

Pump up your programming skills for free

Today we are excited to announce our new online training course Programming with GUIs — now open for sign-ups on FutureLearn. To celebrate, we’ve also curated a set of courses as your personal Back-to-school Bootcamp. Sign up now to start training from Monday 29 July and throughout August!

Scratch Cat and a Python supervising teachers at an outdoor bootcamp

Your Back-to-school Bootcamp has something for beginner, intermediate, and advanced learners, and all the courses are free, thanks to support from Google.

Also keep in mind that all the courses count towards becoming certified through the National Centre for Computing Education.

Couch to 5k…lines of code

If you’re just beginning to learn about coding, the perfect place to start is Programming 101: An Introduction to Python for Educators. You’ll first get to grips with basic programming concepts by learning about the basics of Python syntax and how to interpret error messages. Then you’ll use your new coding skills to create a chatbot that asks and answers questions!

Scratch Cat and a Python doing a relay race

For Primary teachers, our course Scratch to Python: Moving from Block- to Text-based Programming is ideal. Take this course if you’ve been using Scratch and are wondering how to introduce Python to your older students.

If you’ve been programming for a while, sign up for our brand-new course Programming with GUIs — an intermediate-level course that shows you how to build your own graphical user interface (GUI) in Python. You will learn how to incorporate interactivity in your programs, discover different types of GUI features, and build your confidence to design more complex GUI-based apps in the future.

Or maybe you’d like to try Programming 101’s follow-on course Programming 102: Think Like a Computer Scientist? Take your Python skills further by learning to break down problems into smaller tasks and designing algorithms you can apply to data.

Finally, if you’re an experienced computing educator, dig into Object-oriented Programming in Python, a really fun and challenging course that helps you get to grips with OOP principles by creating a text-based adventure game in Python.

Scratch Cat and a Python supervising an outdoors sports activity

Sign-ups are open until the end of August. Now go get those gains!

Tell us about your workout routine

What will your personal coding regime look like this summer? What online courses have you enjoyed taking this year? (They don’t have to be ours!) Tell us in the comments below.

No Title

No Description

4 Comments

The world’s first Raspberry Pi-powered Twitter-activated jelly bean-pooping unicorn

When eight-year-old Tru challenged the Kids Invent Stuff team to build a sparkly, pooping, rainbow unicorn electric vehicle, they did exactly that. And when Kids Invent Stuff, also known as Ruth and Shawn, got in contact with Estefannie Explains it All, their unicorn ended up getting an IoT upgrade…because obviously.

You tweet and the Unicorn poops candy! | Kids Invent Stuff

We bring kids’ inventions to life and this month we teamed up with fellow youtube Estefannie (from Estefannie Explains It All https://www.youtube.com/user/estefanniegg SHE IS EPIC!) to modify Tru’s incredible sweet pooping unicorn to be activated by the internet! Featuring the AMAZING Allen Pan https://www.youtube.com/channel/UCVS89U86PwqzNkK2qYNbk5A (Thanks Allen for your filming and tweeting!)

Kids Invent Stuff

If you’re looking for an exciting, wholesome, wonderful YouTube channel suitable for the whole family, look no further than Kids Invent Stuff. Challenging kids to imagine wonderful inventions based on monthly themes, channel owners Ruth and Shawn then make these kids’ ideas a reality. Much like the Astro Pi Challenge, Kids Invent Stuff is one of those things we adults wish existed when we were kids. We’re not jealous, we’re just…OK, we’re definitely jealous.

ANYWAY, when eight-year-old Tru’s sparkly, pooping, rainbow unicorn won the channel’s ‘crazy new vehicle’ challenge, the team got to work, and the result is magical.

Riding an ELECTRIC POOPING UNICORN! | Kids Invent Stuff

We built 8-year-old Tru’s sparkly, pooping, rainbow unicorn electric vehicle and here’s what happened when we drove it for the first time and pooped out some jelly beans! A massive THANK YOU to our challenge sponsor The Big Bang Fair: https://www.thebigbangfair.co.uk The Big Bang Fair is the UK’s biggest celebration of STEM for young people!

But could a sparkly, pooping, rainbow unicorn electric vehicle ever be enough? Is anything ever enough if it’s not connected to the internet? Of course not. And that’s where Estefannie came in.

At Maker Central in Birmingham earlier this year, the two YouTube teams got together to realise their shared IoT dream.

They ran out of chairs for their panel, so Allen had to improvise

With the help of a Raspberry Pi Zero W connected to the relay built into the unicorn, the team were able to write code that combs through Twitter, looking for mentions of @mythicalpoops. A positive result triggers the Raspberry Pi to activate the relay, and the unicorn lifts its tail to shoot jelly beans at passers-by.

You can definitely tell this project was invented by an eight-year-old, and we love it!

IoT unicorn

As you can see in the video above, the IoT upgrades to the unicorn allow Twitter users to control when the mythical beast poops its jelly beans. There are rumours that the unicorn may be coming to live with us at Pi Towers, but if these turn out to be true, we’ll ensure that this function is turned off. So no tweeting the unicorn!

You know what to do

Be sure to subscribe to both Kids Invent Stuff and Estefannie Explains It All on YouTube. They’re excellent makers producing wonderful content, and we know you’ll love them.

How to milk a unicorn

1 Comment

The NEW Official Raspberry Pi Beginner’s Guide: updated for Raspberry Pi 4

To coincide with the launch of Raspberry Pi 4, Raspberry Pi Press has created a new edition of The Official Raspberry Pi Beginner’s Guide book — as if this week wasn’t exciting enough! Weighing in at 252 pages, the book is even bigger than before, and it’s fully updated for Raspberry Pi 4 and the latest version of the Raspbian operating system, Buster.A picture of the front cover of the Raspberry Pi Beginner's Guide version two

The Official Raspberry Pi Beginner’s Guide

We’ve roped in Gareth Halfacree, full-time technology journalist and technical author, and the wonderful Sam Alder, illustrator of our incredible cartoons and animations, to put together the only guide you’ll ever need to get started with Raspberry Pi.

From setting up your Raspberry Pi on day one to taking your first steps into writing coding, digital making, and computing, The Official Raspberry Beginner’s Guide – 2nd Edition is great for users from age 7 to 107! It’s available now online from the Raspberry Pi Press store, with free international delivery, or from the real-life Raspberry Pi Store in Cambridge, UK.

As always, we have also released the guide as a free PDF, and you’ll soon be seeing physical copies on the shelves of Waterstones, Foyles, and other good bookshops.

15 Comments

IoT community sprinkler system using Raspberry Pi | The MagPi issue 83

Saving water, several thousand lawns at a time: The MagPi magazine takes a look at the award-winning IoT sprinkler system of Coolest Projects USA participant Adarsh Ambati.

At any Coolest Projects event, you’re bound to see incredible things built by young makers. At Coolest Projects USA, we had the chance to talk to Adarsh Ambati about his community sprinkler and we were, frankly, amazed.

“The extreme, record-breaking drought in California inspired me to think of innovative ways to save water,” Adarsh tells us. “While going to school in the rain one day, I saw one of my neighbours with their sprinklers on, creating run-offs. Through research, I found that 25% of the water used in an average American household is wasted each day due to overwatering and inefficient watering methods. Thus, I developed a sprinkler system that is compliant with water regulations, to cost-effectively save water for entire neighbourhoods using a Raspberry Pi, moisture sensors, PyOWM (weather database), and by utilising free social media networks like Twitter.”

Efficient watering

In California, it’s very hot year round, so if you want a lush, green lawn you need to keep the grass watered. The record-breaking drought Adarsh was referring to resulted in extreme limitations on how much you could water your grass. The problem is, unless you have a very expensive sprinkler system, it’s easy to water the grass when it doesn’t need to be.

“The goal of my project is to save water wasted during general-purpose landscape irrigation of an entire neighbourhood by building a moisture sensor-based smart sprinkler system that integrates real-time weather forecast data to provide only optimum levels of water required,” Adarsh explains. “It will also have Twitter capabilities that will be able to publish information about when and how long to turn on the sprinklers, through the social networks. The residents in the community will subscribe to this information by following an account on Twitter, and utilise it to prevent water wasted during general-purpose landscaping and stay compliant with water regulations imposed in each area.”

Using the Raspberry Pi, Adarsh was able to build a prototype for about $50 — a lot cheaper than smart sprinklers you can currently buy on the market.

“I piloted it with ten homes, so the cost per home is around $5,” he reveals. “But since it has the potential to serve an entire community, the cost per home can be a few cents. For example, there are about 37000 residents in Almaden Valley, San Jose (where I live). If there is an average of two to four residents per home, there should be 9250 to 18500 homes. If I strategically place ten such prototypes, the cost per house would be five cents or less.”

Massive saving

Adarsh continues, “Based on two months of data, 83% of the water used for outdoor landscape watering can be saved. The average household in northern California uses 100 gallons of water for outdoor landscaping on a daily basis. The ten homes in my pilot had the potential to save roughly 50000 gallons over a two-month period, or 2500 gallons per month per home. At $0.007 per gallon, the savings equate to $209 per year, per home. For Almaden Valley alone, we have the potential to save around $2m to $4m per year!”

The results from Adarsh’s test were presented to the San Jose City Council, and they were so impressed they’re now considering putting similar systems in their public grass areas. Oh, and he also won the Hardware project category at Coolest Projects USA.

The MagPi magazine #83

This article is from today’s brand-new issue of The MagPi, the official Raspberry Pi magazine. Buy it from all good newsagents, subscribe to pay less per issue and support our work, or download the free PDF to give it a try first.

3 Comments

Raspberry Pi 4: 48 hours later

“We’ve never felt more betrayed and excited at the same time,” admitted YouTubers 8 Bits and a Byte when I told them Raspberry Pi 4 would be out in June, going against rumours of the release happening at some point in 2020. Fortunately, everything worked in our favour, and we were able to get our new product out ahead of schedule.

So, while we calm down from the hype of Monday, here’s some great third-party content for you to get your teeth into.

YouTubers

A select few online content creators were allowed to get their hands on Raspberry Pi 4 before its release date, and they published some rather wonderful videos on the big day.

Office favourite Explaining Computers provided viewers with a brilliant explanation of the ins and outs of Raspberry Pi 4, and even broke their usually Sunday-only release schedule to get the video out to fans for launch day. Thanks, Chris!

Raspberry Pi 4 Model B

Raspberry Pi 4B review, including the hardware specs of this new single board computer, and a demo running the latest version of Raspbian. With thanks to the Raspberry Pi Foundation for supplying the board featured in this video.

Blitz City DIY offered viewers a great benchmark test breakdown, delving deeper into the numbers and what they mean, to show the power increase compared to Raspberry Pi 3B+.

A Wild Raspberry Pi 4 Appears: Hardware Specs, Benchmarks & First Impressions

The Raspberry Pi 4 B has been released into the wild much earlier than anticipated. I was able to receive a review sample so here are the hardware specs, some benchmarks comparing it to the Pi 3 B and Pi 3 B+ and finally some first impressions.

Curious about how these creators were able to get their hands on Raspberry Pi 4 prior to its release? This is legitimately how Estefannie bagged herself the computer pre-launch. Honest.

HOW I GOT A RASPBERRY PI 4 BEFORE ITS RELEASE

I needed a new Raspberry Pi. FIND ME HERE: * http://www.estefannie.com * http://instagram.com/estefanniegg * http://www.twitter.com/estefanniegg * https://github.com/estefanniegg * https://facebook.com/estefanniegg

For their launch day video, Dane and Nicole, AKA 8 Bits and a Byte, built a pi-calculating pie that prints pies using a Raspberry Pi 4. Delicious.

The new Raspberry Pi 4 – Highlights & Celebration Project!

There’s a new Raspberry Pi, the Raspberry Pi 4! We give you a quick overview and build a project to welcome the Raspberry Pi 4 to the world!

Alex from Low Spec Gamer took his Raspberry Pi 4 home with him after visiting the office to talk to Eben. Annoyingly, I was away on vacation and didn’t get to meet him :(

Raspberry Pi 4 Hands-on. I got an early unit!

Watch the best documentaries on Curiosity Stream: https://curiositystream.com/lowspecgamer #RaspberryPi4 #HandsOn #Preview A new Raspberry Pi joins the fray. I got an early Raspberry Pi 4 and decided to explore some of its differences with Eben Upton, founder of Raspberry Pi. All benchmarks run on an early version of the new raspbian.

The MagPi magazine managed to collar Raspberry Pi Trading’s COO James Adams for their video, filmed at the Raspberry Pi Store in Cambridge.

Introducing Raspberry Pi 4! + interview with a Raspberry Pi engineer

The brand new Raspberry Pi 4 is here! With up to 4GB of RAM, 4K HDMI video, Gigabit Ethernet, USB 3.0, and USB C, it is the ultimate Raspberry Pi. We talk to Raspberry Pi hardware lead James Adams about its amazing performance.

Some rather lovely articles

If you’re looking to read more about Raspberry Pi 4 and don’t know where to start, here are a few tasty treats to get you going:

Raspberry Pi 4 isn’t the only new thing to arrive this week. Raspbian Buster is now available for Raspberry Pi, and you can read more about it here.

Join the Raspberry Pi 4 conversation by using #RaspberryPi4 across all social platforms, and let us know what you plan to do with your new Raspberry Pi.

56 Comments

Buster – the new version of Raspbian

Amid all the furore about the release of a certain new piece of hardware, some people may have missed that we have also released a new version of Raspbian. While this is required for Raspberry Pi 4, we’ve always tried to maintain software backwards-compatibility with older hardware, and so the standard Raspbian image for all models of Raspberry Pi is now based on Buster, the latest version of Debian Linux.

Why Buster?

The first thing to mention about Buster (who was the actual dog in Pixar’s “Toy Story” films, as opposed to the toy one made out of a Slinky…) is that we are actually releasing it slightly in advance of the official Debian release date. The reason for this is that one of the important new features of Raspberry Pi 4 is that the open-source OpenGL video driver is now being used by default, and this was developed using the most recent version of Debian. It would have been a lot of work to port everything required for it back on to Raspbian Stretch, so we decided that we would launch on Raspbian Buster – the only question was whether Buster would be ready before the hardware was!

As it turns out, it wasn’t – not quite. The official launch date for Buster is July 7, so we are a couple of weeks ahead. That said, Buster has been in a “frozen” state for a couple of months now, with only minor changes being made to it, so the version we are releasing is pretty much identical to that which will be officially released by Debian on July 7.

We started using Buster internally in January this year, so it has had a lot of testing on Pi – while we may be releasing it a bit early, you need have no concerns about using it; it’s stable and robust, and you can use apt to update with any changes that do happen between now and July 7 without needing to reinstall everything.

What’s new?

There are no huge differences between Debian Stretch and Debian Buster. In a sad reflection of the way the world is nowadays, most of the differences are security changes designed to make Buster harder to hack. Any other differences are mostly small incremental changes that most people won’t notice, and this got us thinking…

When we moved from Jessie to Stretch, many people commented that they couldn’t actually see any difference between the two – as most of the changes were “under the hood”, the desktop and applications all looked the same. So we told people “you’ve now got Stretch!” and they said “so what?”

The overall appearance of the desktop hasn’t changed significantly for a few years, and was starting to look a bit dated, so we thought it would be nice to give the appearance a mild refresh for Buster. Then people would at least be able to see that their shiny new operating system looked different from the old one!

The new appearance

There has been a definite trend in the design of most computer graphical user interfaces over recent years to simplify and declutter; to reduce the amount of decoration, so that a button becomes a plain box rather than something that resembles a physical button. You can see this in both desktop OSes like Windows, and in mobile OSes like iOS – so we decided it was time to do something similar.

The overall appearance of most of the interface elements has been simplified; we’ve reduced things like the curvature of corners and the shading gradients which were used to give a pseudo-3D effect to things like buttons. This “flatter” design looks cleaner and more modern, but it’s a bit of a juggling act; it’s very easy to go too far and to make things look totally flat and boring, so we’ve tried to avoid that. Eben and I have had a mild tussle over this – he wanted as much flatness as possible, and I wanted to retain at least a bit of curvature, so we’ve met somewhere in the middle and produced something we both like!

We’ve also changed the default desktop for a new one of Greg Annandale’s gorgeous photographs, and we’ve moved to a grey highlight colour.

(If you really don’t like the new appearance, it is easy enough to restore the former appearance – the old desktop picture is still installed, as is the old UI theme.)

Other changes

We’ve been including the excellent Thonny Python development environment in Raspbian for some time now. In this release, it’s now our default Python editor, and to that end, we are no longer including IDLE by default. IDLE has always felt dated and not very pleasant to use, and Thonny is so much nicer that we’d strongly recommend moving to it, if you haven’t already!

(If you’d like an alternative to Thonny, the Mu Python IDE is also still available in Recommended Software.)

We’ve made some small tweaks to the taskbar. The ‘eject’ icon for removing USB devices is now only shown if you have devices to eject; it’s hidden the rest of the time. Similarly, if you are using one of the earlier Pis without Bluetooth support, the Bluetooth icon is now hidden rather than being greyed out. Also, the CPU activity gauge is no longer shown on the taskbar by default, because this has become less necessary on the more powerful recent Raspberry Pi models. If you’d still like to use it, you can add it back – right-click the taskbar and choose ‘Add / Remove Panel Items’. Press the ‘Add’ button and you’ll find it listed as ‘CPU Usage Monitor’. While you are in there, you’ll also find the new ‘CPU Temperature Monitor’, which you can add if you’re interested in knowing more about what the CPU is up to.

One program which is currently missing from Buster is Mathematica. Don’t worry – this is only a temporary removal! Wolfram are working on getting Mathematica to work properly with Buster, and as soon as it is ready, it’ll be available for installation from Recommended Software.

A few features of the old non-OpenGL video driver (such as pixel doubling and underscan) are not currently supported by the new OpenGL driver, so the settings for these are hidden in Raspberry Pi Configuration if the GL driver is in use. (The GL driver is the default on Raspberry Pi 4 – older Pis will still use the non-GL driver by default. Also, if using a Raspberry Pi 4 headless, we recommend switching back to the non-GL driver – choose ‘Legacy’ under the ‘GL Driver’ setting in ‘Advanced Options’ in raspi-config.)

If the GL driver is in use, there’s a new ‘Screen Configuration’ tool – this enables you to set up the arrangement of multiple monitors on a Raspberry Pi 4. It can also be used to set custom monitor resolutions, which can be used to simulate the effect of pixel doubling.

Finally, there are a couple of new buttons in ‘Raspberry Pi Configuration’ which control video output options for Raspberry Pi 4. (These are not shown when running on earlier models of Raspberry Pi.) It is not possible on the Raspberry Pi 4 to have both analogue composite video (over the 3.5mm jack) and HDMI output simultaneously, so the analogue video output is disabled by default. 4Kp60 resolution over HDMI is also disabled by default, as this requires faster clock speeds resulting in a higher operating temperature and greater power consumption. The new buttons enable either of these options to be enabled as desired.

How do I get it?

As ever with major version changes, our recommendation is that you download a new clean image from the usual place on our site – this will ensure that you are starting from a clean, working Buster system.

We do not recommend upgrading an existing Stretch (or earlier) system to Buster – we can’t know what changes everyone has made to their system, and so have no idea what may break when you move to Buster. However, we have tested the following procedure for upgrading, and it works on a clean version of the last Stretch image we released. That does not guarantee it will work on your system, and we cannot provide support (or be held responsible) for any problems that arise if you try it. You have been warned – make a backup!

1. In the files /etc/apt/sources.list and /etc/apt/sources.list.d/raspi.list, change every use of the word “stretch” to “buster”.
2. In a terminal,

sudo apt update

and then

sudo apt dist-upgrade

3. Wait for the upgrade to complete, answering ‘yes’ to any prompt. There may also be a point at which the install pauses while a page of information is shown on the screen – hold the ‘space’ key to scroll through all of this and then hit ‘q’ to continue.
4. The update will take anywhere from half an hour to several hours, depending on your network speed. When it completes, reboot your Raspberry Pi.
5. When the Pi has rebooted, launch ‘Appearance Settings’ from the main menu, go to the ‘Defaults’ tab, and press whichever ‘Set Defaults’ button is appropriate for your screen size in order to load the new UI theme.
6. Buster will have installed several new applications which we do not support. To remove these, open a terminal window and

sudo apt purge timidity lxmusic gnome-disk-utility deluge-gtk evince wicd wicd-gtk clipit usermode gucharmap gnome-system-tools pavucontrol

We hope that Buster gives a little hint of shiny newness for those of you who aren’t able to get your hands on a Raspberry Pi 4 immediately! As ever, your feedback is welcome – please leave your comments below.

177 Comments

Raspberry Pi 4 on sale now from $35

We have a surprise for you today: Raspberry Pi 4 is now on sale, starting at $35. This is a comprehensive upgrade, touching almost every element of the platform. For the first time we provide a PC-like level of performance for most users, while retaining the interfacing capabilities and hackability of the classic Raspberry Pi line.

Raspberry Pi 4: your new $35 computer

Introducing #RaspberryPi4: your tiny, dual-display, desktop computer…and robot brains, smart home hub, media centre, networked AI core, factory controller, and much more Get your Raspberry Pi 4 now: http://rpf.io/ytraspberrypi4 Subscribe to our YouTube channel: http://rpf.io/ytsub Help us reach a wider audience by translating our video content: http://rpf.io/yttranslate Buy a Raspberry

Get yours today from our Approved Resellers, or from the Raspberry Pi Store in Cambridge, open today 8am–8pm!

Raspberry Pi 4 Model B

Here are the highlights:

  • A 1.5GHz quad-core 64-bit ARM Cortex-A72 CPU (~3× performance)
  • 1GB, 2GB, or 4GB of LPDDR4 SDRAM
  • Full-throughput Gigabit Ethernet
  • Dual-band 802.11ac wireless networking
  • Bluetooth 5.0
  • Two USB 3.0 and two USB 2.0 ports
  • Dual monitor support, at resolutions up to 4K
  • VideoCore VI graphics, supporting OpenGL ES 3.x
  • 4Kp60 hardware decode of HEVC video
  • Complete compatibility with earlier Raspberry Pi products

And here it is in the flesh:

Still a handsome devil

Raspberry Pi 4 memory options

This is the first time we’re offering a choice of memory capacities. We’ve gone for the following price structure, retaining our signature $35 price for the entry-level model:

RAM Retail price
1GB $35
2GB $45
4GB $55

As always these prices exclude sales tax, import duty (where appropriate), and shipping. All three variants are launching today: we have initially built more of the 2GB variant than of the others, and will adjust the mix over time as we discover which one is most popular.

New Raspberry Pi 4, new features

At first glance, the Raspberry Pi 4 board looks very similar to our previous $35 products, all the way back to 2014’s Raspberry Pi 1B+. James worked hard to keep it this way, but for the first time he has made a small number of essential tweaks to the form factor to accommodate new features.

Power

We’ve moved from USB micro-B to USB-C for our power connector. This supports an extra 500mA of current, ensuring we have a full 1.2A for downstream USB devices, even under heavy CPU load.

An extra half amp, and USB OTG to boot

Video

To accommodate dual display output within the existing board footprint, we’ve replaced the type-A (full-size) HDMI connector with a pair of type-D (micro) HDMI connectors.

Seeing double

Ethernet and USB

Our Gigabit Ethernet magjack has moved to the top right of the board, from the bottom right, greatly simplifying PCB routing. The 4-pin Power-over-Ethernet (PoE) connector remains in the same location, so Raspberry Pi 4 remains compatible with the PoE HAT.

Through the looking glass

The Ethernet controller on the main SoC is connected to an external Broadcom PHY over a dedicated RGMII link, providing full throughput. USB is provided via an external VLI controller, connected over a single PCI Express Gen 2 lane, and providing a total of 4Gbps of bandwidth, shared between the four ports.

All three connectors on the right-hand side of the board overhang the edge by an additional millimetre, with the aim of simplifying case design. In all other respects, the connector and mounting hole layout remains the same, ensuring compatibility with existing HATs and other accessories.

New Raspbian software

To support Raspberry Pi 4, we are shipping a radically overhauled operating system, based on the forthcoming Debian 10 Buster release. This brings numerous behind-the-scenes technical improvements, along with an extensively modernised user interface, and updated applications including the Chromium 74 web browser. Simon will take an in-depth look at the changes in tomorrow’s blog post, but for now, here’s a screenshot of it in action.

Raspbian Buster desktop

Some advice for those who are keen to get going with Raspbian Buster right away: we strongly recommend you download a new image, rather than upgrading an existing card. This ensures that you’re starting with a clean, working Buster system. If you really, really want to try upgrading, make a backup first.

One notable step forward is that for Raspberry Pi 4, we are retiring the legacy graphics driver stack used on previous models. Instead, we’re using the Mesa “V3D” driver developed by Eric Anholt at Broadcom over the last five years. This offers many benefits, including OpenGL-accelerated web browsing and desktop composition, and the ability to run 3D applications in a window under X. It also eliminates roughly half of the lines of closed-source code in the platform.

New Raspberry Pi 4 accessories

Connector and form-factor changes bring with them a requirement for new accessories. We’re sensitive to the fact that we’re requiring people to buy these: Mike and Austin have worked hard to source good-quality, cost-effective products for our reseller and licensee partners, and to find low-cost alternatives where possible.

Raspberry Pi 4 Case

Gordon has been working with our design partners Kinneir Dufort and manufacturers T-Zero to develop an all-new two-part case, priced at $5.

New toy, new toy box

We’re very pleased with how this has turned out, but if you’d like to re-use one of our existing cases, you can simply cut away the plastic fins on the right-hand side and omit one of the side panels as shown below.

Quick work with a Dremel

Raspberry Pi 4 Power Supply

Good, low-cost USB-C power supplies (and USB-C cables) are surprisingly hard to find, as we discovered when sending out prototype units to alpha testers. So we worked with Ktec to develop a suitable 5V/3A power supply; this is priced at $8, and is available in UK (type G), European (type C), North American (type A) and Australian (type I) plug formats.

Behold the marvel that is BS 1363

If you’d like to re-use a Raspberry Pi 3 Official Power Supply, our resellers are offering a $1 adapter which converts from USB micro-B to USB-C. The thick wires and good load-step response of the old official supply make this a surprisingly competitive solution if you don’t need a full 3 amps.

Somewhat less marvellous, but still good

Raspberry Pi 4 micro HDMI Cables

Again, low-cost micro HDMI cables which reliably support the 6Gbps data rate needed for 4Kp60 video can be hard to find. We like the Amazon Basics cable, but we’ve also sourced a 1m cable, which will be available from our resellers for $5.

Official micro HDMI to HDMI cable

Updated Raspberry Pi Beginner’s Guide

At the end of last year, Raspberry Pi Press released the Official Raspberry Pi Beginner’s Guide. Gareth Halfacree has produced an updated version, covering the new features of Raspberry Pi 4 and our updated operating system.

Little computer people

Raspberry Pi 4 Desktop Kit

Bringing all of this together, we’re offering a complete Desktop Kit. This is priced at $120, and comprises:

  • A 4GB Raspberry Pi 4
  • An official case
  • An official PSU
  • An official mouse and keyboard
  • A pair of HDMI cables
  • A copy of the updated Beginner’s Guide
  • A pre-installed 16GB 32GB [oops – Ed.] microSD card

Raspberry Pi Desktop Kit

Raspberry Pi Store

This is the first product launch following the opening of our store in Cambridge, UK. For the first time, you can come and buy Raspberry Pi 4 directly from us, today. We’ll be open from 8am to 8pm, with units set up for you to play with and a couple of thousand on hand for you to buy. We even have some exclusive launch-day swag.

The Raspberry Pi Store sign

Form an orderly line

If you’re in the bottom right-hand corner of the UK, come on over and check it out!

New Raspberry Pi silicon

Since we launched the original Raspberry Pi in 2012, all our products have been based on 40nm silicon, with performance improvements delivered by adding progressively larger in-order cores (Cortex-A7, Cortex-A53) to the original ARM11-based BCM2835 design. With BCM2837B0 for Raspberry Pi 3B+ we reached the end of that particular road: we could no longer afford to toggle more transistors within our power budget.

Raspberry Pi 4 is built around BCM2711, a complete re-implementation of BCM283X on 28nm. The power savings delivered by the smaller process geometry have allowed us to replace Cortex-A53 with the much more powerful, out-of-order, Cortex-A72 core; this can execute more instructions per clock, yielding performance increases over Raspberry Pi 3B+ of between two and four times, depending on the benchmark.

We’ve taken advantage of the process change to overhaul many other elements of the design. We moved to a more modern memory technology, LPDDR4, tripling available bandwidth; we upgraded the entire display pipeline, including video decode, 3D graphics and display output to support 4Kp60 (or dual 4Kp30) throughput; and we addressed the non-multimedia I/O limitations of previous devices by adding on-board Gigabit Ethernet and PCI Express controllers.

Raspberry Pi 4 FAQs

We’ll keep updating this list over the next couple of days, but here are a few to get you started.

Wait, is it 2020 yet?

In the past, we’ve indicated 2020 as a likely introduction date for Raspberry Pi 4. We budgeted time for four silicon revisions of BCM2711 (A0, B0, C0, and C1); in comparison, we ship BCM2835C2 (the fifth revision of that design) on Raspberry Pi 1 and Zero.

Fortunately, 2711B0 has turned out to be production-ready, which has taken roughly 9–12 months out of the schedule.

Are you discontinuing earlier Raspberry Pi models?

No. We have a lot of industrial customers who will want to stick with the existing products for the time being. We’ll keep building these models for as long as there’s demand. Raspberry Pi 1B+, 2B, 3B, and 3B+ will continue to sell for $25, $35, $35, and $35 respectively.

What about a Model A version?

Historically, we’ve produced cut-down, lower-cost, versions of some of our $35 products, including Model 1A+ in 2014, and Model 3A+ at the end of last year. At present we haven’t identified a sensible set of changes to allow us to do a “Model 4A” product at significantly less than $35. We’ll keep looking though.

What about the Compute Module?

CM1, CM3, and CM3+ will continue to be available. We are evaluating options for producing a Compute Module product based on the Raspberry Pi 4 chipset.

Are you still using VideoCore?

Yes. VideoCore 3D is the only publicly documented 3D graphics core for ARM‑based SoCs, and we want to make Raspberry Pi more open over time, not less.

Credits

A project like Raspberry Pi 4 is the work of many hundreds of people, and we always try to acknowledge some of those people here.

This time round, particular credit is due to James Adams, who designed the board itself (you’ll find his signature under the USB 3.0 socket); to Mike Buffham, who ran the commercial operation, working with suppliers, licensees, and resellers to bring our most complicated product yet to market; and to all those at Raspberry Pi and Broadcom who have worked tirelessly to make this product a reality over the last few years.

A partial list of others who made major direct contributions to the BCM2711 chip program, CYW43455, VL805, and MxL7704 integrations, DRAM qualification, and Raspberry Pi 4 itself follows:

James Adams, Cyrus Afghahi, Umesh Agalgave, Snehil Agrawal, Sam Alder, Kiarash Amiri, Andrew Anderson, Eng Lim Ang, Eric Anholt, Greg Annandale, Satheesh Appukuttan, Vaibhav Ashtikar, Amy Au, Ben Avison, Matt Bace, Neil Bailey, Jock Baird, Scott Baker, Alix Ball, Giles Ballard, Paul Barnes, Russell Barnes, Fiona Batchelor, Alex Bate, Kris Baxter, Paul Beech, Michael Belhazy, Jonathan Bell, John Bellairs, Oguz Benderli, Doug Berger, Ron Berthiaume, Raj Bharadwaj, Udaya Bhaskar, Geoff Blackman, Ed Bleich, Debbie Brandenburg, David Brewer, Daniel Brierton, Adam Brown, Mike Buffham, Dan Caley, Mark Calleja, Rob Canaway, Cindy Cao, Victor Carmon, Ian Carter, Alex Carter, Amy Carter, Mark Castruita, KK Chan, Louis Chan, Nick Chase, Sherman Chen, Henry Chen, Yuliang Cheng, Chun Fai Cheung, Ravi Chhabra, Scott Clark, Tim Clifford, Nigel Clift, Dom Cobley, Steve Cole, Philip Colligan, Stephen Cook, Sheena Coote, Sherry Coutu, John Cowan-Hughes, John Cox, Peter Coyle, Jon Cronk, Darryl Cross, Steve Dalton, Neil Davies, Russell Davis, Tom De Vall, Jason Demas, Todd DeRego, Ellie Dobson, David Doyle, Alex Eames, Nicola Early, Jeff Echtenkamp, Andrew Edwards, Kevin Edwards, Phil Elwell, Dave Emett, Jiin Taur Eng, Gabrielle England, YG Eom, Peggy Escobedo, Andy Evans, Mark Evans, Florian Fainelli, David Ferguson, Ilan Finkelstein, Nick Francis, Liam Fraser, Ian Furlong, Nachiket Galgali, David Gammon, Jan Gaterman, Eric Gavami, Doug Giles, Andrew Goros, Tim Gover, Trevor Gowen, Peter Green, Simon Greening, Tracey Gregory, Efim Gukovsky, Gareth Halfacree, Mark Harris, Lucy Hattersley, James Hay, Richard Hayler, Gordon Henderson, Leon Hesch, Albert Hickey, Kevin Hill, Stefan Ho, Andrew Hoare, Lewis Hodder, William Hollingworth, Gordon Hollingworth, Michael Horne, Wanchen Hsu, David Hsu, Kevin YC Huang, Pei Huang, Peter Huang, Scofield Huang, James Hughes, Andy Hulbert, Carl Hunt, Rami Husni, Steven Hwang, Incognitum, Bruno Izern, Olivier Jacquemart, Mini Jain, Anurag Jain, Anand Jain, Geraint James, Dinesh Jayabharathi, Vinit Jayaraj, Nick Jeffery, Mengjie Jiang, David John, Alison Johnston, Lily Jones, Richard Jones, Tony Jones, Gareth Jones, Lijo Jose, Nevin Jose, Gary Kao, Gary Keall, Gerald Kelly, Ian Kersley, Gerard Khoo, Dani Kidouchim, Phil King, Andreas Knobloch, Bahar Kordi-Borojeni, Shuvra Kundu, Claire Kuo, Nicole Kuo, Wayne Kusumo, Koen Lampaert, Wyn Landon, Trever Latham, William Lee, Joon Lee, William Lee, Dave Lee, Simon Lewis, David Lewsey, Sherman Li, Xizhe Li, Jay Li, John CH Lin, Johan Lin, Jonic Linley, Chris Liou, Lestin Liu, Simon Long, Roy Longbottom, Patrick Loo, James Lougheed, Janice Lu, Fu Luo-Larson, Jeff Lussier, Helen Lynn, Terence Mackown, Neil MacLeod, Kevin Malone, Shahin Maloyan, Tim Mamtora, Stuart Martin, Simon Martin, Daniel Mason, Karen Matulis, Andrea Mauri, Scott McGregor, Steven Mcninch, Ben Mercer, Kamal Merchant, James Mills, Vassil Mitov, Ali Syed Mohammed, Brendan Moran, Alan Morgan, Giorgia Muirhead, Fiacre Muller, Aram Nahidipour, Siew Ling Ng, Thinh Nguyen, Lee Nguyen, Steve Noh, Paul Noonan, Keri Norris, Rhian Norris, Ben Nuttall, Brian O’Halloran, Martin O’Hanlon, Yong Oh, Simon Oliver, Mandy Oliver, Emma Ormond, Shiji Pan, Kamlesh Pandey, Christopher Pasqualino, Max Passell, Naush Patuck, Rajesh Perruri, Eric Phiri, Dominic Plunkett, Nutan Raj, Karthik Rajendran, Rajendra Ranmale, Murali Rangapuram, Ashwin Rao, Nick Raptopoulos, Chaitanya Ray, Justin Rees, Hias Reichl, Lorraine Richards, David Richardson, Tim Richardson, Dan Riiff, Peter de Rivaz, Josh Rix, Alwyn Roberts, Andrew Robinson, Kevin Robinson, Nigel Roles, Paul Rolfe, Marcelo Romero, Jonathan Rosenfeld, Sarah Roth, Matt Rowley, Matthew Rowley, Dave Saarinen, Ali Salem, Suzie Sanders, Graham Sanderson, Aniruddha Sane,
Andrew Scheller, Marion Scheuermann, Serge Schneider, Graham Scott, Marc Scott, Saran Kumar Seethapathi, Shawn Shadburn, Abdul Shaik, Mark Skala, Graham Smith, Michael Smith, Martin Sperl, Ajay Srivastava, Nick Steele, Ben Stephens, Dave Stevenson, Mike Stimson, Chee Siong Su, Austin Su, Prem Swaroop, Grant Taylor, Daniel Thompsett, Stuart Thomson, Eddie Thorn, Roger Thornton, Chris Tomlinson, Stephen Toomey, Mohamed Toubella, Frankie Tsai, Richard Tuck, Mike Unwin, Liz Upton, Manoj Vajhallya, Sandeep Venkatadas, Divya Vittal, John Wadsworth, Stefan Wahren, Irene Wang, Jeremy Wang, Rich Wells, Simon West, Joe Whaley, Craig Wightman, Oli Wilkin, Richard Wilkins, Sarah Williams, Jack Willis, Rob Wilson, Luke Wren, Romona Wu, Zheng Xu, Paul Yang, Pawel Zackiewicz, Ling Zhang, Jean Zhou, Ulf Ziemann, Rob Zwetsloot.

If you’re not on this list and think you should be, please let me know, and accept my apologies.

429 Comments

Steampunk-inspired Raspberry Pi enclosure | HackSpace magazine #20

Who doesn’t like a good-looking case for their Raspberry Pi?

Exactly.

We’ve seen many homemade cases over the years, from 3D-printed enclosures to LEGO, Altoid tins and gravity-defying Zelda-themed wonderments. We love them all as much as we love own — our own case being this one if you fancy one — and always look forward to seeing more.

Cue this rather fancy steampunk-inspired enclosure made by Erich Styger, as featured in the latest issue of HackSpace magazine.

The magazine states:

This steampunk enclosure for the Raspberry Pi by Erich Styger was laser-cut out of 4 mm birch plywood, and stained to make it look a bit more 1890s. It’s built to fit a Raspberry Pi with an NXP tinyK22 board and a battery backup, and there are ports artfully crafted into it so that the system is fully functional even when the box is closed.

Those gears aren’t just for show: turn the central wheel on the front of the box to open the enclosure and get access to the electronics inside.

Cool, right?

What cases have you made for your Raspberry Pi? Let us know in the comments, or by tagging @Raspberry_Pi and @HackSpaceMag on Twitter.

HackSpace magazine is out now

You can read the rest of this feature in HackSpace magazine issue 20, out today in Tesco, WHSmith, and all good independent UK newsagents.

Or you can buy HackSpace mag directly from us — worldwide delivery is available. And if you’d like to own a handy digital version of the magazine, you can also download a free PDF.

2 Comments