From 11:00 PM CDT Friday, Nov 8 - 2:30 PM CDT Saturday, Nov 9, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From 11:00 PM CDT Friday, Nov 8 - 2:30 PM CDT Saturday, Nov 9, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
08-11-2015 09:08 AM
Hello guys! I'm using two analog inputs voltage & current with serial communication from arduino to labview. I use ACS712 for the current sensor. The readings I get are ranging from -6 to +5 from the AC signal after the calculations. If I take the RMS, I will get around 3.9 - 4.0. I use 230AC supply with load 229ohms so I should get around 1.004? The value I get should be near to 1 but I'm getting 3.9 RMS?
I've double checked the hardware(connection) and software(calculations) and I don't think there is anything wrong? What should I do? This value I'm getting is totally far from 1A that I should be getting!
I'm taking the reading from Analog input 0 to divide 1023 then * 5000. Then I minus the 2500 offset and divide 185.
Here is my code:
const int analogIn0 = A0;
const int analogIn1 = A1;
int mVperAmp = 185; // use 100 for 20A Module and 66 for 30A Module
int RawCurrentValue= 0;
int RawVoltageValue= 0;
int ACSoffset = 2500;
int Denominator = 0;
float AcVoltage = 0;
float Voltage0 = 0;
float Voltage1 = 0;
float Amps = 0;
void setup(){
Serial.begin(9600);
}
void loop(){
RawCurrentValue = analogRead(analogIn0);
RawVoltageValue = analogRead(analogIn1);
Denominator = 10000/130000;
Voltage0 = (RawCurrentValue / 1023.0) * 5000;
Voltage1 = (RawVoltageValue / 1023.0) * 5000;
AcVoltage = (Voltage1 / Denominator ) ;
Amps = ((Voltage0 - ACSoffset) / mVperAmp);
Serial.print(Amps);
Serial.print(", ");
Serial.println(AcVoltage);
}
Really appreciate if you guys can help!
08-11-2015 09:12 AM - edited 08-11-2015 09:18 AM
I'm sure someone here will still try to help anyways, but is this problem related to the LabVIEW part of your system at all, or even NI equipment?
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
08-11-2015 09:14 AM
Hi James,
lamela is using an Arduino to measure some signals and send to result of this measurement via serial port to a PC running LabVIEW.
And lamela tends to forget about the correct forum to ask his/her questions…
@lamela: Maybe you should ask in an Arduino forum?
08-11-2015 09:27 AM
Gotcha, ok.
lamela, have you tried printing values along the way (before, during, and after calculations) to better understand what the calculations are doing? You should print the raw value themselves, so that you can tell whether the problem lies in your calculations or in the raw signals.
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
08-11-2015 11:41 AM
You've probably already heard this before to, but is there a reason you aren't using LIFA, or the newer LINX?
Unofficial Forum Rules and Guidelines
Get going with G! - LabVIEW Wiki.
17 Part Blog on Automotive CAN bus. - Hooovahh - LabVIEW Overlord
08-11-2015 12:30 PM
08-11-2015 12:36 PM
Is he using the Arduino as a fuse?
Lynn
08-11-2015 12:41 PM
@johnsold wrote:
Is he using the Arduino as a fuse?
Lynn
I like to run all of my signals through an NI-USB 6008 (AI0 > AO0, AI1 > AO1), so that I have a cheap fuse that doubles as a probe!
/s
Cheers
--------, Unofficial Forum Rules and Guidelines ,--------
'--- >The shortest distance between two nodes is a straight wire> ---'
08-11-2015 11:36 PM - edited 08-11-2015 11:37 PM
Thanks for the replies!
I've serial printed the 3 values, the RawCurrentValue, the Millivolt and the Current reading. I verified that the Millivolt values are correct, so I assume the rawcurrentvalue shouldn't be the problem though.. I should be getting a current close to 1.
The values of the RawCurrentValue is ranging from 290-705. Millivolt is ranging from 1400-3450 and current is from -5.96 to 5.16.
I don't think the calculation to measure the current is wrong either? What should I do? I already asked in the arduino forum but there is still no solution yet..
08-12-2015 07:50 AM
Your calculations look reasonable, assuming that the coefficients in your original post are accurate.
Do you have an alternative means of measuring the current? Maybe it really is 5 A peak.
Lynn