True analog output on an Arduino using a resistor ladder as DAC
River Champeimont River Champeimont
783 subscribers
386 views
6

 Published On May 4, 2021

The Arduino Uno does not have true analog output (it has PWM which is "fake" analog output) but it's actually very simple to create analog output from digital outputs on N bits thanks to a DAC (Digital to Analog Converter). Making one is actually very simple using only resistors, connected in a clever way called a resistor ladder (see "https://en.wikipedia.org/wiki/Resisto...").

The program I ran here tests all 256 possibles values on 8 output digital bits and measures back the output of the resistor ladder, showing that it is quite accurate in fact (which surprised me actually)

I uploaded the source code and full output result here: https://github.com/raphaelchampeimont...

show more

Share/Embed