Building A Discrete 14-Bit String DAC

The discrete 14-bit DAC under test. (Credit: Sine Lab, YouTube)
The discrete 14-bit DAC under test. (Credit: Sine Lab, YouTube)

How easy is it to build your own Digital to Analog Converter (DAC)? Although you can readily purchase a wide variety of DACs these days, building your own can be very instructive, as the [Sine Lab] on YouTube explores in a recent video with the construction of a discrete 14-bit DAC. First there are the different architectures you can pick for a DAC, which range from R-2R (resistor ladder) to delta-sigma versions, each having its own level of complexity and providing different response times, accuracy and other characteristics.

The architecture that the [Sine Lab] picked was a String DAC with interpolator. The String type DAC has the advantage of having inherently monotonic output voltage and better switching-induced glitch performance than the R-2R DAC. At its core it still uses resistors and switches (transistors), with the latter summing up the input digital value. This makes adding more bits to the DAC as easy as adding more of these same resistors and switches, the only question is how many. In the case of a String DAC that’d be 2N, which implies that you want to use multiple strings, as in the above graphic.

Scaling this up to 16-bit would thus entail 65,536 resistors/switches in the naive approach, or with 2 8-bit strings 513 switches, 512 resistors and 2 buffers. In the actual design in the video both MOSFETs and 74HCT4051 multiplexers were used, which also necessitated creating two buses per string to help with the input decoding. This is the part where things get serious in the video, but the reasoning for each change and addition is explained clearly as the full 6-bit DAC with interpolator is being designed and built.

One big issue with discrete DACs comes when you have to find matching MOSFETs and similar, which is where LSI DACs are generally significantly more precise. Even so, this discrete design came pretty close to a commercial offering, which is pretty impressive.

Continue reading “Building A Discrete 14-Bit String DAC”

GNSS Reception With Clone SDR Board

We love seeing the incredible work many RF enthusiasts manage to pull off — they make it look so easy! Though RF can be tricky, it’s not quite the voodoo black art that it’s often made out to be. Many radio protocols are relatively simple and with tools like gnuradio and PocketSDR you can quickly put together a small system to receive and decode just about anything.

[Jean-Michel] wanted to learn more about GNSS and USB communication. Whenever you start a project like this, it’s a good idea to take a look around at existing projects for designs or code you can reuse, and in this case, the main RF front-end board is taken from the PocketSDR project. This is then paired with a Cypress FX2 development board, and he re-wrote almost all of the PocketSDR code so that it would compile using sdcc instead of the proprietary Keil compiler. Testing involved slowly porting the code while learning about using Python 3 to receive data over USB, and using other equipment to simulate antenna diversity (using multiple antennas to increase the signal-to-noise ratio): Continue reading “GNSS Reception With Clone SDR Board”

Hackaday Links Column Banner

Hackaday Links: November 3, 2024

“It was the best of times, it was the blurst of times?” Perhaps not anymore, if this Ig Nobel-worthy analysis of the infinite monkey theorem is to be believed. For the uninitiated, the idea is that if you had an infinite number of monkeys randomly typing on an infinite number of keyboards, eventually the complete works of Shakespeare or some other famous writer would appear. It’s always been meant to be taken figuratively as a demonstration of the power of time and randomness, but some people just can’t leave well enough alone. The research, which we hope was undertaken with tongue firmly planted in cheek, reveals that it would take longer than the amount of time left before the heat death of the universe for either a single monkey or even all 200,000 chimpanzees in the world today to type the 884,647 words of Shakespeare’s complete works in the proper order.

Continue reading “Hackaday Links: November 3, 2024”

All You Need For Artificial Intelligence Is A Commodore 64

Artificial intelligence has always been around us, with [Timothy J. O’Malley]’s 1985 book on AI projects for the Commodore 64 being one example of this. With AI defined as being the theory and development of systems that can perform tasks that normally requiring human intelligence (e.g. visual perception, speech recognition, decision-making), this book is a good introduction to the many ways that computer systems for decades now have been able to learn, make decisions and in general become more human-like. Even if there’s no electronic personality behind the actions.

In the book’s first chapter, [Timothy] isn’t afraid to toss in some opinions about the true nature of intelligence and thinking. Starting with the concept that intelligence is based around storing information and being able to derive meaning from connections between stored pieces of information, the idea of a basic AI as one would use in a game for the computer opponent arises. A number of ways of implementing such an AI is explored in the first and subsequent chapters, using Towers of Hanoi, chess, Nim and other games.

After this we look at natural language processing – referencing ELIZA as an example – followed by heuristics, pattern recognition and AI for robotics. Although much of this may seem outdated in this modern age of LLMs and neural networks, it’s important to realize that much of what we consider ‘bleeding edge’ today has its roots in AI research performed in the 1950s and 1960s. As [Timothy] rightfully states in the final chapter, there is no real limit to how far you can push this type of AI as long as you have more hardware and storage to throw at the problem. This is where we now got datacenters full of GPU-equipped systems churning through vector space calculations for the sake of today’s LLM & diffusion model take on ‘AI’.

Using a Commodore 64 to demonstrate the (lack of) validity of claims is not a new one, with recently a group of researchers using one of these breadbin marvels to run an Ising model with a tensor network and outperforming IBM’s quantum processor. As they say, just because it’s new and shiny doesn’t necessarily mean that it is actually better.

Man holding brass bar stock with several polygons turned on end

Polygons On A Lathe

Most professionals would put a polygon on the end of a turned part using a milling machine. But many a hobbyist doesn’t have a mill. And if the polygon needs to be accurately centered, remounting the stock costs accuracy.

[Mehamozg] demonstrates you can turn a polygon on a lathe.

Polygons on shaft ends are surprisingly common, whether you are replacing a lost chuck key, need an angular index, or need a dismountable drive. As the video shows, you can definitely make them on the lathe.

But how the heck does this work? It seems like magic.

Lets start by imagining we disengage and lock the rotating cutter in [Mehamozg]’s setup and run the lathe. If the tool is pointed directly at the center we are just turning normally.  If we angle the tool either side of center we still get a cylinder, but the radius increases by the sin of the angle.

Now, if we take a piece of stock with a flat on it and plot radius versus angle we get a flat line with a sin curve dip in it. So if we use [Mehamozg]s setup and run the cutter and chuck at the same speed, the cutter angle and the stock angle increase at the same time, and we end up with a flat on the part.  If the cutter is rotating an even multiple of the chuck speed, we get a polygon.

The rub in all this is the cutter angle.. At first we were convinced it was varying enormously. But the surface at the contact point is not perpendicular to  the radius from center to contact. So it cancels out, we think.  But our brains are a bit fried by this one. Opinions in the comments welcomed.

We like this hack. It’s for a commonly needed operation, and versatile enough  to be worth fiddling with the inevitable pain of doing it the first time.  For a much more specialized machining hack, check out  this tool that works much the same in the other axis.

Oscillator Needs Fine-Tuning

Since their invention more than a century ago, crystal oscillators have been foundational to electronic design. They allow for precise timekeeping for the clocks in computers as well as on our wrists, and can do it extremely accurately and inexpensively to boot. They aren’t without their downsides though; a quartz watch might lose or gain a few seconds a month due to variations in temperature and other non-ideal environmental situations, but for working in the world of high-frequency circuits this error is unacceptable. For that you might reach for something like an oven oscillator, a circuit with a temperature controlled chamber able to keep incredibly precise time.

[IMSAI Guy] found this 10 MHz oven oscillator on a site selling bulk electronics at bargain basement prices. But as is unsurprising for anyone who’s used a site like this to get cheap circuits, it didn’t quite hit its advertised frequency of 10.000000 MHz. The circuit design is capable of this amount of accuracy and precision, though, thanks to some cleverly-designed voltage dividers and filtering. One of those voltage dividers allows a potentiometer to control a very narrow range of output frequencies, and from the factory it was outputting between 9.999981 and 9.9999996 MHz. To get it to actually output a 10 MHz wave with eight significant digits of accuracy, a pull-up resistor on the voltage divider needed to be swapped out.

While this was a fairly simple fix, one might wonder how an off-the-shelf component like this would miss the mark in such an obvious way but still go into production. But that’s one of life’s great mysteries and also the fun of sourcing components like this. In this case, the oven oscillator was less than $10. But these circuits aren’t always as good of a deal as they seem.

Continue reading “Oscillator Needs Fine-Tuning”

M.2 Makes An Unusual Microcontroller Form Factor

When we think of an m.2 slot in our laptop or similar, it’s usually in the context of its PCI connectivity for high-speed applications such as solid state disks. It’s a connector that offers much more than that interface though, making it suitable for some unexpected add-ons. As an example [MagicWolfi] has produced an m.2 card which contains the equivalent of a Raspberry Pi Pico.

The board itself has the familiar m.2 edge connector at the bottom, and the RP2040 GPIO lines as postage-stamp indentations round the edges. On the m.2 front is uses the USB interface as well as a UART and the I2C lines, as well as some of the interfaces we’re less familiar with such as ALERT, WAKE, DISABLE1/2, LED 1/2, and VENDOR_DEFINED.

On one level this provides a handy internal microcontroller card with which you can do all the things you’d expect from a Pi Pico, but on another it provides the fascinating possibility of the Pico performing a watchdog or other function for the host device. We would be genuinely interested to hear more about the use of the m.2 slot in this way.

If you’d like to know more about m.2, we’ve taken a look at it in more depth.