Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

Arduino UNO and Adafruit ADS1015 Based Analog to Digital Conversion

View and Edit Project In Cirkit DesignerImage of Arduino UNO and Adafruit ADS1015 Based Analog to Digital Conversion

Circuit Documentation

Summary of the Circuit

This circuit is designed to read analog values from a potentiometer and convert them to digital using the Adafruit ADS1015 12Bit I2C ADC (Analog-to-Digital Converter). The ADC communicates with an Arduino UNO microcontroller over I2C. The potentiometer's output is connected to the ADC's input channel through a resistor. The circuit is powered by a 9V battery. The Arduino UNO reads the digital values from the ADC and outputs the readings to the serial monitor.

Component List

Adafruit ADS1015 12Bit I2C ADC

Arduino UNO

Potentiometer

9V Battery

Resistor

Wiring Details

Adafruit ADS1015 12Bit I2C ADC

Arduino UNO

Potentiometer

9V Battery

Resistor

Documented Code

#include <Adafruit_ADS1X15.h>
/*
 * Arduino Sketch for a simple analog to digital converter test using a
 * potentiometer. The circuit uses an Adafruit ADS1015 12Bit I2C ADC to read
 * the analog values from the potentiometer and displays the values on the
 * serial monitor.
 *
 * Circuit Connections:
 * - ADS1015 VDD to 9V Battery +
 * - ADS1015 GND to 9V Battery -
 * - ADS1015 SCL to Arduino UNO SCL
 * - ADS1015 SDA to Arduino UNO SDA
 * - Potentiometer VCC to 9V Battery +
 * - Potentiometer GND to 9V Battery -
 * - Potentiometer Output to Resistor pin1
 * - Resistor pin2 to ADS1015 AIN0
 */

#include <Wire.h>

Adafruit_ADS1015 ads;  // Create an instance of the ADS1015

void setup() {
  Serial.begin(9600);  // Initialize serial communication
  ads.begin();         // Initialize the ADS1015
}

void loop() {
  int16_t adc0;
  adc0 = ads.readADC_SingleEnded(0);  // Read the analog value from AIN0
  Serial.print("AIN0: ");
  Serial.println(adc0);
  delay(1000);  // Wait for 1 second before the next reading
}

This code initializes the Adafruit ADS1015 and reads the analog value from the AIN0 channel, which is connected to the potentiometer through a resistor. The read value is then printed to the serial monitor every second.