Open cweitat opened 5 years ago
Current sensor acs712 is available to measure AC current through a wire. The value can be fetched using Analog pin of the board.
// Method to fetch the AC current value float getCurrent() { 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) < 1000) //sample for 1 Sec { readValue = analogRead(sensorIn); // see if you have a new maxValue if (readValue > maxValue) { maxValue = readValue; } if (readValue < minValue) { minValue = readValue; } } result = ((maxValue - minValue) 5.0)/1024.0; VRMS = (result/2.0) 0.707; AmpsRMS = (VRMS * 1000)/mVperAmp; if(count == 0){ initial = AmpsRMS; count = 1; } float curr = AmpsRMS - initial; return curr; }
We can add a section named mA
to existing multimeter to implement this feature without creating a new instrument. @neel1998 @ho-dor
@CloudyPadmal is there any way we can implement this functionality without some external sensor like acs712. I am not very sure if we can get Current information from PSLab directly that's why asking you. Thanks
Yes right. There's no direct way to measure.
So should I get an acs712 sensor or you suggest some other one?
We'll leave it for now. Probably a hardware solution will be the best. I'm moving this to pslab-hardware repo.
Actual Behaviour Currently there is no instrument that is able to measure ampere.
Expected Behaviour There should be an instrument to measure the ampere
Would you like to work on the issue?
Anyone.