Analog Inputs

Hey guys, really dumb questions.

I the analog inputs for the Yun DC or AC, is it Volts or Amps??? Is there is a way to configure this?

I'm trying to run this project (http://www.instructables.com/id/Yun-based-Electricity-Monitor-with-Cloud-Support-T/?ALLSTEPS) but i cant get the readings from the current xformer. I use the identical codes as in the site but i seem to be getting ~500 raw input (im assuming this is because of the voltage divider)

The reading from the analog inputs have no units. It's a 10 bit number that ranges from 0 to 1023, and is proportional to the voltage on the input compared to the reference voltage (which is usually 5 volts.)

If the input is at zero volts, it returns a value of 0.
If the input is at the AREF voltage, it returns a value of 1023.
Anything between those limits returns a value that is proportionally between those values.

For example, an input voltage of 2.5 V (halfway between 0 and 5 V) returns a value of 512 (halfway between 0 and 1023.)

Hey guys, really dumb questions

. . . duplicated three times. >:(

DO NOT CROSS-POST, CROSS-POSTING WASTES TIME.

I apologize for the cross-posting...

The current sensor's output is in VAC. From what I've read, the analog input for the Arduino Yun is DC (5V is the high end by default). My question is if the Ardunio can take in an AC signal as opposed to a DC signal, the link below seems to get it to work, but i cant,

Yes, the analog input is strictly DC, you never want the input to go negative (or go higher than AREF.)

From what I can see in that link, they are using a pair of equal value resistors to form a voltage divider. One side of the divider is ground, the other side is +5V, so the node at the two resistors is about 2.5V (I say about because they are not high precision resistors.)

The current transformer is then connected between this 2.5V source and the analog input. That means that the zero state reading (no current flowing) is about 2.5V, which would be about 512 counts, which is close to the 500 that you are reporting.

As AC current flows, the current transformer will generate positive and negative offsets to that 2.5V center value. The data sheet for the transformer indicates 1 Volt at 30 Amps, so measuring a 30 Amp AC signal will result in a signal that varies from 1.5 to 3.5 volts as seen by the analog input (around 300 to 700 raw counts.)

Since it's an AC signal, and your samples are taken at random times in the waveform (not synchronized) with the AC waveform, you are going to see random values, you won't get a steady value. (That's why the software does so much low pass filtering and RMS calculations.)

you never want the input to go negative (or go higher than AREF.)

There's no particular problem with it going higher than Aref, just as long as it doesn't exceed Vcc by more than half a volt, or go below minus half a volt.

AWOL:
There's no particular problem with it going higher than Aref, just as long as it doesn't exceed Vcc by more than half a volt, or go below minus half a volt.

True. I was trying to keep it simple. Of course, you won't get valid readings if you go out of the 0 to AREF range (values will be clamped at 0 or 1023.)