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).