The MagPi, Issue 108

The MagPi Issue 108This month’s issue of The MagPi Magazine includes another of my tutorials for those looking to get started with the MicroPython platform on the Raspberry Pi Pico microcontroller: a data logger, which makes use of the microcontroller’s ability to run saved code away from a computer and its flash file system.

Originally written as part of Get Started with MicroPython on Raspberry Pi Pico: The Official Guide, my guide to physical computing on Raspberry Pi’s first-ever microcontroller development board, this latest tutorial – one of the last in the book – covers file handling in MicroPython, which can often trip up new users: opening a file for writing erases any previous contents, giving you an empty file if you’re not careful.

The tutorial then moves on to reading and formatting temperature data from the on-board sensor, storing it in a file for later loading, and even running the Raspberry Pi Pico without being connected to a Raspberry Pi or other computer – making use of a special file name to load code on boot without user interaction.

The MagPi Issue 108 is available at now at all good newsagents and supermarkets, online with global delivery, or as a Creative Commons-licensed DRM-free zero-cost PDF download on the official website.

The MagPi, Issue 107

The MagPi Issue 107This month’s issue of The MagPi Magazine includes another of my tutorials for those looking to get started with the MicroPython platform on the Raspberry Pi Pico microcontroller:a temperature sensor, using the analogue-to-digital converter (ADC) built into the RP2040.

Originally written as part of Get Started with MicroPython on Raspberry Pi Pico: The Official Guide, my guide to physical computing on Raspberry Pi’s first-ever microcontroller development board, the tutorial builds in the same way as the other projects in the book – introducing core concepts then building step-by-step from a minimum-viable project up to a fully-functional completed device.

As with other tutorials written for the book, full source code – in MicroPython – is provided, along with a wiring diagram which shows how to wire up a potentiometer using two or three pins and why that makes a difference to how it works. The project can be attacked with no additional hardware, however: the temperature sensor is built into the RP2040 microcontroller on board the Raspberry Pi Pico, and readers are free to skip building the potentiometer circuit if they don’t have the component lying around.

The MagPi Issue 107 is available at now at all good newsagents and supermarkets, online with global delivery, or as a Creative Commons-licensed DRM-free zero-cost PDF download on the official website.

The MagPi, Issue 106

The MagPi Issue 106This month’s issue of The MagPi Magazine includes another of my tutorials for those looking to get started with the MicroPython platform on the Raspberry Pi Pico microcontroller: a Pico-powered burglar alarm driven by one or more passive infrared sensors.

Originally written as part of Get Started with MicroPython on Raspberry Pi Pico: The Official Guide, my guide to physical computing on Raspberry Pi’s first-ever microcontroller development board, the burglar alarm tutorial builds up step-by-step from introducing a single passive infrared motion sensor to interfacing with multiple sensors, printing status reports over the serial console, and triggering a piezoelectric buzzer in place of a real alarm’s rather louder horn.

As with other tutorials written for the book, full source code – in MicroPython – is provided, along with wiring references designed to make it as easy as possible to add the components to a Raspberry Pi Pico installed on a solderless breadboard. There’s scope for further extension, too: adding break-beam sensors, glass-break sensors, or a code pad for disabling and enabling the alarm on-demand.

The MagPi Issue 106 is available at now at all good newsagents and supermarkets, online with global delivery, or as a Creative Commons-licensed DRM-free zero-cost PDF download on the official website.

The MagPi, Issue 105

The MagPi Issue 105This month’s The MagPi Magazine includes a six-page tutorial I originally wrote as part of Get Started with MicroPython on Raspberry Pi Pico: The Official Guide, my well-received guide to physical computing on Raspberry Pi’s first-ever microcontroller development board: a two-player reaction-testing game.

As with all projects in the book, the reaction game is designed to build up gradually. The reader is first taken through wiring up a simple circuit with a single LED and a single button, using one to trigger the other. Gradually, the complexity is increased: using the LED to trigger a countdown stopped only when the button is pushed, giving the user a look at how quickly they can react.

The project’s culmination comes with the integration of multiplayer: two buttons are used, and whichever player hits their button first is declared the winner. It’s a simple game, admittedly, but a surprisingly competitive one – and one which introduces a range of core concepts for input handling, timing, and conditional statements.

The MagPi Issue 105 is available at all good supermarkets and newsagents, online with global delivery, or as a Creative Commons-licensed DRM-free no-cost PDF download on the official website.

The MagPi, Issue 104

The MagPi Issue 104Inside The MagPi Magazine this month you’ll find five pages of step-by-step tutorial walking through the creation of a functional traffic light simulator using the Raspberry Pi Pico microcontroller board – taken from my latest book, Get Started with MicroPython on Raspberry Pi Pico: The Official Guide.

All the projects in the book, the traffic light simulator being no exception, work step-by-step in building the simplest possible incarnation of each then adding increasing complexity – and in doing so introducing new concepts. In the case of the traffic light simulator, it starts off as a simple set of three LEDs which are under timed control.

As the project progresses, the reader adds a button to act as a trigger for a pedestrian crossing – which adds the concept of threading, taking advantage of the second CPU core on the Raspberry Pi Pico’s RP2040 microcontroller – before finishing the project with a buzzer providing audible feedback for when it’s safe to cross.

The MagPi Issue 104 is available in all good supermarkets and newsagents now, online with global delivery, or as a Creative Commons-licensed DRM-free PDF download on the official website.

The MagPi, Issue 103

MagPi Issue 103This month’s The MagPi Magazine carries my six-page guide to getting started with physical computing projects using the newly-launched Raspberry Pi Pico, the first microcontroller in the Raspberry Pi family.

Taken from my book, Get Started with MicroPython on Raspberry Pi Pico: The Official Guide, the tutorial walks the reader through programming the Raspberry Pi Pico using MicroPython – starting with the physical computing equivalent of “hello, world,” lighting up an LED. No additional hardware is needed for this part: the Raspberry Pi Pico includes a surface-mount user-addressable LED at the top of the board.

The reader is then shown how solderless breadboards work, introduced to importing MicroPython libraries and handling delays, how external LEDs require resistors, how to read a button input, and finally how to put it al together into a simple circuit which can toggle the LED based on the user’s button presses.

The MagPi Issue 103 is available at all good supermarkets and newsagents, online with global delivery, or as a Creative Commons-licensed DRM-free no-cost PDF download on the official website.

The MagPi Magazine, Issue 102

The MagPi Issue 102This month’s MagPi Magazine celebrates the launch of the new Raspberry Pi Pico with my 14-page feature introducing the first Raspberry Pi microcontroller, the first in-house silicon which powers it, and walking the reader through getting started programming the device with MicroPython – as well as talking to three of the people behind the effort.

Built around the RP2040, the first silicon chip produced by Raspberry Pi’s in-house ASIC team, the Raspberry Pi Pico is a fascinating device. While accessible enough for education, thanks to MicroPython support and a breadboard-friendly layout, it’s also designed to work as a module for industrial and embedded projects – and even launches with a port of TensorFlow Lite for machine learning work.

My feature begins with a look at the Raspberry Pi Pico and the RP2040, covering all the major features from RP2040’s programmable input/output (PIO) to the handy single-wire debug (SWD) header at the bottom of the Raspberry Pi Pico. As always, there’s plenty of photography.

The feature then moves on to an interview with Nick Francis, senior engineering manager, James Adams, chief operating officer, and Eben Upton, chief executive officer, covering the work done on both RP2040 and Pico, their hopes for the device, and how it aims to pack a surprising amount of functionality into a £3.60 gadget – “cheap as chips,” Adams told me.

Finally, the feature closes with a series of hands-on tutorials walking the reader through setting the Raspberry Pi Pico up on their Raspberry Pi or other computer, flashing the MicroPython firmware, and working on their first physical computing program.

MagPi Issue 102 is available now from all good newsagents and supermarkets, online with global delivery, or as a DRM-free PDF download under a free-as-in-speech Creative Commons licence. The Raspberry Pi Pico is also the topic of my latest book, Get Started with MicroPython on Raspberry Pi Pico: The Official Guide.

The MagPi, Issue 100

The MagPi Issue 100For this bumper issue of The MagPi, celebrating 100 issues since its launch as a fanzine and subsequent adoption as the official Raspberry Pi magazine, I take a deep dive into the company’s latest single-board computer: the very-nearly-all-in-one Raspberry Pi 400.

Built into a keyboard housing, the Raspberry Pi 400 is almost everything you need: just add a USB Type-C power supply, microSD, mouse, and display. For those buying the Personal Computer Kit – previously the Desktop Kit – that’s reduced to only needing an external display. Better still, the design includes the Raspberry Pi family’s first passive cooling system – and a speed boost from 1.5GHz to 1.8GHz.

Across the hefty 12-page feature I take the reader on a visual tour of the new board’s external ports and internal features – stripping it down to the surprisingly large single-board computer ensconced within – before taking a break for an interview with principal hardware engineer Simon Martin and Raspberry Pi Foundation founder Eben Upton on the project’s origins and development.

Benchmarks follow, putting hard numbers to the speed boost that has seen the CPU clocked from the default 1.5GHz on the Raspberry Pi 4 to 1.8GHz on the Raspberry Pi 400. As with previous launches, these include historical measurements going all the way back to the original Raspberry Pi Model A and Model B – detailing the performance of every board, bar the industrial-focus Compute Modules, across synthetic and real-world workloads.

The full review is available now in The MagPi Issue 100 from supermarkets and newsagents, online with global delivery, or as a free Creative Commons licensed PDF download on the official website.

The MagPi, Issue 99

The MagPi Issue 99This month’s The MagPi, the official Raspberry Pi magazine, includes a hefty spread taking a look at the newly-launched Raspberry Pi Compute Module 4 – bringing the power of the Broadcom BCM2711 to the Compute Module form factor for the first time.

Well, sort of: the new Raspberry Pi Compute Module 4 is actually a wholly new form factor, ditching the old SODIMM edge connector in favour of two high-density connectors on the underside. While that means no backwards compatibility with existing Compute Module carrier boards, third parties have stepped up and launched interposer boards to let you squeeze the new board into old designs.

Having been provided with pre-release access to the Compute Module 4 and its IO Board, my launch feature takes a look at the physical layout and the components that go into the board – with macro photography, including coverage of the high-performance eMMC storage on-board selected models – and runs through a selection of benchmarks testing everything from synthetic and real-world performance to footprint and weight.

One particularly interesting aspect of the benchmarking, and one which will inform designs based around the new module, was thermal throttling analysis: the Raspberry Pi 4 is known to run reasonably hot, though enhancements since launch have brought the temperature down considerably, and moving the same technology into a smaller footprint means the Compute Module 4 gets toasty warm. As Raspberry Pi Foundation founder Eben Upton explained, passive cooling is going to be a must for most designs.

The MagPi Issue 99 is available now from all good newsagents and supermarkets, online with global delivery, or as a free-as-in-speech download under a Creative Commons licence.

The MagPi, Issue 94

The MagPi Issue 94This month’s The MagPi Magazine celebrates the launch of the Raspberry Pi 4 Model B 8GB, the latest single-board computer from the Raspberry Pi Foundation – and the most expensive and highest-specification model to boot.

My cover feature for the launch begins with an overview of the board, which is effectively identical to the previous 1GB, 2GB, and 4GB models bar the memory module in use. With 8GB of LPDDR4 on board, it has twice the memory of its nearest predecessor – and eight times the entry-level model, since pseudo-retired when falling memory prices brought the cost of the 2GB model down to the same level as the 1GB.

The next two pages diverge from my usual launch-day coverage, replacing benchmarks with a dive into the sort of use-cases that could justify moving from 4GB to 8GB of RAM: storage caching, disk-free computing, in-memory databases, virtual machines and containerised applications, machine learning and the like.

The reason for the shift away from benchmarking is simple: in repeated testing the Raspberry Pi 4 Model B 8GB proved absolutely identical in performance to any other model of Raspberry Pi 4, unless the workload exceeded available free memory. While it would have been easy to develop synthetic benchmarks which would show a dramatic improvement in performance for the new model, it would have been misleading to anyone expecting to see a speed boost for day-to-day computing.

From there, the feature moves on to an interview with Raspberry Pi Foundation founder Eben Upton on the timing of the launch – “[it is] absolutely as soon as we can,” he told me during the interview, “the memory packages we’re using are literally some of the first off the production line, a brand-new, shiny memory technology” – the sort of user the new model targets, the Foundation’s work on a 64-bit version of the Raspberry Pi OS which launches in beta today alongside the new board, and the future of the Raspberry Pi 4 range which, sadly, is not likely to include a 16GB model.

The full feature is available to read now in The MagPi Issue 94, available to purchase with global delivery or to download as a free Creative Commons-licensed PDF on the official website.