LM358 + hall effect detector KMZ10A = Tachometer

Hello,

I want to measure a speed of rotation of the shaft of a turbine with 6 blades with a mounting Arduino MEGA + magnetic sensor KMZ10A + LM358.

The different measurements to tilt allows me to deduce that 1000 rpm represents 100 Hz output of the Op Amp, with a minimum of 50 Hz to rest and a change in the output frequency from 6000 rpm / min or about 10 Hz 1000 r / min:

6000 rpm / min = 60 Hz
7000 rpm / min = 70 Hz
8000 rpm / min = 80 Hz
....

I think attachInterrupt use the function and the CHANGE function.

Can you help me for code part because I dry a bit, thank you.

That's a raw bridge sensor, you may find things a lot easier with a hall switch chip,
direct logic output.

However how much field strength do you have to play with? That device is
sensitive (more so than a hall sensor) which may be important if the turbine
blades are some distance from the sensor.

Have you searched these forums for other rpm counters? Your proposed method
is analog so interrupts won't help. Perhaps you need a comparator or to use
the built-in comparator?

Thank you for the reply but I do not really understand. from measurements taken at oscilo, I have a signal proportional in frequency to the rotational speed, how do I retrieve this signal, the process for displaying the speed per minute?

Yes I searched the forum but everyone uses standard methods, maisn this does not work with my solution

In my application I calculate the power by counting the timeticks between the energy pulses from an energymeter (P = E / t).

You can calculate the rotational speed by meauring the timeticks betwee the passes of the rotorblades (rpm = x / t).

Some fragments out of my code:

  • kWh-puls on IRQ0 (pin 2)

//Prepairing IRQ0 for energy pulse
pinMode(2, INPUT); //kWh-takt via IRQ0
digitalWrite(2, HIGH); //Pull up resistance
attachInterrupt(0, FixPeriodtime, FALLING);

unsigned long ulngTimecounter, ulngCount; //Counts millis between IRQ0 to measure periodtime for energypulse

//Initialize Timer5, preset to 1000 Hz timetick
TCCR5A = 0;
TCCR5B = 0;
TCNT5 = 0;
OCR5A = 15999; // compare match register 16MHz/16000 = 1000 Hz
TCCR5B |= (1 << WGM12); // CTC mode
TCCR5B |= (1 << CS10); // 1 prescaler
TIMSK5 |= (1 << OCIE5A); // enable timer compare interrupt
interrupts(); // enable all interrupts

sngPfi = (3600sngEnergypulse)/(ulngTimecounter0.001); //Calculate Pfi in [W]

ArduinoStarter1:
In my application I calculate the power by counting the timeticks between the energy pulses from an energymeter (P = E / t).
You can calculate the rotational speed by meauring the timeticks betwee the passes of the rotorblades (rpm = x / t).

Not quite. That would be for only one blade. There are six. So the formula would be rpm = 1/t/6*60 where t is the interval between pulses (by the way, why not avoid confusion and use RISING or FALLING instead of CHANGE, which will double the frequency?).

Measuring t in microseconds, It's 1,000,000/t/6*60. That is, if you are using a timer that increments once every microsecond, at 60 rpm = 1 rps you will see a delay of 1,000,000/6 = 166667 timer ticks.

Plodding through it forwards this time,
t = 166666
(integer) 1000000/166666 = 6 blade passes per second
6/6 = 1 revolution per second
1*60 = 60 rpm

Quick edit - as you can see there are several constants that should be combined. When using integer calculations, it would be best to use (1,000,000*60/6)/t. Otherwise there will be unnecessary loss of precision.

Thank aarg,

I understand but treat this? which code to process the signal and calculate the signal?

Thank you for your help?

here is the solution for measuring speed: :smiley:

 if (rpmcount >= 100){                            
    rpm = 1000000*60/(micros() - timeold)*rpmcount;
    timeold = micros();
    rpmcount = 0;
    Serial.println("EGT :"); 
    Serial.println(rpm, DEC);