View attachment 63045
Here's a snippet from the Arduino forum .
If the duty cycle is fixed you can just use the pulseIn() function to measure the length of the pulse. From that you can calculate everything else.
http://arduino.cc/en/Reference/PulseIn 36
#define MICROSECONDS_PER_MINUTE (60UL*1000000UL)
#define PULSES_PER_REVOLUTION 128 /* You'll have to figure this out */
int rpm(int inputPin) {
unsigned long pulseLength = pulseIn(inputPin, HIGH); // Microseconds per pulse
pulseLength = (pulseLength * 100) / 30; // Convert from 30% to 100%
unsigned long pulseRate = MICROSECONDS_PER_MINUTE / pulseLength; // Pulses per minute
return pulseRate / PULSES_PER_REVOLUTION
If the duty cycle is fixed you can just use the pulseIn() function to measure the length of the pulse. From that you can calculate everything else. http://arduino.cc/en/Reference/PulseIn #define MICROSECONDS_PER_MINUTE (60UL*1000000UL) #define PULSES_PER_REVOLUTION 128 /* You'll have to...
forum.arduino.cc
By the way I strongly suggest you ask your questions on all about circuits! They have an order of magnitude more members than this site. They are consummate professionals unlike myself... as you can clearly tell...I am not alone.
View attachment 63043
RPM limiter, speed limiter, title of your thread? Are you open to other suggestions?