CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

ADC reads wrong when the fan active

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
zydis



Joined: 10 Aug 2015
Posts: 3

View user's profile Send private message

ADC reads wrong when the fan active
PostPosted: Tue Sep 15, 2015 2:06 am     Reply with quote

Hi, I have a problem when I read current from adc. My circuit is below to read current.

http://4.bp.blogspot.com/-R6EqqPt2H9o/USQqzV2zr1I/AAAAAAAAAB4/shSBHjwe0R0/s1600/ak%C4%B1m+okuma.png

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

View user's profile Send private message

PostPosted: Tue Sep 15, 2015 2:36 am     Reply with quote

What do you mean by "current is stable"?
Have you probed with a scope?
What sort of fan are you using?
etc...............

Mike

EDIT You're not showing any decoupling caps.
temtronic



Joined: 01 Jul 2010
Posts: 9243
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Tue Sep 15, 2015 5:13 am     Reply with quote

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.

Jay
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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


Powered by phpBB © 2001, 2005 phpBB Group