SparkFun Block for Intel® Edison - ADC

The Intel® Edison is an ultra small computing platform that will change the way you look at embedded electronics. Each Edison is packed with a huge amount of tech goodies into a tiny package while still providing the same robust strength of your go-to single board computer. Powered by the Intel® Atom™ SoC dual-core CPU and including an integrated WiFi, Bluetooth LE, and a 70-pin connector to attach a veritable slew of shield-like "Blocks" which can be stacked on top of each other. It's no wonder how this little guy is lowering the barrier of entry on the world of electronics!

This Block adds ADC functionality to the Edison's I2C bus. The ADS1015 ADC from TI provides a single 12-bit delta-sigma convertor with an analog multiplexer. It can be configured as a four-channel single-ended device or as a two-channel differential device.

The ADC Block has jumpers to allow selection of the I2C slave address among four different options, allowing up to four of these cards to be stacked under one Edison. The sampling rate is not sufficient for audio capture, at 2.2kHz, but it should be adequate for most control applications.

If you are looking to add a little more stability to your Intel® Edison stack, check out this Hardware Pack. It will provide you with increased mechanical strength for stacking Blocks on your Edison!

SparkFun Block for Intel® Edison - ADC Product Help and Resources

Edison Getting Started Guide

December 5, 2014

An introduction to the Intel® Edison. Then a quick walk through on interacting with the console, connecting to WiFi, and doing...stuff.

Programming the Intel® Edison: Beyond the Arduino IDE

January 7, 2015

Intel's Edison module goes beyond being just another Arduino clone. Check this tutorial for advice on how to get the most out of your Edison by writing code in C++!

General Guide to SparkFun Blocks for Intel® Edison

January 5, 2015

A general guide for using SparkFun Blocks for Intel® Edison in your next project!

Loading Debian (Ubilinux) on the Edison

December 5, 2014

How to load a Debian distribution (specifically Ubilinux) onto the Edison.

Installing libmraa on Ubilinux for Edison

January 5, 2015

libmraa is a tool kit for interacting with various Intel single board computers.

Core Skill: Programming

If a board needs code or communicates somehow, you're going to need to know how to program or interface with it. The programming skill is all about communication and code.

3 Programming

Skill Level: Competent - The toolchain for programming is a bit more complex and will examples may not be explicitly provided for you. You will be required to have a fundamental knowledge of programming and be required to provide your own code. You may need to modify existing libraries or code to work with your specific hardware. Sensor and hardware interfaces will be SPI or I2C.
See all skill levels


Core Skill: Electrical Prototyping

If it requires power, you need to know how much, what all the pins do, and how to hook it up. You may need to reference datasheets, schematics, and know the ins and outs of electronics.

2 Electrical Prototyping

Skill Level: Rookie - You may be required to know a bit more about the component, such as orientation, or how to hook it up, in addition to power requirements. You will need to understand polarized components.
See all skill levels


Comments

Looking for answers to technical questions?

We welcome your comments and suggestions below. However, if you are looking for solutions to technical questions please see our Technical Assistance page.

  • Member #462760 / about 10 years ago / 3

    Hi: Any news on the Hookup Guide?

    "Note: We are currently working on a Hookup Guide for this kit. Check back later for more updates."

    Also, is this accessible from the Linux side?

    Cheers, Matt

    • HumbertoGarza / about 10 years ago * / 1

      Hey Member #462760, Here is a link to the c++, python and Arduino library I made for this ADC, let me know if it was helpful or if you need more help, just follow the Readme! GitHub Library

      Also the document will be soon in the Intel Community Platform, hope it’s helpful! Intel Community

  • Member #314979 / about 10 years ago / 2

    As I stated earlier, my pressure sensor works (Flexiforce) but my bend sensor (FS7548) doesn't. But I also get small values for the Flexiforce (0 - 19). I always get 0 for the FS7548. I thought this board contains pull up resistors to 3.3v. I also assume we can put multiple analog sensors on the board and switch between them at runtime. Any clues from anyone about why I'm getting this?

    • HumbertoGarza / about 10 years ago / 1

      Yes you can change the configuration in the runtime. here in my githubyou can find an example about how to achieve so, you just declare a couple of objects and when you read from each object it will read it with the specified configuration for each. If you have any doubts you can ask me.

      Regards

      • Member #314979 / about 9 years ago / 1

        If you can provide a C++ sniplet that allows me to configure to enable a pull up resistor for ain2 and ain3, that would be great. I use ubilinux with mraa (the code i use is posted below in a comment about 5 months ago).

        Thanks!

  • Danny136631 / about 10 years ago / 2

    @HumbertoGarza,

    Thank you for posting. Very good reference. On my side, I referred to Adafruit's handling of ADS1015 and it worked on my development.

    Thanks again.

    • Member #314979 / about 9 years ago / 1

      If you can provide a C++ sniplet that allows me to configure to enable a pull up resistor for ain2 and ain3, that would be great. I use ubilinux with mraa (the code i use is posted below in a comment about 5 months ago).

      Thanks!

  • Petero / about 10 years ago / 2

    Hi, I have the Muscle Sensor v3 and want to connect this to the Intel Edison to read sensor data without the Arduino. Will I be able to do so with this board you think? The sensor is equipped with GND and a SIG, how would you connect it? And can I use python or do I have to use C/C++? Thank you!

    • HumbertoGarza / about 10 years ago * / 1

      You can do so without the Arduino Board! If you need to use the ADC with the Mini-breakout board you will need to cut off the J1 and J2 jumpers and solder the J1pins together. You need to know the output voltage range of your sensor and make sure it fits one of the programmable Voltage of reference of the Block. You could just connect the ground and the SIG to AIN0 and see it working. I made a library for C++ and since you asked I programmed it for Python and Arduino as well, just go to my github and go through the readme, you can ask me anything if you want! or even suggest stuff! GitHub Python and C++ Library

  • So there was someone from the community that wrote a C++ library and a tutorial or the Intel Edison Block ADC:

    "Here is a link to the c++ library I made for this ADC humberto- garza/SparkFunEdisonADC · GitHub. Also the document will be soon in the Intel Community Platform, hope it’s helpful! Intel Community SparkFun Block for Intel® Edison - ADC"

  • sidwook / about 10 years ago / 2

    Thanks to Humberto for posting an example. Just in case it isn't clear to everyone, this block uses the I2C-1 bus on the Edison and not the I2C-6 bus.

  • Danny136631 / about 10 years ago / 2

    Hi,

    Has anyone have some breakthrough on using this ADC block? Any advise would be greatly appreciated.

    Cheers, Danny

    • HumbertoGarza / about 10 years ago * / 1

      Hey Danny136631, Here is a link to the c++, python and Arduino library I made for this ADC, let me know if it was helpful or if you need more help, just follow the Readme! GitHub Library

      Also the document will be soon in the Intel Community Platform, hope it's helpful! Intel Community

  • Member #324888 / about 10 years ago / 2

    Will the Edison Eclipse IDE recognize this board so it can be used with the MRAA library and Intel provided examples?

    • HumbertoGarza / about 10 years ago / 1

      Sure it Works With THe MRAA library, just use the library I made and It will work in Eclipse Too! Here is a link to the c++ library I made for this ADC, let me know if it was helpful or if you need more help, just follow the Readme! GitHub Library

      Also the document will be soon in the Intel Community Platform, hope it's helpful! Intel Community

  • Slugs / about 10 years ago / 2

    Any news on the hookup guide, I would love a simple example of how to read a voltage.

    • HumbertoGarza / about 10 years ago / 1

      Check out what I posted and let me know if it works. It is just an example to test the AIN0 but it works for all the configurations

  • div / about 10 years ago / 2

    Hi is the ADC input range between 0V and the acceptable power input for the edison 3.3 to 4.5 V?

    • HumbertoGarza / about 10 years ago * / 1

      According to the datasheet you can can get measurements from -6.144V to +6.144V but you should use tops 3.3V You can see how to here

  • Sweet, I'd really love to have some ADC on the edison without needing the huge Arduino dev board.

    I don't suppose you could post a preliminary schematic of this, as I need to build something similar to this ADC but can't wait 'till December..

    • HumbertoGarza / about 10 years ago / 1

      https://cdn.sparkfun.com/datasheets/Dev/Edison/ADC_Block.pdf

  • TomLuczak / about 9 years ago / 1

    We just released a pretty polished node.js lib for the ADC that we build for one of our intern's projects on github. The code is based on @HumbertoGarza's python lib, you can find it here

  • Propanu / about 9 years ago / 1

    Does this get a default I2C address if you don't solder any pins?

  • HumbertoGarza / about 10 years ago / 1

    You can now read the ADC Using the MCU Quark! Go to This Github!!!

  • Member #314979 / about 10 years ago / 1

    As it turn out, the problem of implementing a simple bend sensor appears more difficult with this block. I need a pull up resistor and I don't have a 3.3v source with any of the blocks that I have. So it appears that, to use this block, I need to buy another block with a 3.3v source and build a custom block with the pull up logic. So I need: 1) this block 2) another block with 3.3v source 3) build a custom block with pull up resistors to use a simple bend sensor. There has to be a better way to build a wearable device. This board needs to be implemented so users can place resistors for their pull up sensors for all analog imputs. If no resistor is used, the line isn't pulled up. There are so many sensors out their that need pulling up. I'm obviously frustrated.

  • Member #314979 / about 10 years ago / 1

    OK, I figured out the problem. I can't simply connect the to bend sensor leads to this board. I need to add my own pull-up resistors (should have known). Dave

  • Member #314979 / about 10 years ago * / 1

    Heres my code for Ubilinux using mraa to read an analog sensor from AIN2 (so others can benefit):

    #include "mraa.h"
    #include <signal.h>
    
    int running = 0;
    
    void sig_handler(int signo)
    {
    if (signo == SIGINT) {
        running = -1;
    }
    }
    
    int main(int argc, char** argv)
    {
    int a2_oper_status = 0b0 << 7;
    int a2_input_mux = 0b110 << 4; // AIN2-GND
    int a2_gain_amplifier = 0b010 << 1;
    int a2_mode = 0b0 << 0;
    int a2_data_rate = 0b100 << 13;
    int a2_comp_mode = 0b0 << 12;
    int a2_comp_polarity = 0b0 << 11;
    int a2_comp_latching = 0b0 << 10;
    int a2_comp_queue = 0b11 << 8;
    uint16_t a2_word = a2_oper_status +
              a2_input_mux +
              a2_gain_amplifier +
              a2_mode +
              a2_data_rate +
              a2_comp_mode +
              a2_comp_polarity +
              a2_comp_latching +
              a2_comp_queue;
    printf("a2_command 0x%X\n",a2_word);
    
    mraa_i2c_context i2c = mraa_i2c_init(1);
    if (mraa_i2c_address(i2c, 0x48) != MRAA_SUCCESS)
        printf("can't find i2c sensor\n");
    signal(SIGINT, sig_handler);
    while (running == 0) {
        if (mraa_i2c_write_word_data(i2c, a2_word, 0x01) != MRAA_SUCCESS)
       printf("can't write a2 command\n");
        uint8_t a2_sensor_value = mraa_i2c_read_byte_data(i2c, 0);
        printf("%d\n",a2_sensor_value);
        sleep(1);
    }
        printf("Closing I2C\n");
    mraa_i2c_stop(i2c);
    }
    

  • Member #314979 / about 10 years ago / 1

    I have this block working without a breakout board using mraa with ubilinux. However, it works when I plug in a pressure sensor on AIN2 but not when I plug in a bend sensor. Both sensors use to work with arduino breakout. Any reason why this would work with Sparkfun's pressure sensors but not Sparkfun bend sensors? Do I need pull up resistors?

    Also, this board has been selling for 1/2 a year and there still isn't a tutorial on it. A lot of people are spending a lot of time trying to figure this out.

  • Einse / about 10 years ago / 1

    I’m gradually collecting a library of simple python code for using these blocks in conjunction with the MRAA library. Just requires linux running on the Edison and the MRAA library installed.

    Might be helpful to someone who is as confused as I was(am):

    https://github.com/Einse57/SSTM-Edison-Python

    The ADC is still in progress but I have tied out single ended reads and configuration writes using MRAA based on Adafruit's I2C libs.

  • HumbertoGarza / about 10 years ago * / 1

    Hey Everyone! Here is a link to the c++, Python and Arduino library I made for this ADC, let me know if it was helpful or if you need more help, just follow the Readme! GitHub Library

    Also the document will be soon in the Intel Community Platform, hope it's helpful! Intel Community

  • HumbertoGarza / about 10 years ago * / 1

    Hello everyone, It took me a while to figure out how to get to use this ADC. I will leave an example of how to read it via .cpp.

    You need to read this data sheet in order to configure the ADC (http://www.ti.com/lit/ds/symlink/ads1015.pdf page 15) as you please.

    In this example you can test the AIN0 getting ±2.048V as the maximum... you have to know that the configuration bits are in disorder; so send the less significant byte as the most significant (in this case it should be 0x4483, instead send it as 0x8344)

    int main(int argc, char *argv[])
    {
        //Configure the I2C configuration register, 
        //As default the address 0x48 should be soldered in your device
        system("i2cset -y 1 0x48 1 0x8344 w"); 
    
        //This is the command to read the data register
    char const* command = "i2cget -y 1 0x48 0 w"; 
    
    while(1)
    {
        char buffer[10];
        string result = "";
    
                //Open the command to read the data register
        FILE* fpipe = popen(command, "r");
        if (not fpipe) 
        {
             std::cout << "Command failed to execute\n";
        }
        else
        {
                        //The result will be in disorder, it has a resolution of 3
                        //nybbles and this is the right order.
    
            std::fgets(buffer, sizeof buffer, fpipe); 
            result += buffer[0];
            result += buffer[1];
            result += buffer[3];
            result += buffer[4];
            result += buffer[5];
            result += buffer[2];
            std::cout <<result<<endl;
        }
        pclose(fpipe);
                return 0;
    }
    

    • Danny136631 / about 10 years ago / 2

      Hi Humberto, I am totally new to Edison and I also just bought this ADC block, any chance you can possibly share with me more details besides your example for AIN0 part? Any overall tips would be greatly appreciated. My project is to make all the 4 channels work. Thanks you.

      • HumbertoGarza / about 10 years ago / 1

        Hey Danny136631, Here is a link to the c++ library I made for this ADC, let me know if it was helpful or if you need more help, just follow the Readme! GitHub Library

        Also the document will be soon in the Intel Community Platform, hope it's helpful! Intel Community

  • Member #375853 / about 10 years ago / 1

    When I stack this ADC Module with the intel edison. This ADC will be powered with 3.3 V. I would like to know, what is the Maximum analog voltage that its analog input channels can measure during this time, is it 0 to 3.3 V or will it also measure 0-5 V if I provide analog voltage input upto 5 V?

    • tripzero / about 10 years ago / 2

      Did you ever get an answer? I have the same question.

      • HumbertoGarza / about 10 years ago / 1

        According to the datasheet you can can get measurements from -6.144V to +6.144V You can see how to here

Customer Reviews

4 out of 5

Based on 1 ratings:

Currently viewing all customer reviews.