Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Novice
1,648 Views

Analog input values on Edison Arduino Breakout different from other Arduinos

The values read from the analog input on my Edison are different from from other Arduino breakouts. For example 0.68V is 147 on Arduino Uno and OSEPP Mega 2560 but varies between 154 and 156 on the Edison. I've usually found the Ain to be within 1 or 2 values between different arduinos and haven't anything online about Edison differences. Is there a calibration that can be performed or a jumper setting?

0 Kudos
13 Replies
Highlighted
Community Manager
7 Views

Hi radix_zero,

 

 

Thanks for your interest in the Intel® Edison™ Platform.

 

 

I'm sorry to hear that you are having issues with the Analog inputs of your Edison. Could you be so kind to provide me the steps that you are following in order to reproduce this issue.

 

 

I will be waiting for your reply, have a nice day!

 

 

Best Regards,

 

-Jose P.
0 Kudos
Highlighted
Community Manager
7 Views

Hi radix_zero,

 

 

Were you able to solve your issue with the Analog inputs on your Edison? Please let me know in order to assist you.

 

 

Have a nice day!

 

 

Best Regards,

 

-Jose P.
0 Kudos
Highlighted
Novice
7 Views

No i haven't been able to solve this. it is only a minimal circuit with a TMP36. The arduino reads different than mraa. multimeter confirms the voltage is 0.68V in both cases.

External thermometer confirms the arduino is right and the edison is to high.

0 Kudos
Highlighted
Community Manager
7 Views

Hi radix_zero,

 

 

Could you be so kind to share the code that you are using in your Arduino and in your Edison? Also have you measured the ADC in your devices, maybe the reason of the discrepncy is due to the ADC resolution.

 

 

I will be waiting for your reply, have a nice day!

 

 

Best Regards,

 

-Jose P.
0 Kudos
Highlighted
Community Manager
7 Views

Hi radix_zero,

 

 

Were you able to measure the ADC on your devices? Also, could you be so kind to provide the code you are using in order to replicate your issue.

 

 

We will be waiting for your reply, have a nice day!

 

 

Best Regards,

 

-Jose P.
0 Kudos
Highlighted
Novice
7 Views

package samples.edison.edsn_ain_log;

import java.util.logging.Logger;

import mraa.Aio;

/**

*

* @author Chris

*/

public class Main {

static {

try {

System.loadLibrary("mraajava");

} catch (UnsatisfiedLinkError e) {

final String msg = "MRAA Native Library failed to load.\n" + e;

System.err.println(msg);

System.exit(1);

}

}

private static final int A0 = 0;

public static void main(String argv[]) throws InterruptedException {

final Aio ain = new Aio(A0);

System.out.println("\tNo.\tRaw\tAvg\tTemp C\tavg tmp");

System.out.println("\t---\t---\t---\t----\t-------");

double sum = 0.0d;

for (int i = 1; i <=50; i++) {

long raw = ain.read() -9; // ADC is off by 9

double temp = ((raw * 0.004882814d) - 0.5d) * 100.0d;

sum += raw;

double avg = sum/i;

double avgtmp = ((avg * 0.004882814d) - 0.5d) * 100.0d;

System.out.println("\t" + i + "\t" + raw+"\t"+avg + "\t" + temp+"\t"+avgtmp);

Thread.sleep(5000);

}

}

}

0 Kudos
Highlighted
Novice
7 Views

The circuit is figure 24 in the TMP36 datasheet http://www.analog.com/media/en/technical-documentation/data-sheets/TMP35_36_37.pdf http://www.analog.com/media/en/technical-documentation/data-sheets/TMP35_36_37.pdf with 5V and A0 from the board.

Averaging the values to try and smooth out the temperature reading. Noticing an drift in the values by 2 to 4 deg C while the reference thermometer beside the sensor moves a fraction of a degree.

0 Kudos
Highlighted
Community Manager
7 Views

Hi radix_zero,

Unfortunately, I don't have a TMP36 sensor at hand. Nevertheless, I measured 5V from the ADC of the Edison Arduino Expansion Board and of the Arduino 101 using the function analogRead() from the Arduino IDE. You should know that I got results similar to yours, in the Edison the values seem to change from 1016 to 1023 and on the Arduino 101 I got always 1023. You can see the images below of the serial monitor:

Edison

Arduino 101

I will investigate the explanation of this behavior and get back to you as soon as I have some useful information.

Have a nice day!

Best Regards,

 

-Jose P.
0 Kudos
Highlighted
Novice
7 Views

Awesome. That drift in the ADC is my issue. Soak testing my setup i had temperatures out by 300C one morning. It seems, though that there is a warm-up period, and when everything has been running for awhile. In the morning the mercury thermometer can be at 19C the board at 6C (average). If i let it run for an hour, reading while get withing the +/- 0.5C that is expected for the TMP36.

(a different issue has come-up which has stopped me from experimenting with this, seem the file system on the SD Card is now read-only, which has stopped the logging.)

0 Kudos
Highlighted
Community Manager
7 Views

Hi radix_zero,

 

 

We are currently investigating this issue, we appreciate your patience.

 

 

Regarding the SD card, have you try formating it? Also have you try a different SD card?

 

 

Best Regards,

 

-Jose P.
0 Kudos
Highlighted
Novice
7 Views

i've tried all the usual things with the SD Card. This problem so far seems to happen right before the board and edison fail permenently.

Waiting on a parts order before i can try any other solutions.

0 Kudos
Highlighted
Community Manager
7 Views

Hi radix_zero,

We appreciate your patience.

Could you be so kind to explain us what do you mean by: "edison fail permanently". Do you mean that the Edison doesn't boot any more? If this is the case could share a photograph of how you are powering your Edison.

Now, regarding the analog input issue, if your Edison is working well, could you share us your setup. Are you powering the Edison from USB only? Are you using an external power supply? We recommend 12V, the operating range is 7V to 17V. Is there any other circuitry attached to his setup or just the TMP sensor?

We will be waiting for your reply, have a nice day!

Best Regards,

 

-Jose P.
0 Kudos
Highlighted
Community Manager
7 Views

Hi radix_zero,

 

 

We will like to follow up your issue, could you be so kind to explain us what do you mean by: "edison fail permanently". Also, if your Edison is working fine, could you share your setup with the TMP sensor?

 

 

We will be waiting for your reply, have a nice day!

 

 

Best Regards,

 

-Jose P.
0 Kudos