Please Help ! Measuring the Speed in RPM using timer

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

I am using a timer and counter for measuring the speed of a motor in RPM. I am not getting the proper connections for counting the incoming pulses.

   

The sensor is mounted on the motor which gives one pulse per rotation. I want to convert it in to RPM. The sensor used is MOC 7811 which is attached in the attachments. Please help me !! 

0 Likes
6 Replies
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

The simplest idea:

   
        
  • use a timer component to create one pulse per second (or use a global signal component to get the pulse-per-second signal)
  •     
  • use a comparator to create a proper input signal from your sensor (e.g. sensor between input and ground, and a resistor between input and Vcc)
  •     
  • use a counter component (UDB), configure as up-counter, capture on input, reload on capture
  •     
  • connect clock to the BUS_CLK
  •     
  • connect the count input to the comparator
  •     
  • connect the capture input to the 1Hz timer
  •     
  • connect an ISR component to the interrupt output of the counter
  •     
  • on interrupt, read the capture value from the counter, multiply it by 60, finished
  •    
   

Any optimization (e.g. do period measurement or reciprocal frequency measurement) is left as excercise to the reader 🙂

0 Likes
lock attach
Attachments are accessible only for community members.
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

 Some basics -

   

 

   

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

@dana: counting the number of questions regarding frequency measurement in the last time, you should compile your answers together and prepare an appnote 🙂

0 Likes
Anonymous
Not applicable

 Then in adition to comunity components we could have Comunity App Notes too. 

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

@hli, basic ap note like this should come out of Cypress in my humble opinion,

   

and cover various ways with a counter one can do the measurements. Take into

   

account timing, max count rates for method chosen.

   

 

   

Last person to do it, was quite instructive, was Dave Van Ess on PSOC 1.

   

 

   

My vote is Cypress do it.

   

 

   

Regards, Dana.

0 Likes
HeLi_263931
Level 8
Level 8
100 solutions authored 50 solutions authored 25 solutions authored

@dana: I should use larger smileys...

   

Surely such AppNotes should come from Cypress, especially when the question gets asked so otfen. But I just saw that you always provided so much useful information for this topic. Maybe I should compile a blog post out of this, since I already have one explaining the CPLD implementation of a reciprocal counter...

0 Likes