The macropad PCB panel next to an assembled macropad

A Fun Low-Cost Start For Your Macropad Hobby

If you were ever looking for a small relaxing evening project that you could then use day-to-day, you gotta consider the Pico Hat Pad kit by [Natalie the Nerd]. It fits squarely within the Pi Pico form-factor, giving you two buttons, one rotary encoder and two individually addressable LEDs to play with. Initially, this macropad was intended as an under-$20 device that’s also a soldering practice kit, and [Natalie] has knocked it out of the park.

You build this macropad out of a stack of three PCBs — the middle one connecting the Pi Pico heart to the buttons, encoders and LEDs, and the remaining ones adding structural support and protection. All the PCBs fit together into a neat tab-connected panel — ready to be thrown into your favorite PCB service’s shopping cart. Under the hood, this macropad uses KMK, a CircuitPython-based keyboard firmware, with the configuration open-source. In fact everything is open-source, just the way we like it.

If you find yourself with an unexpected affinity for macropads after assembling this one, don’t panic. It’s quite a common side-effect. Fortunately, there are cures, and it’s no longer inevitable that you’ll go bananas about it. That said, if you’re fighting the urges to go bigger, you can try a different hand-wireable Pico-based macropad with three more keys. Come to find that one not enough? Here’s a 2×4 3D printable one.

Now, if you eventually find yourself reading every single Keebin’ With Kristina episode as soon as it comes out, you might be too far gone, and we’ll soon find you spending hundreds of dollars building tiny OLED screens into individual keys — in which case, make sure you document it and share it with us!

Continue reading “A Fun Low-Cost Start For Your Macropad Hobby”

A DIY self-balancing robot

3D-Printed Self-Balancing Robot Brings Control Theory To Life

Stabilizing an inverted pendulum is a classic problem in control theory, and if you’ve ever taken a control systems class you might remember seeing pages full of differential equations and bode diagrams just to describe its basic operation. Although this might make such a system seem terribly complicated, actually implementing all of that theory doesn’t have to be difficult at all, as [Limenitis Reducta] demonstrates in his latest project. All you need is a 3D printer, some basic electronic skills and knowledge of Python.

The components needed are a body, two wheels, motors to drive those wheels and some electronics. [Limenitis] demonstrates the design process in the video below (in Turkish, with English subtitles available) in which he draws the entire system in Fusion 360 and then proceeds to manufacture it. The body and wheels are 3D-printed, with rubber bands providing some traction to the wheels which would otherwise have difficulty on slippery surfaces.

A PCB driving two stepper motors
The PCB has just a few components, with most of the complexity handled by plug-in modules.

Two stepper motors drive the wheels, controlled by a DRV8825 motor driver, while an MPU-9250 accelerometer and gyroscope unit measures the angle and acceleration of the system. The loop is closed by a Raspberry Pi Pico that implements a PID controller: another control theory classic, in which the proportional, integral and derivative parameters are tuned to adapt the control loop to the physical system in question. External inputs can be provided through a Bluetooth connection, which makes it possible to control the robot from a PC or smartphone and guide it around your living room.

All design files and software are available on [Limenitis]’s GitHub page, and make for an excellent starting point if you want to put some of that control theory into practice. Self-balancing robots are a favourite among robotics hackers, so there’s no shortage of examples if you need some more inspiration before making your own: you can build them from off-the-shelf parts, from bits of wood, or even from a solderless breadboard.

Continue reading “3D-Printed Self-Balancing Robot Brings Control Theory To Life”

Magnetic jack version of the bit-bang ethernet peripheral for Raspberry Pi Pico

Bit-Banging Bidirectional Ethernet On A Pi Pico

These days, even really cheap microcontroller boards have options that will give you Ethernet or WiFi access. But what if you have a Raspberry Pi Pico board and you really want to MacGyver yourself a network connection? You could do worse than check out this project by [holysnippet] that gives you a bit-banged bidirectional Ethernet port using only scrap passive components and software.

This project is similar to one we shared back in August by [kingyo], but differs in that what [holysnippet] has achieved is a fully-functional (albeit only around 7 Mbps) Ethernet port, rather than a simple UDP transmit device. The Ethernet connection itself is handled by the lwip stack. Connection to the RJ45 socket can be made from any of the Pi Pico pins, provided TX_NEG is followed directly by TX_POS, but the really hacky part is in the hardware.

schematic of Pi Pico bit-banged ethernet peripheral
Schematic showing the empirically-determined passive component values required.

Rather than developing hardware that would protect the Pico, this design admits that it “shamefully relies on the Pico’s input protection devices” to limit the Ethernet voltages to 3.3 V.

You’ll need an isolation transformer from some old Ethernet-enabled gear (either standalone or as part of a magnetic jack), but then it’s only resistors and capacitors from there. There are warnings not to connect this to PoE networks for obvious reasons, and the component layout needs to keep in mind the ~20 MHz frequencies involved, but to get this working at all feels like quite a feat.

Normally, there’d be no reason to go to these lengths, but it’s always educational to see if it can be done and, with the current component shortages, this is another trick to keep up your sleeve for emergencies!

Putting ports where they shouldn’t belong is not a new idea, of course.  Back in the day we even shared an inadvisable ATTINY implementation of bit-banged Ethernet with no protection at all.

Thanks to [biemster] for the tip-off

A two picture montage of the blackout logger, the left picture being the front e-ink display of the data logger in a black case and the second picture of the back of the data logger, with the raspberry pi pico show attached to an e-ink display, both sitting on a wooden table.

Blackout Logger Keeps Track Of Power Outages

[Dmytro Panin] lives in Kyiv, Ukraine where there have been rolling blackouts to stabilize the power grid. To help keep track of when the blackouts might happen, be they planned or emergency, and to get more information on how long the blackouts last, [Dmytro] has created a blackout logger.

The build consists of a Raspberry Pi Pico that connects to a DS3231 real time clock (RTC) with a Waveshare 3.7 inch eInk display which [Dmytro] puts into a custom 3D printed case. The RTC has it’s own small power supply, often times from a coin cell battery attached to the module, allowing it to keep time when the module and other devices attached to it are powered off.

The Raspberry Pi Pico is programmed to “poll” every 30 seconds, writing the current time to a file. Should the unit lose power, the last time, within a 30 second window, is available when power is restored and the unit wakes up again. Since the RTC has kept the current time, there is enough information to display the duration of the blackout. The eInk screen ensures that the information is readily available, even when there is no power.

War is not the only reason blackouts can occur and we’ve covered some issues with blackouts in Texas and California in the US.

Sprig Is An Open Source Handheld Game Console

[Hack Club] is a group that aims to teach teenagers about tech by involving them in open-source projects. One of the group’s latest efforts is Sprig, an open-source handheld game console, and [Hack Club] has even been giving them away!

The console is based around a Raspberry Pi Pico, paired up with a TFT7735 screen. There’s also a MAX98357A audio amp on board to provide sound. Other than that, there’s a full ten buttons for control, some LEDs for feedback, and it’s all assembled on a custom PCB designed for easy soldering.

Plenty of work has been done to make Sprig an accessible platform for first-time developers. Games can be created for Sprig and run either on the device, or in an online web-based editor. [Hack Club] is even running a program that will give Sprig hardware away to kids and teens worldwide who write a game for the platform and submit it to the online gallery.

If you’re eager to get into game development while understanding both the hardware and software side of things, Sprig might be just what you’re looking for. With today’s microcontrollers being so cheap and so powerful, we’ve seen some other great handheld designs recently, too!

A Pi Pico Oscilloscope

At the budget end of the oscilloscope range lie the so-called pocket ‘scopes. About the size of a deck of cards, they combine a microcontroller and an LCD screen to make an instrument with a bandwidth in the tens of kilohertz and a not-too-sparkling performance. They’re something of a toy, but then again, if all that’s needed is a simple ‘scope for audio frequencies, they make a passable choice in a small package. Now [jgpeiro] has made one which is light years ahead of the toy kits, using a Raspberry Pi Pico, a 100 MHz ADC, and an effort to design a better input circuit.

At its simplest this could be a straightforward op-amp and ADC circuit feeding the Pico, but instead it has multiple stages carefully designed to offer the full bandwidth, and with gain, offset, and trigger settings being set by a series of DAC chips under software control. This and the decent bandwidth make this a much more viable oscilloscope, and one we’d like to see further developed.

By comparison, we took a look at the best of the competition a few years ago.

A Pi Pico plugged into a breadboard, with an I2C OLED display connected to it

Need An USB-I2C Adapter? Use Your Pico!

Given its abundance and simplicity, the RP2040 has no doubt become a favourite for USB peripheral building – in particular, USB-connected tools for electronics experiments. Today, we see one more addition to our Pico-based tool arsenal – a USB-I2C adapter firmware for RP2040 by [Renze Nicolai]. This is a reimplementation of the ATTiny-based I2C-Tiny-USB project and complies to the same protocol – thus, it’s compatible with the i2c-tiny-usb driver that’s been in the Linux kernel for ages. Just drag&drop the .uf2, run a script on your Linux system, and you will get a /dev/i2c-X device you can work with from userspace code, or attach other kernel drivers to.

The software will work with any RP2040 devboard – just connect your I2C devices to the defined pins and you’ll have them show up in i2cdetect output on your Linux workstation. As a demo, [Renze] has written a userspace Python driver for one of these SSD1306 128×64 OLEDs, and gives us a commandline that has the driver accept output of an ffmpeg command capturing your main display’s contents, duplicating your screen on the OLED – in a similar fashion that we’ve seen with the “HDMI” I2C-driven display a few months back. Everything you might need is available on the GitHub page, including usage instructions and examples, and the few scripts you can use if you want to add an udev rule or change the I2C clock frequency.

Just to name a few purposes, you can use a Pi Pico as a tool for SWD, JTAG, CAN, a logic analyser with both digital and analog channels, or even as a small EMP-driven chip glitching tool. The now-omnipresent $3 Pi Pico boards, it seems, are a serious contender to fondly remembered hacker tools of the past, such as the legendary BusPirate.

Continue reading “Need An USB-I2C Adapter? Use Your Pico!”