Eagle tree V2 RPM sensor for brushless motor ARDUINO

Hi,

Has anyone tried recording RPM measurements using an Eagle Tree Optical RPM Sensor ? For a project i need to mesure the RPM of my brushless motor.

My code :


// FREQUENCE INPUT PIN => pin 5 pr aduino uno
#include <FreqCount.h>
int RPM;
int count;
int nb_pole=14;

void setup() {


Serial.begin(9600);

FreqCount.begin(1000); //intervale de mesure en millisec

}

void loop() {
if (FreqCount.available()) {
unsigned long count = FreqCount.read();

//RPM=(count*60)/nb_pole;

Serial.println(RPM);



}
}


Actually i have only bad values.. When the motor is stopped i have "50".

Thanks

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Activity