I am tried to make a rotation counter (for measuaring the rotation of a wheel) by IR TX and RX based. I am using 8051 controller using keil c51 compiler
My problem some time the measuring or counting is not detecting . Some times shows 3 roation for seeing one rotation
I am using to display in LCD
please correct me . the code and proteus file is following.
What RPM speed ? or pulses per second ?
You don't use debounce of RX detection ?
so you can get bad detections
RX must stay enough time to 1 , to valid this information
maybe recheck after a litle delay of any µSec...
if Rx==0 you spend a lot of time with all instructions to do !
so you can miss some information
Best way is to use interrupt treatment !
RB0 as RX pin ? and interrupt on RB0 ..
and deboucing by hard or soft.
What about mechanical design ?
and ambiant light ?
Actually It havent correct RPM because the fan rotated by hand (not a fan a shaft manually roatating) . want to sense the what is the rotation completed .
I am not using PIC I use the basic 89s52 controller .
I have a development board with IRX and IRf so doing on it .
But am testing it in proteus as switch instead of IRX .
this could works fine only if your PIC input is trigger type ... because of slow rampe of voltage
Software filterring is maybe a better solution..
Other advises ?
this could works fine only if your PIC input is trigger type ... because of slow rampe of voltage
Software filterring is maybe a better solution..
Other advises ?
I changed the infrared module ,And now working properly the module .
But the i fell the counting is wrong . Because, If I increase the speed of shaft (the rotating shaft to count ) the counting is not up the corresponding increase .
I thinks It takes some times to detect the next detection .
Why so .
max speed in RPM may be up to 300 Rotation /minute. 5 rotation per second so 5 Hz.
Period is 1/5 = 20milli second per rotation
Detection range I didnt know how to understand it .
The following module am using
Is the library function sprint() take more time ? do i need to change that ?
Am updating the LCD data each detection ,Is that any problem
Yes, i think so..
The only way to solve that,is to use interrupt ...
Count the pulse into the interrupt treatment, outside the main program .
In the main program , display the result, without any constraint of execution time
Maybe you can try to enlarge the area detection to 50% .. 180°