No DAC? Try PDM

Ever notice that the ESP32-S3 doesn’t have a digital-to-analog converter? [Chris] did and asserts that he doesn’t care because he can just use the PDM system to get the same result. PDM — pulse density modulation — is similar to PWM and, like PWM, requires a filter that could range from a simple RC network to an active filter. You can see the result in the video below.

There are several ways [Chris] could produce the output he wanted. PWM was one choice, and some example code uses a timer to do PDM. However, that is not very efficient. The other alternative is to use the I2S output. However, this does require a few workarounds.

In particular, the I2S output is always stereo and incorporates a clock output that isn’t needed for this application. [Chris] simply output the same value on both channels and routed the clock to some pins that are normally used for startup options. That means they can’t easily be used for your own inputs, but it’s OK to use them for unimportant outputs.

We always enjoy seeing solutions like this because it can give you ideas for use in your own projects. Of course, this won’t apply to every project where you need a DAC, but it still might give you some ideas.

We have looked at PDM before. You could, too, build your own DAC hardware.

Continue reading “No DAC? Try PDM”

Pinball With No Computers

Pinball machines were the video games of their day. Back when they were king, there were no microcontrollers — everything was electromechanical. We know from experience that fixing these was difficult but we imagine that designing complex play behavior with a bunch of motors, relays, clutches, contacts, and more would have been excruciatingly difficult. [Technology Connections] has several videos about an old Aztec machine and he promises more to come. You can watch the first two below.

To give you an idea of what’s involved, imagine a very simple pinball machine that supports a single player and a handful of targets. When the ball hits a target, that could trigger a micro-switch. The switch closure could trigger a relay that closes a contact for a short period of time. That contact energizes a solenoid that advances the score wheels. So now, when a ball hits a target, the score wheel will spin enough to award ten points. To make sure there is enough time for the score to advance, the relay uses something like a mechanical flip flop.

Sound complicated? That’s nothing. Don’t forget, the machine also has to reset the score at the start of the game, count the ball in play, and end the game when the last ball returns. Then consider a real game. There will be multiple players and fancy sequences (e.g., hit the red target three times to award double scores for other targets).

While we knew a fair bit about the design of pinball machines already, we did learn a lot about their history and where the idea came from. The video also explains why it is called pinball since modern machines don’t really have pins — these were like relay-based computers with strange electromagnetic I/O devices.

While pinball machines were the best example of this sort of thing, there were also things like bowling machines and ladder-logic industrial control systems. We’ve even seen an electromechanical phone answering machine.

Continue reading “Pinball With No Computers”

You Wouldn’t 3D Print A Toilet…

[Emily The Engineer] wanted a 3D printing project, so naturally, she decided to print a working toilet. Check out the colorful contraption in the video below. At the start, we thought making it watertight might be a bit difficult, which proved to be a problem. However, some careful work with sealing and soldering irons did allow her to make a working flushable toilet.

Mercifully, we don’t get to see the device in actual use, and, as far as we can tell, she never actually connected it to the plumbing in her home. But it did fill from a garden hose, shut itself off, and flush 3D printer waste, toilet paper, and other material out of its drain. It doesn’t appear that the designs have been made public, but since something of this size would likely take hundreds of print hours to complete, we aren’t sure anyone would really want to do this anyway.

However, some of the techniques might come in handy if you are working on something that has to handle water. If you do replicate this for actual use, consider that many 3D printed plastics aren’t considered food-safe because you can’t adequately clean the little ridges from the layer lines. If you were really using this for its intended purpose, cleaning would be a high priority.

Towards the end, the over-engineering bug hit, and you get to see an add-on bidet, armrests, and even mobile casters. A fun project, even if a bit impractical. As an art installation, though, we’ve definitely seen worse.

A mobile toilet is a unique idea, right? Um — maybe not. If [Emily] does a second version, we’d suggest making the TP roll holder heated.

Continue reading “You Wouldn’t 3D Print A Toilet…”

Peltier Mini Fridge For Class By Class

How do you keep a few sodas in your classroom cool? Well, if you are teacher [Ethan Hunt], you have your students design and build a solid-state mini refrigerator that can beat his prototype fridge. The prototype uses a Peltier effect module to get three cans down to 11 C (52 F), with a final goal of reaching 5 C (41 F). It’s not all fun and games either — [Ethan] provides a suggested lesson plan with a total of thirteen modules made to fit in an hour each.

Peltier effect modules, also known as solid-state heat pumps, used to be exotic tech but are now quite common. They are actually the reverse of the Kelvin effect. Thermocouples exploit the Kelvin effect by measuring current flowing due to temperature differences.

Solid-state heat pumps use current flowing to create a comparable temperature difference. However, that’s also the catch. One side of the heat pump gets cold, but the other side gets equally hot. That heat has to go somewhere. The same is true, of course, of a “real” refrigerator or an air conditioner.

The lessons would be perfect to adapt for a class, a kid’s club, or even homeschooling. We’d love to see what your students build. You probably won’t be making liquid nitrogen with this setup. But we have seen more than one mini-fridge.

Your Home Mainframe

We miss the days when computers looked like computers. You know, blinking lights, rows of switches, and cryptic displays. [Phil Tipping] must miss those days too since he built PlasMa, a “mini-mainframe simulator.”

The device would look at home on the set of any old science fiction movie. Externally, it has 540 LEDs, 100 switches, and a number of other I/O devices, including a keypad and an LCD screen. Internally, it can support three different instruction sets. Everything is run by an ATmega2560, and it has simulated paper tape, magnetic tape, and disks (all via SD cards). The magnetic tapes also have LED simulated reels to show the tape position and other status information (the round displays just above the LCD display).

Continue reading “Your Home Mainframe”

Copper Coating 3D Prints

We would all like to 3D print in metal, but for now, the equipment to do that is out of reach for most of us. Instead of dealing with powder printers or metal-bearing polymers, [Robert] has a simple solution. Using a process known as mechanical plating or peen plating, he deposits a layer of copper on a PLA print. The results look good, as you can see in the video below.

This isn’t electroplating, although the result is similar. With electroplating, you have to make the 3D part conductive. You also have to deal with wet chemistry and fumes. This process uses a rock tumbler, copper powder, and small ball bearings.

Continue reading “Copper Coating 3D Prints”

Linux Fu: Preprocessing Beyond Code

If you glanced at the title and thought, “I don’t care — I don’t write C code,” then hang on a minute. While it is true that C has a preprocessor and you can notoriously do strange and — depending on your point of view — horrible or wonderful things with it, there are actually other options and you don’t have to use any of them with a C program. You can actually use the C preprocessor with almost any kind of text file. And it’s not the only preprocessor you can abuse this way. For example, the m4 preprocessor is wildly complex, vastly underused, and can handle C source code or anything else you care to send to it.

Definitions

I’ll define a preprocessor as a program that transforms its input file into an output file, reacting to commands that are probably embedded in the file itself. Most often, that output is then sent to some other program to do the “real” work. That covers cpp, the C preprocessor. It also covers things like sed. Honestly, you can easily create custom preprocessors using C, awk, Python, Perl, or any other programming language. There are many other standard programs that you could think of as preprocessors, for example, tr. However, one of the most powerful is made to preprocess complex input files called m4. For some reason — maybe because of its complexity — you don’t see much m4 in the wild.

Continue reading “Linux Fu: Preprocessing Beyond Code”