EasyManuals Logo

Velleman VMA323 User Manual

Velleman VMA323
6 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #4 background imageLoading...
Page #4 background image
VMA323
V. 01 12/03/2018 4 ©Velleman nv
******Code Begin******
/*
Measuring Current Using ACS712
*/
const int analogIn = A0;
int mVperAmp = 100; // use 100 for 20A Module and 66 for 30A Module
int RawValue= 0;
int ACSoffset = 2500;
double Voltage = 0;
double Amps = 0;
void setup(){
Serial.begin(9600);
}
void loop(){
RawValue = analogRead(analogIn);
Voltage = (RawValue / 1024.0) * 5000; // Gets you mV
Amps = ((Voltage - ACSoffset) / mVperAmp);
Serial.print("Raw Value = " ); // shows pre-scaled value
Serial.print(RawValue);
Serial.print("\t mV = "); // shows the voltage measured
Serial.print(Voltage,3); // the '3' after voltage allows you to display 3 digits after decimal point
Serial.print("\t Amps = "); // shows the voltage measured
Serial.println(Amps,3); // the '3' after voltage allows you to display 3 digits after decimal point

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Velleman VMA323 and is the answer not in the manual?

Velleman VMA323 Specifications

General IconGeneral
BrandVelleman
ModelVMA323
CategoryControl Unit
LanguageEnglish

Related product manuals