An ebike motor with the controller cover removed. A number of wires and connectors take up most of the space in the cavity.

Open Brain Surgery For EBikes And EScooters

Personal Electric Vehicles (PEVs) all contain the same basic set of parts: a motor, a battery, a motor controller, some sensors, and a display to parse the information. This simplicity allowed [casainho] to develop a custom controller setup for their own PEVs.

Built around the venerable VESC motor controller, [casainho]’s addition is the EBike/EScooter board that interfaces the existing motor of a device to the controller. Their ESP32-powered CircuitPython solution takes the sensor output of a given bike or scooter (throttle, cadence, or torque) and translates it into the inputs the controller uses to set the motor power.

They’ve also designed an ESP32-based display to interface the rest of the system to the user while riding. Since it also runs CircuitPython, it’s easy to reconfigure the functions of the three button device to display whatever you’d like as well as change various drive modes of your system. I know I’d love to see my own ebikes have a different mode for riding on road versus on shared paths since not getting run over by cars and not harassing pedestrians aren’t going to have the same power profile.

If you want to find more ways to join the PEV revolution, check out this wild omni-wheeled bike or this solar car built from two separate e-bikes. If that doesn’t suit your fancy, how about an off-label use for an e-bike battery to power your laptop off grid?

The Past, Present, And Future Of CircuitPython

Modern microcontrollers like the RP2040 and ESP32 are truly a marvels of engineering. For literal pocket change you can get a chip that’s got a multi-core processor running at hundreds of megahertz, plenty of RAM, and more often than not, some form of wireless connectivity. Their capabilities have been nothing short of revolutionary for the DIY crowd — on any given day, you can see projects on these pages which simply wouldn’t have been possible back when the 8-bit Arduino was all most folks had access to.

Limor Fried

Thanks to the increased performance of these MCUs, hackers and makers now even have a choice as to which programming language they want to use. While C is still the language of choice for processor-intensive tasks, for many applications, Python is now a viable option on a wide range of hardware.

This provides a far less intimidating experience for newcomers, not just because the language is more forgiving, but because it does away with the traditional compile-flash-pray workflow. Of course, that doesn’t mean the more experienced MCU wranglers aren’t invited to the party; they might just have to broaden their horizons a bit.

To learn more about this interesting paradigm shift, we invited the fine folks at Adafruit to the Hack Chat so the community could get a chance to ask questions about CircuitPython, their in-house Python variant which today runs on more than 400 devices.

Continue reading “The Past, Present, And Future Of CircuitPython”

An E-Ink Progress Bar For Your Unborn Child

Having a child is a major milestone in a person’s life, and there’s a long list of things to get done before that little bundle of joy kicks and screams its way into the world. What better way to make sure you’ve still got time to paint the nursery and assemble the crib than to have an automated loading screen that shows just how far along the organic 3D printing process is?

This fetal development tracker was put together by [mokas] using Adafruit’s ESP32-S2 powered MagTag. As the name implies, the all-in-one electronic ink development board is designed so that it can be adhered to a metallic surface with integrated magnets. The idea is that you can pop a battery in the low-power device, stick it on your refrigerator, and have a regularly updated display of…well, whatever you want. Continue reading “An E-Ink Progress Bar For Your Unborn Child”

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”

The new PewPew with an LCD showing some patterns, being held in someone's hand.

Hackaday Prize 2022: PewPew LCD Plays With Python

[deshipu] aka [Radomir Dopieralski] has been building educational handhelds for a good part of a decade now, and knows how to design hardware that makes for effective teaching. Today, we are graced with the PewPew LCD project, latest in the PewPew student-friendly handheld series, powered by CircuitPython.

The PewPew LCD from the other side, showing the simple PCB-built-in CR2032 battery holderThe goal for all of these devices has been consistent — making game programming accessible and fun. This time, as an entry in the Reuse, Recycle, Revamp round of Hackaday Prize, the new PewPew receives an upgrade – from an 8×8 LED matrix to an LCD display. This might not sound like much, but the change of display technology itself isn’t the main point. [deshipu] is working on ways to bring down the price and assembly complexity of PewPew handhelds, and he’s found there’s plenty of old stock RH-112 displays, previously used on cellphones like Nokia 1202, which these days go for as little as $1.30 a piece.

It’s exceptionally simple to get into writing games for the PewPew – one of the reasons why it’s a strong platform for workshops and individual learning. There’s already a slew of games and tutorials, and we can’t wait to see all the cool games people can build when given all the extra pixels! And, of course, we appreciate setting an example for giving new life to old displays – displays that’d otherwise inevitably end up in a trash container behind a warehouse in China.

The Reuse, Recycle, Revamp Hackaday Prize 2022 round is going on for two more weeks. If you’re making good use of something that would otherwise be discarded, please do share it with us, so that we can all learn and draw inspiration from your projects!

Daft Punk Word Clock Goes Stronger And Faster

What would you call a word clock that doesn’t tell time? The concept of a word clock is that all the words needed to be used are already there and then just selected. [Ben Combee] realized there were only 18 unique words to make up the song “Harder Faster Better Stronger” and with an extra PyBadge from Supercon 2021 on hand, it seems obvious to make a musical word clock of sorts.

The PyBadge is a 120 MHz ATSAMD51 based board with a screen, buttons, and a case that he 3d printed. To get reasonable sound quality while still fitting with the 2MB of flash storage on the device, MP3 compression was chosen. Since there was only one speaker, it was mixed down to mono and a lower bitrate, getting the size down to just 880KB. The mp3 is processed by the audiomp3 module in circuitpython with the volume level being sent to five NeoPixels to act as a VU. Getting the timing correct was the hardest part as the lyrics needed to be separated out and the timing figured out. Using Audacity’s label track feature, he had all the words tagged in the track and could export it into a format that could be massaged into a python friendly format.

The music and the text cues becoming desynchronized became a larger issue as the file plays. Increasing the MP3 buffer helped but the real trick was to peek inside the music decoder and figure out how many samples had been decoded and cue the words based on that, rather than the time since it wasn’t as accurate. All the code and files are up on his Hackaday.io page if you feel the need to make your own. If you’re sticking with Daft Punk, make sure to have your helmet ready when you rock. Though based on this summary of the compressibility of pop songs, there are a few other songs with a small enough number of unique words that they too could get the word clock treatment. Video after the break.

Continue reading “Daft Punk Word Clock Goes Stronger And Faster”

Winamp Reborn With The Adafruit PyPortal

One look at the default Winamp skin is sure to reawaken fond memories for a certain segment of the community. For those who experienced the MP3 revolution first hand, few audio players stick out in the mind like Winamp and its llama whipping reputation. No, the proprietary Windows-only media player isn’t the sort of thing you’d catch us recommending these days; but it was the 1990s, and things were very different.

For those who want to relive those heady peer-to-peer days, [Tim C] has posted a tutorial on how to turn Adafruit’s PyPortal into a touch screen MP3 player that faithfully recreates the classic Winamp look. As you can see in the video below it certainly nails the visuals, down to the slightly jerky scrolling of the green track info which we’re only now realizing was probably the developer’s attempt to mimic some kind of a physical display like a VFD.

With minimal UI functionality, playlists must be created manually.

[Tim] has even included support for original Winamp themes, although as you might expect, some hoop-jumping is required. In this case, it’s a Python script that you have to run against an image of the original skin pulled from the Winamp Skin Museum. From there, you just need to edit a couple of lines of code to point the player at the right skin files. In other words, switching between skins is kind of a hassle, but you should at least be able to get your favorite flavor from back in the day up and running.

But before you get too excited, there’s a bit of a catch. For one thing, the Winamp UI isn’t actually functional. You can tap the top section of the screen to pause the playback, and tapping down in the lower playlist area lets you change songs, but all the individual buttons and that iconic visual equalizer are just for show. Managing your playlists also requires you to manually edit a JSON file, which even in the 1990s we would have thought was pretty wack, to use the parlance of the times.

Of course, things could easily be streamlined a bit with further revisions to the code, and since [Tim] has released it into the public domain under the Unlicense, anyone can help out. As it stands, it’s still a very slick media display that we certainly wouldn’t mind having on our desk.

Continue reading “Winamp Reborn With The Adafruit PyPortal”