# Help with RPM project using linear Pot

Hey guys, I'm looking for a method of calculating a stroke speed of a linear pot as a RPM value so that I can trigger a LED if the RPM (or SPM Strokes per Minute?) falls below a certain value.

I have a 100mm linear Potentiometer that I have mapped to values 0-4. I have been trying to figue out a way of reading the RPM as the POT is slid from the low value of 0 to the high value of 4 and back to 0 again. It would have to read both the high value and the low value to insure that it is doing the full length of travel. I would also like it so that I could change the value of the high figure to a lower amount like 3 if I decide i want less travel in the POT before it triggers.

I started thinking about using interrupts but I was unsure if I could change what it would class as the high value so that I could set the low value as 0 and the high value as 2. Most of the interrupt tutorials I have read deal with on/off states and not analog figures.

The expected stroke speed is between 60-120 Strokes per minute.

A little nudge in the right direction would be hugely appreciated

right I think I am closing in on a solution. although will take a fair bit more learning would Analog comparator be the way to go? and would I be able to set two. One to detect the high change then one to detect the low?

oddone87:
The expected stroke speed is between 60-120 Strokes per minute.

Are you planning to move a pot through its full travel 60 - 120 times per minute?
How long will it last?

Assuming that is not a problem what you be wrong with a series of analogRead()s and keeping track of the highest and lowest values? - without bothering with using the map() function.

...R