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