element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
The Learning Circuit
  • Challenges & Projects
  • element14 presents
  • The Learning Circuit
  • More
  • Cancel
The Learning Circuit
Documents Making a 12 bit DAC Using an Arduino -- The Learning Circuit 96
  • Documents
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join The Learning Circuit to participate - click to join for free!
Actions
  • Share
  • More
  • Cancel
Engagement
  • Author Author: tariq.ahmad
  • Date Created: 24 Aug 2021 1:10 PM Date Created
  • Last Updated Last Updated: 24 Feb 2021 8:24 AM
  • Views 6988 views
  • Likes 8 likes
  • Comments 13 comments
Related
Recommended

Making a 12 bit DAC Using an Arduino -- The Learning Circuit 96

element14 presents
Making a 12 bit DAC Using an Arduino

The Learning Circuit | element14 presents |  Project Videos

 

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

 

Once analog signals have been processed by electronics and converted to digital, to convert them back to analog, a DAC is needed. In this video, Karen shows how to make an R-2R Ladder DAC using just resistors, all of the same value. The ladder uses 12 of the digital I/O on an Arduino Uno as its inputs. While the Ladder DAC will be 12-bit, Karen is able to use it to show the differences in resolution between a 4-bit, 6-bit, 8-bit, and 12-bit DAC, generating a sine wave as a visual demonstration.

 

Bill of Material:

 

Product NameManufacturerQuantityBuy KitBuy Kit
Through Hole Resistor, 1 kohm, 500 mW, ± 1%TT ELECTRONICS / WELWYN36Buy NowBuy Now
Breadboard, MCM 60 rows, ABS, 8.5mm, 165mm x 56mmMULTICOMP1Buy NowBuy Now
Arduino Uno SMD, ATmega328 MCUArduino1Buy NowBuy Now
Wire Kit, Jumper, Male to Male, Solderless, 100 mm - 250 mm, 75 PieceMCM1Buy NowBuy Now
MULTICOMP PRO USB Cable, Type A Plug to Type B Plug, 0.91 m, 3 ft, USB 2.0, BeigeMULTICOMP PRO1Buy NowBuy Now

 

Additional Parts:

 

Product Name

Computer for programming

  • digital
  • sine wave
  • port manipulation
  • converter
  • resolution
  • e14_makerkaren
  • conversion
  • arduino
  • analog
  • Share
  • History
  • More
  • Cancel
  • Sign in to reply

Top Comments

  • DAB
    DAB over 4 years ago +1
    Very good episode Karen. You did a great job of showing ADC resolution issues and how they affect the information you can pull out of an analog circuit. DAB
  • beacon_dave
    beacon_dave 9 months ago in reply to Mandy2710

    The original project code can be found here: 

    https://www.hackster.io/instrumentation-system/dac-8-bit-using-r-2r-ladder-964837

    https://github.com/mfaliha/DAC-R-2R-Ladder-8-bit-Arduino-Uno

    Follow along with Karen in the video to make the changes.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Mandy2710
    Mandy2710 9 months ago

    Where i can get code of it

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • thiagoennes
    thiagoennes over 2 years ago in reply to beacon_dave

    let's call it poetic license :)

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • beacon_dave
    beacon_dave over 2 years ago in reply to thiagoennes

    The DAC as per the episode title "Making a 12 bit DAC Using an Arduino" was 12bit and not limited by the ADC. 

    The serial plotter (being used as an accessible alternative to an oscilloscope), was limited by the ADC in the Arduino to 10bit resolution.

    However as the demo jumped from 8bit to 12bit, the 10bit resolution on the serial plotter was still sufficient to show a difference from the 8bit output.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • thiagoennes
    thiagoennes over 2 years ago in reply to beacon_dave

    exactly... the 12bit demo was in fact 10bit limited by the adc. 

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • beacon_dave
    beacon_dave over 2 years ago in reply to thiagoennes

    The ADC doesn't care about what created the signal. In each instance, it's just sampling the signal at its input with 10bit resolution, which is then being plotted.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • thiagoennes
    thiagoennes over 2 years ago

    How did you read a 12bit dac output with the 10bit adc from the arduino uno?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • Hillary
    Hillary over 2 years ago in reply to makerkaren

    Hello! I actually tried this project and had so much fun testing it. I managed modified your code a little, you can check it out on my github: https://github.com/HillaryatGitHub/Multiple-Bit-DAC. Again thank you so much for making such an in depth video Sparkles

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • makerkaren
    makerkaren over 3 years ago in reply to koudelad

    That's.....a really good point. I'm not really sure. I'd have to have someone that knows Arduino code better than I, take a look at the code and see if there's anything that is reducing the visual output. But yeah, you're right. It looks like there are fewer steps than the full resolution each time. Hmmmmm.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • koudelad
    koudelad over 4 years ago in reply to makerkaren

    At 5:04 at the video, you adjust the code to 4 bit resolution of the DAC. However, at 5:20, there are only 4 voltage levels. That is where I would expect to see 16 voltage levels, as you described.

    image

     

    At 5:29 the code is adjusted to 6 bits, which should produce 64 different voltage level, however, I can only see 16.

    image

     

    Or maybe I got something wrong...

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
>
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube