Tutorial – Part 2 – Using an Analog to Digital Converter with your Raspberry Pi

Tutorial – Part 2 – Using an Analog to Digital Converter with your Raspberry Pi

Did you ever want to read a voltage (rather than a 1 or 0) on your Raspberry Pi?  You can do this with an Analog to Digital Converter.

Have you ever wanted to read analog (voltage level) levels and sensors on your Raspberry Pi? While you can read digital sensors with the Raspberry Pi, there is no built in analog to digital converter on your Raspberry Pi.

In this Tutorial, you will learn how use an 4 Channel 16 bit Analog to Digital Converter (ADC) on your Raspberry Pi.

In This Tutorial

We are going to show you how to read these four sensors:

  • An O2 (Oxygen Gas Sensor)
  • An analog light sensor (light variable resistor)
  • An analog air quality sensor
  • A voltage divider connected to 5V on the Raspberry Pi

In part 1 to this tutorial, we discussed each of the various parts used to build this project.

The Four Parts to this Tutorial

Part 1 - Overview of the ADC Raspberry Pi Project Part 2 - Hooking up the Hardware Part 3 - The ADC Raspberry Pi Project Software Part 4 - Two Really Cool Experiments with the ADC Raspberry Pi

Hooking Up the Hardware

All of the connections (except for one jumper) are Grove connections.    All Grove Connections use the same Grove cable to connect from one to another.   Want to know more about Grove devices?   Check out the Grove Tutorial here.

 

 

 

Wiring Table

From To Description
Pi2Grover / I2C 4 Channel ADC / I2C Grove Cable
4 Channel ADC / A0 Air Quality Sensor Grove Cable
4 Channel ADC / A1 O2 (Oxygen) Sensor Grove Cable
4 Channel ADC / A2 Light Sensor Grove Cable
4 Channel ADC / A3 Voltage Divider Grove Cable
Voltage Divider / VOL Raspberry Pi / Pin 2 on GPIO Header (5V) Jumper Cable

 

Following is the Grove Cable Diagram for this project.

Analog to digital Converter

 

In Part 3

Part 3 will show how to run a simple test of the system and then will lead you through the install of the Raspberry Pi DataLogger software for graph generation.