ADS1015 I2C 12Bit ADC Module (HCMODU0099)

Modules for various types of sensors including accelerometers. gyro's, IR motion, etc
Post Reply
admin
Site Admin
Posts: 866
Joined: Sun Aug 05, 2012 4:02 pm

ADS1015 I2C 12Bit ADC Module (HCMODU0099)

Post by admin » Tue Jun 21, 2016 11:31 am

Image



This module (HCMODU0099) is a breakout board for the Texas Instruments ADS1015 ADC. This device provides a precision 12 bit analogue to digital (ADC) resolution. Designed with precision, low power and ease of implementation in mind. The ADS1015 features onboard reference and an oscillator. A serial I2C interface allows interfacing to the module with only two pins and it's slave address can be configured on one of four addresses, allowing for multiple modules to be connected to one I2C bus. The ADS1015 can perform conversions at rates up to 3300 samples per second (SPS). An onboard PGA is available that offers input ranges from the supply to as low as ±256mV, allowing both large and small signals to be measured with high resolution. The ADS1115 also features an input multiplexer (MUX) that provides two differential or four single-ended inputs.

The ADS1015 operates either in continuous conversion mode or a single-shot mode that automatically powers down after a conversion and greatly reduces current consumption during idle periods.

ImageImageImage


Features:
• WIDE SUPPLY RANGE: 2.0V to 5.5V
• LOW CURRENT CONSUMPTION: Continuous Mode: Only 150μA Single-Shot Mode: Auto Shut-Down
• PROGRAMMABLE DATA RATE: 128SPS to 3300SPS
• INTERNAL LOW-DRIFT VOLTAGE REFERENCE
• INTERNAL OSCILLATOR
• INTERNAL PGA
• I2C™ INTERFACE: Pin-Selectable Addresses
• FOUR SINGLE-ENDED OR TWO DIFFERENTIAL INPUTS
• PROGRAMMABLE COMPARATOR

    • Image



Raspberry Pi users:

For Raspberry Pi uses we have tested this module with the free Cayenne cloud based IoT software platform. Simply connect the module to your Raspberry Pi as shown below and use the Cayenne software platform to get remote analogue voltage readings without writing a single line of code.


Image

You can create a free account simply by clicking our referral link below:
                  • Image



Arduino users:

To make using this module with your Arduino as easy as possible we have written an exclusive library (HCADS1xxx). This library can be downloaded from the software section of our support forum here:

http://forum.hobbycomponents.com/viewto ... =58&t=2025

The library will allow you to obtain readings out of the 4 analogue input pins (A0-A3).

Image


Example sketch using the HCADS1xxx library:
  1. /* FILE:    HCADS1xxx_Continuous_Conversion_Example
  2.    DATE:    20/06/16
  3.    VERSION: 0.2
  4.    AUTHOR:  Andrew Davies
  5.  
  6.    07/06/16 version 0.1: Original version
  7.    20/06/16 version 0.2: Updated to include support for 12Bit ADS1015
  8.    
  9.    Example Arduino sketch for ADS1015, ADS1113, ADS1114, & ADS1115 serial analogue to
  10.    digital devices created by Hobby Components Ltd (HOBBYCOMPONENTS.COM)
  11.    
  12.  
  13. This example Arduino sketch demonstrates how to use the HCADS111x library to configure
  14. the ADC device to continuous conversion mode and how to take repeated measurements.
  15. The measurement results will be output to the Arduino's serial port.
  16.  
  17. This library and sketch supports the ADS1015, ADS1015, ADS1113, ADS1114, & ADS1115
  18. devices but has been written in particular for our ADS1015 12bit and ADS1115 16bit
  19. analogue to digital modules (HCMODU0098 & HCMODU0099)
  20. available from hobbycomponents.com
  21.  
  22. To use the module connect it to your Arduino as follows:
  23.  
  24. ADS1015/ADS1115......Uno/Nano
  25. VDD..................5V
  26. GND..................GND
  27. SCL..................A5
  28. SDA..................A4
  29. A0...................To the analogue voltage to be measured (voltage must be between 0 & 6.144V)
  30.  
  31. The library for this sketch can be downloaded form the software section of our support
  32. forum (forum.hobbycomponents.com).
  33.  
  34.  
  35. You may copy, alter and reuse this code in any way you like, but please leave
  36. reference to HobbyComponents.com in your comments if you redistribute this code.
  37. This software may not be used directly for the purpose of selling products that
  38. directly compete with Hobby Components Ltd's own range of products.
  39.  
  40. THIS SOFTWARE IS PROVIDED "AS IS". HOBBY COMPONENTS MAKES NO WARRANTIES, WHETHER
  41. EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
  42. MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE, ACCURACY OR LACK OF NEGLIGENCE.
  43. HOBBY COMPONENTS SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR ANY DAMAGES,
  44. INCLUDING, BUT NOT LIMITED TO, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY
  45. REASON WHATSOEVER.
  46. */
  47.  
  48. /* Include the HCADS1xxx library */
  49. #include "HCADS1xxx.h"
  50.  
  51. /* Create an instance of the library */
  52. HCADS1xxx HCADS1xxx(ADS1xxx_I2C_ADD_LOW);
  53.  
  54.  
  55. void setup()
  56. {
  57.   /* Initialise the library and serial interface */
  58.   Serial.begin(9600);
  59.   HCADS1xxx.Init();
  60.  
  61.   /* Set the ADC's input to single ended (referenced to GND) and connect it to the
  62.    * modules pin A0. See the library documentation in our support forum for more
  63.    * options */
  64.   HCADS1xxx.Input(A0);
  65.  
  66.   /* Set the devices full scale reference voltage to 6.144V. See library
  67.    * documentation for other options */
  68.   HCADS1xxx.FullScale(FS_6_144V);
  69.  
  70.   /* Put the device into continuous conversion mode */
  71.   HCADS1xxx.Conv_Mode(CONTINUOUS);
  72. }
  73.  
  74.  
  75. void loop()
  76. {
  77.   int Result;
  78.  
  79.   /* Get the last measurement from the the device */
  80.   Result = HCADS1xxx.Read();
  81.  
  82.   /* Output the raw result to the serial port */
  83.   Serial.print("Raw value: ");
  84.   Serial.println(Result);
  85.  
  86.   /* Divide the result by the ADC resolution to get the actual pin voltage:
  87.    * (Result * (Full Scale Voltage / ADC resolution)) */
  88.   Serial.print("Pin voltage: ");
  89.   Serial.println(Result * (6.144 / (65536 / 2)), 4);
  90.   Serial.println();
  91.  
  92.   /* Wait a little before taking another measurement so not to flood the serial port */
  93.   delay(200);
  94. }



Micro:bit users:

For anyone wishing to use this module with the micro:bit keble6 has very kindly made a blog post which includes an extension for the MakeCode environment. This can be found at the following location:

https://microbits-projects.blogspot.com ... l-adc.html





Image

The HCADS1xxx Arduino compatible library required for the above sketch can be downloaded from the software section of our support forum here:

http://forum.hobbycomponents.com/viewto ... =58&t=2025
ADS1115_Datasheet.pdf


Disclaimer: The Cayenne platform is an external free service and is not provided by, or connected to, Hobby Components Ltd. It is therefore not being sold as part of the product advertised on this page. As such we do not provide any guarantees or warranties with regards to this service. Issues or questions related to the Cayenne platform should be directed to Cayenne and not Hobby Components Ltd.

Libraries, example code, and diagrams are provided as an additional free courtesy by Hobby Components and are not sold as part of this product. We do no provide any guarantees or warranties as to their accuracy or fitness for purpose.

Descriptions and diagrams on this page are copyright Hobby Components Ltd and may not be reproduced without permission.

Post Reply

Return to “Sensors”