fossasia / pslab-hardware

PSLab Hardware Design and Schematics https://pslab.io
Apache License 2.0
1.64k stars 92 forks source link

New instrument; Ammeter #98

Open cweitat opened 5 years ago

cweitat commented 5 years ago

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.

vaibhav2203 commented 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; }

CloudyPadmal commented 5 years ago

We can add a section named mA to existing multimeter to implement this feature without creating a new instrument. @neel1998 @ho-dor

neel1998 commented 4 years ago

@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

CloudyPadmal commented 4 years ago

Yes right. There's no direct way to measure.

neel1998 commented 4 years ago

So should I get an acs712 sensor or you suggest some other one?

CloudyPadmal commented 4 years ago

We'll leave it for now. Probably a hardware solution will be the best. I'm moving this to pslab-hardware repo.

CloudyPadmal commented 4 years ago

ACS723LLCTR-10AU-T