Problem in reading(displaying) channel output of adafruit AD

For other supported Arduino products from Adafruit: Shields, accessories, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
Onoma
 
Posts: 3
Joined: Mon Jan 06, 2014 9:21 am

Problem in reading(displaying) channel output of adafruit AD

Post by Onoma »

Hi,
Something about the rfduino is preventing me from reading all 4 channels of this 16 bit I2C ADC correctly:
http://www.adafruit.com/products/1085

As you can see, it includes all the code necessary to run with an Aruduino board. I specifically used it with an arduino UNO and was able to verify that it in fact runs properly.
Attached are the bogus results obtained when using certain channels of the ADS.


Here is the code used in the Arduino IDE(for access to library Adafruit_ADS1015.h, please press this link https://github.com/adafruit/Adafruit_AD ... ree/master):

#include <Wire.h>
#include <Adafruit_ADS1015.h>

Adafruit_ADS1115 ads1115;

void setup(void)
{
Serial.begin(9600);
Serial.println("Hello");

Serial.println("Getting single ended readings from AINO");
Serial.println("ADC Range: +/- ");
ads1115.begin();
}

void loop(void)
{
int16_t adc0, adc1, adc2, adc3;

adc0= ads1115.readADC_SingleEnded(0);
adc1= ads1115.readADC_SingleEnded(1);
adc2= ads1115.readADC_SingleEnded(2);
adc3= ads1115.readADC_SingleEnded(3);

Serial.print(" AIN0: "); Serial.println(adc0);
Serial.print(" AIN1: "); Serial.println(adc1);
Serial.print(" AIN2: "); Serial.println(adc2);
Serial.print(" AIN3: "); Serial.println(adc3);
Serial.println(" ");

delay(1000);
}

Really appreciate if someone can figure out this bug. The results are really puzzling.
Believe it's something in the library of RFDUINO. But don't know what.
Attachments
Rfduino- ADC bug.png
Rfduino- ADC bug.png (228.7 KiB) Viewed 384 times

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Problem in reading(displaying) channel output of adafrui

Post by adafruit_support_bill »

If a channel is left unconnected, the voltage will be 'floating' and the value us undefined.

Onoma
 
Posts: 3
Joined: Mon Jan 06, 2014 9:21 am

Re: Problem in reading(displaying) channel output of adafrui

Post by Onoma »

The major problem is not floating voltage. However, how could I solve this?


The major problem is seen in attachment results.
-Channel_0 is not able to record(actually, I only know display) a voltage at all.
-When voltage is supplied on Channel_3, readings from serial print that channel_3 AND channel_ have that voltage.

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Problem in reading(displaying) channel output of adafrui

Post by adafruit_support_bill »

Post a photo of how you have everything connected.

Onoma
 
Posts: 3
Joined: Mon Jan 06, 2014 9:21 am

Re: Problem in reading(displaying) channel output of adafrui

Post by Onoma »

Hi,
I am 100% certain that it is connected correctly.
It's connected in the same way as you have described in the tutorial: http://www.adafruit.com/products/1085

Think it's something related to software. Can someone have a look at the Rfduino code for I2C that reads the ADC. This is beyond my capabilities.
thanks!

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: Problem in reading(displaying) channel output of adafrui

Post by adafruit_support_bill »

Think it's something related to software. Can someone have a look at the Rfduino code for I2C that reads the ADC.
We are not familiar with the RFDuino or its internal code. This would be a question for the people at RFDuino.com.

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Arduino products from Adafruit”