Vista Normal

Hay nuevos artículos disponibles. Pincha para refrescar la página.
AnteayerSalida Principal

Button Debouncing With Smart Interrupts

4 Enero 2025 at 12:00

Debouncing button or switch inputs on microcontrollers can be a challenging problem for those first starting to program these devices. Part of the reason for this difficulty is that real-world buttons don’t behave like the idealized textbook components we first learn about, and therefore need special consideration to operate like one would expect. There are simple ways to debounce inputs like adding a delay after a button is pressed, but for more efficient use of computer resources as well as adding some other capabilities to inputs you might want to look at this interrupt service routine (ISR) method from [Lee] aka [stockvu].

The strategy with this debounce method is not simply to use a single ISR for the button input, but to activate a second timer-based ISR at that time that runs at a certain interval which timestamps any button press and checks the amount of time the button has been active. If it’s under a certain threshold the ISR assumes it’s caused by bounce and blocks the bounce. If the timestamp ages past another longer threshold it knows the button has been released. This method allows on-the-fly adaptation between long button presses and rapid button presses and is capable of debouncing both types.

For those wanting to try this out, [stockyu] has included some example Arduino code for others to use. It’s an interesting take on a solution for a common problem, and puts very little load on the microcontroller. There are about as many ways to debounce inputs as there are microcontroller platforms, though, and you can even use a 555 timer to get this job done which frees up 100% of the microcontroller’s CPU.

Landing Soon: This Beautiful Weather Display

3 Enero 2025 at 21:00
Front and rear views of a lander circuit sculpture that retrieves weather data and displays it on a screen.

All wiring is beautiful, except when it isn’t. But is there anything more lovely to behold than circuit sculpture? Once again, [Mohit Bhoite] has made this process look easy like Sunday morning. This time, he’s created a weather display in the form of a lander.

Drawings that will guide wire-bending for a circuit-sculpture, lunar-lander weather info center.This lander runs on the Particle Photon 2, which connects over Wi-Fi and retrieves the weather forecast for the day, along with sunrise and sunset times and wind conditions. Everything is beautifully displayed on a vertically-oriented Adafruit 170×320 TFT screen.

There’s also a pulse-density microphone (PDM) breakout board and a buzzer, and the build is capped off with a red 0805 LED. We’re not sure what the feet are made of, but they sure make this lander cute (and accurate).

All the project logs are picture-rich, which is really the most we could ask for when trying to imitate this level of greatness. This is apparently an ongoing project, and we’re excited for the end result, although it looks fairly complete from here.

Do you want to bend it like Bhoite? Then be sure to check out his Hackaday Supercon talk on the subject.

Pico Pal Puts RP2350 Into Game Boy Color Shell

Por: Tom Nardi
3 Enero 2025 at 09:00

While modern gaming systems deliver ever more realistic experiences, there’s still something to be said for the consoles and handhelds of the 80s and 90s. For many, the appeal is nostalgic. Others are attracted to the “lo-fi” graphical and sound design of these games, necessitated by the limited hardware of the time.

That said nobody would claim those old systems were perfect. Which is why a hybrid approach like [Peter Khouly] has been working on with the Pico Pal might be the ultimate solution. This replacement motherboard for the Game Boy Color (GBC) is powered by the RP2350, meaning the external hardware will have the same look and feel as it did back in 1998, but you’ll still be able to reap the benefits of modern emulation.

While the origins of the project go a bit farther, [Peter] has been working on this particular variation of the Pico Pal GBC since August, and has kept a fascinating log of his progress. Just getting the RP2350 to emulate Pokémon isn’t really that big of a deal, but getting all the ancillary hardware implemented and fitted inside the case of the GBC is a different story. Especially since [Peter] intends to pack plenty of features into the final product, such as rechargable batteries, Bluetooth audio, real-time clock support, and digital video out.

The most recent status update is from just last week, where [Peter] goes over some of the new features he’s been working on. A major one is the soft power solution, where the physical power switch doesn’t just pull the plug like it did back in the 1990s. Instead, the switch triggers the board to save the game and enter into a low-power mode so that it can come right back on to where you left off. This does impact battery life, but so far, it looks like the Pico Pal GBC will be able to run for at least five hours on a charge, and more than twice that if you don’t mind turning off the audio.

It sounds like there’s still several gremlins to track down in the design, but even in its current state, the Pico Pal GBC looks very interesting. We’re immediately reminded of the phenomenal work [Bucket Mouse] has put in on a similar refit for the original DMG-1 Game Boy.

vPlayer Puts Smart Display in Palm of Your Hand

Por: Tom Nardi
31 Diciembre 2024 at 12:00

It’s not something we always think about, but the reality is that many of the affordable electronic components we enjoy today are only available to us because they’re surplus parts intended for commercial applications. The only reason you can pick up something like a temperature sensor for literal pennies is because somebody decided to produce millions of them for inclusion in various consumer doodads, and you just happened to luck out.

The vPlayer, from [Kevin Darrah] is a perfect example. Combining a 1.69 inch touch screen intended for smartwatches with the ESP32-S3, the vPlayer is a programmable network-connected display that can show…well, pretty much anything you want, within reason. As demonstrated in the video below, applications range from showing your computer’s system stats to pulling in live images and videos from the Internet.

With an ESP32 at its heart, you can obviously program the vPlayer to do your bidding just like any other development board based on the chip. But to speed things along, [Kevin] is providing demo code to accomplish several common enough tasks that there’s a good chance he’s already got your use case covered.

Out of the box it will play videos stored on the SD card, though you’ll first have to run them through ffmpeg to get the format right. There’s also code written to have the vPlayer act as a weather display, or pull down data and images from public APIs.

The vPlayer is intended to be powered via the USB-C connection, but the VUSB and 3.3 V pins from the ESP32 are broken out on the back should you want to inject power that way. Just be warned, the documentation notes that doing so while plugged into USB may release the Magic Smoke. [Kevin] has also provided a 3D model of the vPlayer and its stock case, should you want to design your own 3D printed enclosure.

Admittedly, there’s nothing exactly groundbreaking about the vPlayer. You could easily roll your own version with existing modules. But as enjoyable as it can be to come up with your own solutions, there’s something to be said for this sort of polished, turn-key experience.

Thanks to [LegoManACM] for the tip.

38C3: Xobs on Hardware Debuggers

29 Diciembre 2024 at 18:00

If you just want to use a debugger for your microcontroller project, you buy some hardware device, download the relevant driver software, and fire up GDB. But if you want to make a hardware debugger yourself, you need to understand the various target chips’ debugging protocols, and then you’re deep in the weeds. But never fear, Sean [Xobs] Cross has been working on a hardware debugger and is here to share his learnings about the ARM, RISC-V, and JTAG debugging protocols with us.

He starts off with a list of everything you need the debugger hardware to be able to do: peek and poke memory, read and write to the CPU registers, and control the CPU’s execution state. With that simple list of goals, he then goes through how to do it for each of the target chip families. We especially liked [Xobs]’s treatment of the JTAG state machine, which looks pretty complicated on paper, but in the end, you only need to get it in and out of the shift-dr and shift-ir states.

This is a deep talk for sure, but if you’re ever in the throes of building a microcontroller programmer or debugger, it provides a much-appreciated roadmap to doing so.

And once you’ve got your hardware setup, maybe it’s time to dig into GDB? We’ve got you covered.

38C3: Towards an Open WiFi MAC Stack on ESP32

28 Diciembre 2024 at 21:00

At the 38th Chaos Communications Congress, [Frostie314159] and [Jasper Devreker] gave us a nice update on their project to write an open-source WiFi stack for the ESP32. If you’re interested in the ESP32 or WiFi in general, they’ve also got a nice deep dive into how that all works.

On the ESP32, there’s a radio, demodulator, and a media access controller (MAC) that takes care of the lowest-level, timing-critical bits of the WiFi protocol. The firmware that drives the MAC hardware is a licensed blob, and while the API or this blob is well documented — that’s how we all write software that uses WiFi after all — it’s limited in what it lets us do. If the MAC driver firmware were more flexible, we could do a lot more with the WiFi, from AirDrop clones to custom mesh modes.

The talk starts with [Jasper] detailing how he reverse engineered a lot of Espressif’s MAC firmware. It involved Ghidra, a Faraday cage, and a lucky find of the function names in the blob. [Frostie] then got to work writing the MAC driver that he calls Ferris-on-Air. Right now, it’s limited to normal old station mode, but it’s definite proof that this line of work can bear fruit.

This is clearly work in progress — they’ve only been at this for about a year now — but we’ll be keeping our eyes on it. The promise of the ESP32, and its related family of chips, being useful as a more general purpose WiFi hacking tool is huge.

Holiday Jukebox Gets ESP32, Home Assistant Support

Por: Tom Nardi
25 Diciembre 2024 at 00:00

If we’ve learned anything over the years, it’s that the only thing hardware hackers love more than a device festooned with buttons is one that’s covered in LEDs — so it’s no surprise that this “Mr Christmas” jukebox caught the eye of [Roberts Retro]. But while the holiday gadget might have been mildly entertaining in its stock configuration, he quickly realized that what it really needed was an ESP32 retrofit. After all, what good are all those buttons and LEDs if you can’t bend them to your will?

For the first half of the video, [Robert] treats us to a detailed teardown of the device, which as you might imagine, is largely hollow inside. This gave him plenty of room to graft in new hardware, which is really the best gift any of us could hope to find under the tree. In addition to the ESP32 development board, the jukebox also received a number of WS2812B addressable RGB LEDs, and a DFPlayer module to handle music playback.

With all the buttons wired up to inputs on the ESP32, [Robert] can reconfigure the jukebox to do pretty much whatever he wants with just changes to the software. In the video, he demonstrates how the buttons can be used to trigger the playback of individual songs stored on the DFPlayer’s SD card, which essentially replicates it’s stock functionality. A few lines of changed code later, those same buttons can be used to control devices via Home Assistant.

To get into the holiday spirit, [Roberts Retro] shows off the completed jukebox controlling his ESP-enabled LEGO train set — another of his festive upgrades that we covered back in 2022.

An LCD, Touch Sensor, USB-C, And A Microcontroller for a Buck

Por: Lewin Day
22 Diciembre 2024 at 00:00

[CNLohr] has been tinkering with some fun parts of late. He’d found out that ordinary LCD screens could be used as simple touch sensors, and he had to try it for himself. He ended up building a little doohickey that combined USB C, an LCD display, and a touch interface, all for under a buck. You can check out the video below.

The key to this build was the CH32V003 CPU. It’s a RISC-V microcontroller that runs at a healthy 48 MHz, and it costs just 10 cents in reasonable quantities. A PCB etched to mate with a USB C cable eliminates the need for a connector.

[CNLohr] then gave the board a three-digit 7-segment LCD display from Aliexpress, which can be had for around 21 cents if you buy 100 or more. He then figured out how to drive the LCDs with a nifty trick that let the microcontroller use the display as a crude touch sensor. All in all, the total bill of materials for one of these things comes out somewhere under a dollar in quantity.

It’s mostly a random assemblage of tech glued together for a demo, but it’s a fun project. It’s worth checking out even if it’s just to learn how to create an integral USB C port on your own PCBs. The way it’s achieved with the etched contacts and milled-out tabs is pure elegance. Files are on Github for the curious.

We’ve featured a ton of [CNLohr’s] work over the years; the clear keytar was a glowing highlight, as were his early discoveries in the depths of the ESP8266.

Rudolph’s Sleigh on a North Pole PCB

21 Diciembre 2024 at 00:00
pcb with santa sleigh racing circuit

Each Christmas, [Adam Anderson], [Daniel Quach], and [Johan Wheeler] (going by ‘the Janky Jingle Crew’)—set themselves the challenge of outdoing their previous creations. Last year’s CH32 Fireplace brought an animated LED fire to life with CH32V003 microcontrollers.

This year, they’ve gone a step further with the North Pole Circuit, a holiday project that combines magnetic propulsion, festive decorations, and a bit of engineering flair. Inspired by a miniature speedway based on Friedrich Gauss’ findings, the North Pole Circuit includes sleighs and reindeer that glide along a custom PCB track, a glowing village with flickering lights, and a buzzer to play Christmas tunes.

The propulsion system works using the Lorentz force, where vertical magnets interact with PCB traces to produce motion. A two-phase design, similar to a stepper motor, ensures smooth operation, while guard rails maintain stability on curves. A separate CH32V003 handles lighting and synchronized jingles, creating a cohesive festive display. As we mentioned in the article on their last year’s creation, going from a one-off to a full batch will make one rethink the joy of repetitive production. Consider the recipients of these tiny Christmas cards quite the lucky ones. We deem this little gift a keeper to put on display when Christmas rolls around again.

This annual tradition highlights the Crew’s knack for combining fun and engineering. Curious about the details or feeling inspired to create your own? Explore the full details and files on their GitHub.

Back to the Future of Texting: SMS on a Panasonic Typewriter

19 Diciembre 2024 at 06:00
Close up of a typewriter annex SMS-receiver

Among us Hackaday writers, there are quite a few enthusiasts for retro artifacts – and it gets even better when they’re combined in an unusual way. So, when we get a tip about a build like this by [Sam Christy], our hands sure start itching.

The story of this texting typewriter is one that beautifully blends nostalgia and modern technology. [Sam], an engineering teacher, transformed a Panasonic T36 typewriter into a device that can receive SMS messages, print them out, and even display the sender’s name and timestamp. For enthusiasts of retro gadgets, this creation bridges the gap between analog charm and digital convenience.

What makes [Sam]’s hack particularly exciting is its adaptability. By effectively replacing the original keyboard with an ESP32 microcontroller, he designed the setup to work with almost any electric typewriter. The project involves I2C communication, multiplexer circuits, and SMS management via Twilio. The paper feed uses an “infinite” roll of typing paper—something [Sam] humorously notes as outlasting magnetic tape for storage longevity.

Beyond receiving messages, [Sam] is working on features like replying to texts directly from the typewriter. For those still familiar with the art form of typing on a typewriter: how would you elegantly combine these old machines with modern technology? While you’re thinking, don’t overlook part two, which gives a deeper insight in the software behind this marvel!

Personal Traffic Light Stops Them In Their Tracks

14 Diciembre 2024 at 09:00
A small mood/busy indicator attached to a laptop.

Working from home can be pretty cool, but if you’re not the only one in the house trying to do it, the whole situation can feel like you’re right back in the office with all those walking, talking distractions. Except they’re in pajamas instead of business casual.

The parts needed to build this mood indicator.So, what’s the answer? Many times it’s not practical to stop what you’re doing, especially just to communicate that you’re busy. We suppose you could glare at them, put up your hand, or even give a dismissive wave, but a better solution might be this mood signal built by [gokux].

Through a simple web app, you can be red to indicate that you’re super busy, yellow to mean busy-ish, and green for let’s gossip about the cats.

This mood indicator is built on the Seeed Xiao ESP32-C3 and shows the given mood indicator on a small matrix of sixteen WS2812B LEDs. It’s powered by a 600 mAh, 3.7 V battery and a small push button switch. As usual, [gokux] has grade-A instructions for building your own version of this slick solution.

Would you like something more tactile and low-tech? Check out our own [Bob Baddeley]’s free/busy indicator from the lockdown days.

❌
❌