Screenshot of debugging the Wokwi Arduino simulator

Digging Into An ATtiny Simulator Bug With GDB

Being able to track down a bug in a mountain of source code is a skill in its own right, and it’s a hard skill to learn from a book or online tutorial. Besides the trial-by-fire of learning while debugging your own project, the next best thing is to observe someone else’s process. [Uri Shaked] has given us a great opportunity to brush up on our debugging skills, as he demonstrates how to track down and squish a bug in the Wokwi Arduino simulator.

A user was kind enough to report the bug and include the offending Arduino sketch. [Uri]’s first step was to reduce the sketch to the smallest possible program that would still produce the bug.

Once a minimal program had been produced, it was time to check whether the problem was in one of the Arduino libraries or in the Wokwi simulator. [Uri] compiled the sketch, loaded it onto a ATtiny85, and compared the behavior of the simulator and the real thing. It turns out the code ran just fine on a physical ATtiny, so the problem must have been in the Arduino simulator itself.

To track down the bug in the simulator, [Uri] decided to break out the big gun—GDB. What follows is an excellent demonstration of how to use GDB to isolate a problem by examining the source code and using breakpoints and print statements. In the end, [Uri] managed to isolate the problem to a mis-placed bit in the simulation of the timer/counter interrupt flag register.

If you’d like to see more of [Uri]’s debugging prowess, check out his dive into an ATtiny’s write protection and configuration fuses. If you’ve been wowed by the power of GDB and want to learn more, check out this quick tutorial!

Continue reading “Digging Into An ATtiny Simulator Bug With GDB”

Etch-a-sketch made with LEDs

RGB LED Matrix Helps Etch-a-Sketch Scratch Out A 21st Century Existence

We never did crack open our Etch-a-Sketch, but we did scrape out a window large enough to really check out the mechanism inside. [MrLangford] is bringing the Etch-a-Sketch into the 21st century while at the same time, bringing an even bigger air of mystery, at least for the normies.

Instead of scraping aluminum powder off of plastic by driving a stylus on an x-y gantry with a pair of knobs, this bad boy uses rotary encoders to move the cursor around and put down squares of colored light. The familiar movements are there — the left knob moves the cursor left and right, and the right knob moves it up and down. But this wouldn’t be a 21st century toy without newfangled features. Push the left encoder down and it cycles through eight color choices, or push the right one down to go through them backwards. We hope one of the colors is setting it back to darkness in case you screw up. And while we’re dreaming up improvements, it would be awesome to add an accelerometer so you could shake it clear like a standard Etch-a-Sketch.

Inside the requisite red enclosure with white knobs are an Arduino Nano and a 16×16 RGB LED matrix. The enclosure is four sheets of 6mm MDF glued together, and we like the use of protoboard to distribute GND and 5 V in the name of keeping the thing slim.

If you’re not much of an artist, here’s a TV-sized Etch-a-Sketch build that can draw by itself.

Packing Heat With A Homemade Portable Soldering Iron

Small portable soldering irons are all the rage so [electronoobs] decided to build one on his own. While the design isn’t quite as sleek as a commercial unit, considering it holds its own batteries, it looks pretty good.

Of course, the question is: does it work? You can see in the video below that it does, melting solder in about ten seconds. The weight is about 100 g, so it should be very comfortable to use.

Continue reading “Packing Heat With A Homemade Portable Soldering Iron”

DIY Handheld Game Puts Its Brains On A Removable Cart

Over the years we’ve seen plenty of homebrew handheld game systems that combine an AVR microcontroller, a few buttons, and an small OLED display. Some of them have even been turned into commercial products, such as the Arduboy. They’re simple, cheap, and with the right software, a lot of fun. But being based on an MCU, most of them share the same limitation of only being able to hold a single game at any one time.

But not the Game Card, by [Dylan Turner]. This handheld was specifically designed so that games could be easily swapped out using physical cartridges. But rather than trying to get the system’s microcontroller to boot code from an external flash chip, the system relocates the MCU to the removable cartridge. That might seem a bit overkill, but given how cheap the ATTINY84A on each cartridge is, it’s not exactly going to break the bank.

With the microcontroller on the cartridge, the only hardware that stays behind on the Game Card is the SSD1306 128×64 OLED display, buttons, and the battery. That means the handheld is effectively non-functional unless a game is slotted in, but that could be said of most early cartridge-based game systems as well. On the other hand, it also opens up the possibility of producing cartridges with more powerful microcontrollers down the line.

Using a different microcontroller for each game is a neat hack, but it’s not the only solution to the problem. We previously saw a community effort to add expandable storage to the Arduboy in the form of a DIY cartridge, which ultimately led to the development of an official flash chip upgrade for the handheld.

Continue reading “DIY Handheld Game Puts Its Brains On A Removable Cart”

Touchscreen Makes For A Neat Wavetable Synth

A popular tool in chiptune software like LSDJ allows the user to draw a waveform and use it as the basis for a wavetable synth. It’s fun and it can produce some great bleeps and bloops. [Kevin] has created a similar tool using an Arduino and a touchscreen.

You can draw the waveform! That’s neat.

The build is based on the Arduino Uno, the humble mainstay of the Arduino line. It’s hooked up to an ILI9488 color touchscreen display, which acts as the primary user interface. Using a stylus, or presumably a finger, the user can draw directly on the screen to specify the desired waveform for the synth to produce. The Arduino reads the step-by-step amplitude values of the drawn waveform and uses them to synthesize audio according to MIDI messages received over its serial port. Audio output is via PWM, as is common in low-cost microcontroller projects.

It’s a fun build and we’re sure [Kevin] learned plenty about wavetable synthesis along the way. We’ve seen his work on other Arduino synthesis projects before, too! Video after the break.

Continue reading “Touchscreen Makes For A Neat Wavetable Synth”

Arduino Finds Treasure

A beach is always a relaxing summer vacation destination, a great place to hang out with a drink and a book or take a swim in the ocean. For those who need a more active beach-going activity with an electronics twist, though, metal detecting is always a popular choice too. And, of course, with an Arduino and some know-how it’s possible to build a metal detector that has every feature you could want from even a commercial offering.

This build comes to us from [mircemk] who built this metal detector around an Arduino Nano and uses a method called induction balance detection to find metal. Similar to how radar works, one coil sends out a signal and the other listens for reflections back from metal objects underground. Building the coils and determining their resonant frequency is the most important part of this build, and once that is figured out the rest of the system can be refined and hidden treasure can easily be unearthed.

One of the more interesting features of this build is its ability to discriminate between ferrous and non-ferrous metals, and it can detect large metal objects at distances of more than 50 cm. There are improvements to come as well, since [mircemk] plans to increase power to the transmission coil which would improve the range of the device. For some of [mircemk]’s other metal detectors, be sure to check out this one which uses a smartphone to help in the metal detection process.

Continue reading “Arduino Finds Treasure”

Pinewood Derby Scale Measures CG

If you suffer from nostalgia, you might remember carving a block of wood into a car, adding some wheels, and racing it against other contestants in a pinewood derby. Today’s derby is decidedly high tech though, and we were impressed with this car scale that also figures out the car’s center of gravity.

Based on an Arduino, of course, along with a pair of HX711 load cells. Why a pair? That’s how the device measures the center of gravity is by weighing the front and rear of the car separately.

Continue reading “Pinewood Derby Scale Measures CG”