Introduction: Homemade DAC A/D Converter
Various micro controllers come with built in A/D converters (these are the more pricy ones) and I have yet to see one with a DAC. I though of a relatively cost effective solution once again with easily acquired components (Radio Shack). It can effortlessly be expanded to limitless bits of resolution (though I only used three and show to six). This circuit uses only as many transistors as bits of resolution (NPN or PNP) and (If you can find the right values) possibly as few resistors (I used 150Ω 330Ω and 680Ω, better values would be 150, 300, and 600 made from 150’s in series I will show it later) Only one very common IC an LM741 but any op amp or better yet comparator would work. The second picture is of a more traditional A/D converter and the third a commercial DAC
Step 1: Building the Circuit
This circuit has an incredibly easy layout and I deliberately designed it that way for an easy PCB layout. The transistor simply shorts the resistor. The stages are in series I tried parallel at first it worked but was very difficult to get linear, then the duh moment, series circuits add and adding is linear. In the second picture I used a DIP switch to verify it was working. It is a really straightforward build. It also requires no calibrating or reference voltage, but the control system must know the voltage and stages for the equation. V(measure) = ( V(total) / 2^bits )* binary out(in decimal)
Step 2: Further Building
While building you should choose NPN or PNP transistors (I think PNP work better even though I used NPN) The first picture is a single stage, the top NPN bottom PNP. The second shows a 6 bit cascade for 8 times the resolution of a 3 bit ! In the third picture it shows how to use a single value of resistor to make the cascade and any value will work as long as you use 1 2 4 8 16 ect. resistors. This is even more accurate then using predetermined decade values. (see curve later).
Step 3: How It Works
This circuit has a digital to analog converter, and can be used as one, it is really the heart of it.(red in second pic) With a Micro controller or a binary counter you switch the inputs A1-A3 (or what ever you max bit is). The highest resistance is your most significant bit, and as your circuit counts the resistance changes. This changing of resistance makes it a variable voltage divider. Then this voltage goes into a comparator or an op amp and gives you Y1 and Y1 is high only when the DAC is higher than the voltage you’re measuring. So Y1 will tel you it is lower than the DAC voltage but higher than the last binary input. It is not to hard for a program or a computer parallel port to read.
Step 4: Performance / Accuracy
Of course it isn't as accurate as a commercial unit, especially at only 3 bits of resolution, but remember it is expandable. A slight drawback is it produces a variable voltage with only a low current so it can not directly drive anything but, a power transistor would fix that. It will change over temperature but not too bad. It has a slight curve in voltage because I used 150 330 680 when 150 300 600 would be the appropriate values. The worst thing is that the voltage will never go as low as it can high but the last picture shows a solution. DAC's on the positive and negative rails. I hope my new DAC A/D converter solves some data logging problems.
If you need clarification please post a comment I hade trouble trying to explain all this.