PR11 FOR loop count

LED Blinking, Walking with Cytron Servo, Displaying RFID, Multi-function Mobile Robot......

PR11 FOR loop count

Postby fir » Fri Nov 11, 2011 7:07 am

I want to ask if I changed the number of loop to (original is 2000) 1000, 1500, 2500 and 3000; what will happened to the reading of the temperature on LCD?
Thanks in advance.
Attachments
Untitled.jpg
fir
Freshie
 
Posts: 6
Joined: Fri Nov 11, 2011 7:03 am

Re: PR11 FOR loop count

Postby shahrul » Fri Nov 11, 2011 10:59 am

That number is like number of sampling. The ADC take 2000 reading and get the average.
It effect depends on application. If you are reading parameter that not much varying, it's not many affected.
If you are reading parameter is like have some spike, this average value will help to read this.
User avatar
shahrul
Professional
 
Posts: 812
Joined: Sat May 16, 2009 9:54 pm
Location: Selangor

Re: PR11 FOR loop count

Postby fir » Fri Nov 11, 2011 1:09 pm

I see. I need to make the changes in those looping cycle but unfortunately my PR11 doesn't work.
So, in your opinion how much the temperature will deviate from 2000 cycle? say ±1°C for every 500 cycle changed?
Thanks in advance.
fir
Freshie
 
Posts: 6
Joined: Fri Nov 11, 2011 7:03 am

Re: PR11 FOR loop count

Postby shahrul » Fri Nov 11, 2011 1:57 pm

fir WROTE:I see. I need to make the changes in those looping cycle but unfortunately my PR11 doesn't work.
So, in your opinion how much the temperature will deviate from 2000 cycle? say ±1°C for every 500 cycle changed?
Thanks in advance.

Don't know. You also can use this method for temperature LM35.
User avatar
shahrul
Professional
 
Posts: 812
Joined: Sat May 16, 2009 9:54 pm
Location: Selangor

Re: PR11 FOR loop count

Postby fir » Fri Nov 11, 2011 5:45 pm

Last question. Is there any negative effects if the cycle loop set too high? For example the software crash or etc.
fir
Freshie
 
Posts: 6
Joined: Fri Nov 11, 2011 7:03 am

Re: PR11 FOR loop count

Postby shahrul » Fri Nov 11, 2011 6:00 pm

fir WROTE:Last question. Is there any negative effects if the cycle loop set too high? For example the software crash or etc.

Software will not crash.. It's just effect your reading performance. If the value high, it's increase reading time.
User avatar
shahrul
Professional
 
Posts: 812
Joined: Sat May 16, 2009 9:54 pm
Location: Selangor

Re: PR11 FOR loop count

Postby ober » Sat Nov 12, 2011 7:23 am

You can change the value of reading, but remember to change the value for averaging right after the loop, which in original sample code, the result_temp is divided by 2000. There is no negative effect, as shahrul said, it will take longer time if the loop is more compared to less sample reading. You can take 1 reading if you like. This is like what we did in bio, physic or chemical lab during secondary school, taking more sample will average out the noise and offer nearer data to real result.
Ober Choo
Cytron Technologies Sdn Bhd
www.cytron.com.my
User avatar
ober
Moderator
 
Posts: 1486
Joined: Wed Apr 15, 2009 1:03 pm

Re: PR11 FOR loop count

Postby fir » Sat Nov 12, 2011 1:16 pm

Thanks Ober and Shahrul, your guys opinion conclude my project. Thanks again
fir
Freshie
 
Posts: 6
Joined: Fri Nov 11, 2011 7:03 am

Re: PR11 FOR loop count

Postby black_smtk » Wed Jul 18, 2012 11:27 am

can someone give me the pwm driver circuit for dc motor? need to control fan speed based on temperature
:roll:
black_smtk
Novice
 
Posts: 21
Joined: Wed Jul 18, 2012 11:23 am

Re: PR11 FOR loop count

Postby shahrul » Wed Jul 18, 2012 11:42 am

black_smtk WROTE:can someone give me the pwm driver circuit for dc motor? need to control fan speed based on temperature
:roll:

You can use motor driver L298 or can use mosfet IRF540 if only use one direction.
User avatar
shahrul
Professional
 
Posts: 812
Joined: Sat May 16, 2009 9:54 pm
Location: Selangor

Next

Return to DIY Project Set

Who is online

Users browsing this forum: No registered users and 11 guests

cron