This 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.
This month’s Hobby Tech has just two component parts: a long-term review of the Tenma 60W Digital Soldering Station, and a in-depth guide to building an ultrasonic distance sensor using a Spark Core for a somewhat novel application: shaming me into using my standing desk more.
Looking at the tutorial first, it all stemmed from an office move in which I bought a vast quantity of Ikea furniture. Among it all was a new desk, which for a small extra fee I was able to get with a simple hand-crank mechanism fitted to adjust its height. As I spend the vast majority of my life in front of a computer, I thought a little change like spending some of the day standing instead of sitting would do me the world of good – but, as could be expected, after an initial burst of enthusiasm I found myself using the desk in sitting mode more often than not.
This month’s project was my attempt to rectify that. Using a cheap ultrasonic distance sensor and a Spark Core microcontroller – now known as a Particle Photon, following a major rebranding exercise – I built a device which could track the distance between the surface of the desk and the ceiling and thus report whether it was in sitting or standing mode. When a mode change was detected, it would post a message to Twitter – thus publicly shaming me if I spent too long in sitting mode.
It’s a bit of a daft project, but one which demonstrates some useful techniques: it uses a resistor ladder to lower the 5V output from the ultrasonic sensor to a Spark Core-friendly 3.3V, it shows how a Wi-Fi-connected microcontroller can report readings to a remote system, and even uses If This Then That (IFTTT) to automatically post messages to Twitter based on those readings. As to whether it actually encouraged me to spend more time standing? Not so much.
As the tutorial’s complexity meant taking up a three-page spread, there was only room for one additional feature this month: a two-page long-term review of the Tenma 60W Digital Soldering Station, which I bought some time ago to replace my Maplin-branded variable-output soldering iron. Despite its surprisingly reasonable cost, purchased from the ever-reliable CPC, it’s proven a sturdy tool and is an easy recommendation for anyone looking for an entry-level upgrade from fixed-output irons. It’s also a pleasure to be able to form a long-term opinion on something: all too frequently I review items on a short-term basis, which reveals nothing about their reliability over time. Having been using the Tenma for well over a year now, though, I can personally guarantee its longevity.
All this, plus a variety of interesting things written by people who aren’t me, can be yours at your local newsagent, supermarket, or electronically via Zinio and similar digital distribution services.