Raspberry Pi ADC Tutorial

Raspberry PiĀ is an ARM architecture processor based board designed for electronic engineers and hobbyists. The PI is one of most trusted project development platforms out there now. With higher processor speed and 1 GB RAM, the PI can be used for many high profile projects like Image processing andĀ Internet of Things.

raspberry pi adc tutorial
Interfacing ADC0804 with Raspberry-Pi

For doing any of high profile projects, one need to understand the basic functions of PI. We will be covering all theĀ basic functionalities of Raspberry PiĀ in these tutorials. In each tutorial we will discuss one of functions of PI. By the end of thisĀ Raspberry Pi Tutorial Series, you will be able to do high profile projects by yourself. Go through below tutorials:

In this tutorial, we will Interface an ADC (Analog to Digital Conversion) chip to Raspberry Pi. We know all the parameters of analog, means there vary continuously over time. Say for an instance temperature of the room, the room temperature varies with time continuously. This temperature is provided with decimal numbers. But in digital world, there are no decimal numbers, so we need to convert the Analog value to Digital value. This conversion process is done by ADC technique. Learn more about ADC here: Introduction to ADC0804

ADC0804 and Raspberry Pi:

Normal controllers have ADC channels but for PI there are no ADC channels provided internally. So if we want to interface any analog sensors we need an ADC conversion unit. So for that purposes we are going to InterfaceĀ ADC0804 Ā with Raspberry Pi.

ADC0804 is a chip designed to convert analog signal into 8 bit digital data. This chip is one of the popular series of ADC. Itā€™s an 8bit conversion unit, so we have Ā values or 0 to 255 values. With a measuring voltage of maximum 5V, we will have a change for every 19.5mV. Below is theĀ Pinout of ADC0804:

Now another important thing here is, the ADC0804 operates at 5V and so it provides output in 5V logic signal. In 8 pin output (representing 8bits), every pin provides +5V output to represent logicā€™1ā€™. So the problem is the PI logic is of +3.3v, so you cannot give +5V logic to the +3.3V GPIO pin of PI. If you give +5V to any GPIO pin of PI, the board gets damaged.

So to step-down logic level from +5V, we will be using voltage divider circuit. We have discussed Voltage Divider Circuit previously look into it for further clarification.Ā What we will do is, we use two resistors to divide +5V logic into 2*2.5V logics. So after division we will give +2.5v logic to PI. So, whenever logic ā€˜1ā€™ is presented by ADC0804 we will see +2.5V at the PI GPIO Pin, instead of +5V.

Learn more about GPIO Pins of Raspberry Pi here and go through our previous tutorials.

Components Required:

Here we are usingĀ Raspberry Pi 2 Model BĀ with Raspbian Jessie OS. All the basic Hardware and Software requirements are previously discussed, you can look it up in theĀ Raspberry Pi Introduction, other than that we need:

  • Connecting pins
  • 220ā„¦ or 1Kā„¦resistor (17 pieces)
  • 10K pot
  • 0.1ĀµF capacitor (2 pieces)
  • ADC0804 IC
  • Bread Board

Circuit Explanation:

Ā It works on supply voltage of +5v and can measure a variable voltage range in 0-5V range.

schematic raspberry pi adc tutorial

For more detail: Raspberry Pi ADC Tutorial

About The Author

Ibrar Ayyub

I am an experienced technical writer with a Master's degree in computer science from BZU Multan University. I have written for various industries, mainly home automation, and engineering. I have a clear and simple writing style and am skilled in using infographics and diagrams. I am a great researcher and is able to present information in a well-organized and logical manner.

Scroll to Top