AC கரண்ட் மீட்டர் 200 ரூபாயில் தயாரியாக்க ...........(மினி ப்ராஜெக்ட் -01 for eee &ece ஸ்டுடென்ட்ஸ் )
தேவையான காம்போனென்ட்ஸ்
1.ardunio உனோ-1
2.கரண்ட் சென்சார் (acs 712)-1
3.கம்ப்யூட்டர்
diagram
ஸ்டெப்ஸ் ......
const int sensorIn = A0;
int mVperAmp = 185; // use 100 for 20A Module and 66 for 30A Module
தேவையான காம்போனென்ட்ஸ்
1.ardunio உனோ-1
2.கரண்ட் சென்சார் (acs 712)-1
3.கம்ப்யூட்டர்
diagram
ஸ்டெப்ஸ் ......
ACS712 Module Pin Outs:
- Always connect load in mentioned direction for positive output.
- If you will connect as illustrated below, the output will be positive ans above 2.5 volt .
- If you will connect it in opposite direction as illustrated in below picture, the output will decrease from the 2.5 volt.
- It will give 2.5 volt when there is no current flowing through it.
ப்ரோக்ராம்
const int sensorIn = A0;
int mVperAmp = 185; // use 100 for 20A Module and 66 for 30A Module
double Voltage = 0;
double VRMS = 0;
double AmpsRMS = 0;
double VRMS = 0;
double AmpsRMS = 0;
void setup(){
Serial.begin(9600);
}
Serial.begin(9600);
}
void loop(){
Voltage = getVPP();
VRMS = (Voltage/2.0) *0.707; //root 2 is 0.707
AmpsRMS = (VRMS * 1000)/mVperAmp;
Serial.print(AmpsRMS);
Serial.println(” Amps RMS”);
}
VRMS = (Voltage/2.0) *0.707; //root 2 is 0.707
AmpsRMS = (VRMS * 1000)/mVperAmp;
Serial.print(AmpsRMS);
Serial.println(” Amps RMS”);
}
float getVPP()
{
float result;
int readValue; //value read from the sensor
int maxValue = 0; // store max value here
int minValue = 1024; // store min value here
{
float result;
int readValue; //value read from the sensor
int maxValue = 0; // store max value here
int minValue = 1024; // store min value here
uint32_t start_time = millis();
while((millis()-start_time) < 3000) //sample for 3 Sec
{
readValue = analogRead(sensorIn);
// see if you have a new maxValue
if (readValue > maxValue)
{
/*record the maximum sensor value*/
maxValue = readValue;
}
if (readValue < minValue)
{
/*record the minimum sensor value*/
minValue = readValue;
}
}
while((millis()-start_time) < 3000) //sample for 3 Sec
{
readValue = analogRead(sensorIn);
// see if you have a new maxValue
if (readValue > maxValue)
{
/*record the maximum sensor value*/
maxValue = readValue;
}
if (readValue < minValue)
{
/*record the minimum sensor value*/
minValue = readValue;
}
}
// Subtract min from max
result = ((maxValue – minValue) * 5.0)/1024.0;
return result;
}
result = ((maxValue – minValue) * 5.0)/1024.0;
return result;
}
No comments:
Post a Comment