Video: Analog to Digital Conversion on the ATmega328p

In this week’s video, we continue on where we left off last week with another in our series of videos where we discuss how to program for the ATmega328p processor. This week, [Jack] takes a look at the analog to digital converter and takes us through how to set things up and then how to perform a conversion using the potentiometer on the 3pi as the analog source. Playing with potentiometers isn’t the most interesting thing in the world, but after watching this video, you will be able to do things like take light readings using a cadmium sulfide cell, read the weight applied to a sensor, calculate the temperature from a resistor and a thermistor, or interface with an analog gyroscope.

If you have missed our previous videos, here are some links:
Part 1: Setting up the development environment
Part 2: Basic I/O
Part 3: Pulse Width Modulation

Stay tuned for next week’s* video where we will take a look at how to interface with the 3pi’s line sensors.

Video is after the break…

* HAD is in the process of moving our secret headquarters so next week’s video may come some time later than next week.

Comments

  1. Ren says:

    secret headquarters?
    Is the new place a former ICBM base?

  2. The cageybee says:

    Disappointing. From the title I thought you were going to use the 328 to digitise video. : (

  3. nexekho says:

    You can do a lot with the 328P’s ADC:
    http://www.instructables.com/id/Lo-fi-Arduino-Guitar-Pedal/
    Can get decent audio processing using straight C on the Arduino platform

    • nexekho says:

      Check out my stuff in the comments I’ve written for it – a chorus/flanger. I got intelligible results using AnalogRead but manually using the registers to process while the ADC works vastly improves the quality.

  4. Ole says:

    Where do you have the entire code

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 92,158 other followers