• Spring 2024 meetup in Calgary - date Saturday, April 20/2024. discussion Please RSVP Here to confirm and get your invitation and the location details. RSVP NOW so organizers can plan to get sufficient food etc. It's Tomorrow Saturday! you can still RSVP until I stop checking my phone tomorrow More info and agenda
  • We are having email/registration problems again. Diagnosis is underway. New users sorry if you are having trouble getting registered. We are exploring different options to get registered. Contact the forum via another member or on facebook if you're stuck. Update -> we think it is fixed. Let us know if not.
  • Spring meet up in Ontario, April 6/2024. NEW LOCATION See Post #31 Discussion AND THE NEW LOCATION

Bridgeport Mill Tachometer

Tom O

Ultra Member
Have you tried looking at Solarbotics here in Calgary they are situated around 32Ave and 12St in the north.
 

YYCHM

(Craig)
Premium Member
Have you tried looking at Solarbotics here in Calgary they are situated around 32Ave and 12St in the north.

Yup... kind of pricey. I got a switch, enclosure and 9V battery holder there.

 
Last edited:

whydontu

I Tried, It Broke
Premium Member
still working on my mill controller, ran across a MUCH better tachometer framework. This library uses the main system clock to measure microseconds between pulses, takes maybe ten pulses and averages the time.

(correction - 30 pulses, should have read the code)

In testing it can easily track from1 Hz to 2500 Hz with good accuracy. 60 RPM to 150k RPM with my single trigger per revolution. Is not affected by other code in the loop, which I proved by adding a delay-flash-an-LED-delay after the frequency function, and changing the length of delay has no effect on accuracy.


The library is available in the usual Arduino <Manage Libraries> menu.

Here's my testing code:

#include <FreqMeasure.h>

// pin 8 is input

void setup() {
Serial.begin(57600);
FreqMeasure.begin();
pinMode(LED_BUILTIN, OUTPUT);
pinMode(8, INPUT);
}

double sum=0;
int count=0;

void loop() {
if (FreqMeasure.available()) {
// average several reading together
sum = sum + FreqMeasure.read();
count = count + 1;
if (count > 30) {
float frequency = FreqMeasure.countToFrequency(sum / count);
Serial.println(frequency);
Serial.println(frequency *60); // converted to RPM
sum = 0;
count = 0;
// otherstuff
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(10); // wait a bit
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(10); // wait a bit
}

}
}
 
Last edited:

deleted_user

Super User
still working on my mill controller, ran across a MUCH better tachometer framework. This library uses the main system clock to measure microseconds between pulses, takes maybe ten pulses and averages the time.

(correction - 30 pulses, should have read the code)

In testing it can easily track from1 Hz to 2500 Hz with good accuracy. 60 RPM to 150k RPM with my single trigger per revolution. Is not affected by other code in the loop, which I proved by adding a delay-flash-an-LED-delay after the frequency function, and changing the length of delay has no effect on accuracy.


The library is available in the usual Arduino <Manage Libraries> menu.

Here's my testing code:

#include <FreqMeasure.h>

// pin 8 is input

void setup() {
Serial.begin(57600);
FreqMeasure.begin();
pinMode(LED_BUILTIN, OUTPUT);
pinMode(8, INPUT);
}

double sum=0;
int count=0;

void loop() {
if (FreqMeasure.available()) {
// average several reading together
sum = sum + FreqMeasure.read();
count = count + 1;
if (count > 30) {
float frequency = FreqMeasure.countToFrequency(sum / count);
Serial.println(frequency);
Serial.println(frequency *60); // converted to RPM
sum = 0;
count = 0;
// otherstuff
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(10); // wait a bit
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(10); // wait a bit
}

}
}
that is the best method of sampling to achieve fast and accurate rpm returns
 
Top