When I read current from the out of device that have a fan, it works well, but when the fan working current is stable but reading from adc is changing. Do you have any idea for solution?
Mike Walne
Joined: 19 Feb 2004 Posts: 1785 Location: Boston Spa UK
Posted: Tue Sep 15, 2015 2:36 am
What do you mean by "current is stable"?
Have you probed with a scope?
What sort of fan are you using?
etc...............
What type of fan? A brush type fan will produce a LOT of EMI and a BLDC fan draws current in pulses. A DVM will not show this though an Oscilloscope will. It's possible the ADC reads this noise or EMI.
What is your ADC reading/display program ? You should read at least 8* then average the reading. Olympic average is 'smoother'. If you have time, take 16 readings and then average.
Since your load is a fan, it doesn't require microsecond ADC response so using 16 rdgs/avg will give better (smoother) results will no overall loss of performance.
If you read in binary multiple (4,8,16,32) the math is a lot faster and easier on the PIC.
Fans are like temperature sensors and door switches where 1/10th /second per reading is more than fast enough.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum