Go Down

### Topic: Counting rpm (Read 5467 times)previous topic - next topic

#### dhenry

#15
##### Oct 16, 2012, 12:58 pm
" would use 100K."

Be careful there. The pin's input capacitance is about 7pf. With a 100k resistor, the cut off frequency is about 200khz. For a 10 teeth wheel, that means the shaft cannot rotate more than 20krpm - many dc motors can go that fast.

And if you factor in parasitics, that number is even lower.

This is a case where the resistor should be as low as possible.

#### gardner

#16
##### Oct 16, 2012, 03:09 pm
I was suggesting using a 5V zener diode to clip the top of the waveform and the negative part.  Then the resistor can be small - 330R or something, since problematic voltages go through the zener to ground.

If you then feed the resulting waveform into a comparator with the reference voltage at 0.5V or 1V, and you should get a nice clean square wave.

#### Dyslexicbloke

#17
##### Oct 16, 2012, 04:28 pm
Thanks for the correction Peter, its always good to learn.
If I knew where the box was I would probably still want to think outside it!

Feel free to be blunt ... Its how I learn.

#### serbar

#18
##### Nov 16, 2012, 11:04 pm
Hi.

I made the circuit on the atached file, and collected the following oscilogram.

1. Do you suggest some improvements on this for noise or something else?

2. How can i count this pulses on arduino?

Thanks.

#### serbar

#19
##### Nov 16, 2012, 11:11 pm
Sorry for the huge image of the oscilogram...

I collected the oscilogram with chanel A at the output of LM 393 and gound, and chanel B (they are superimposed) at input of non inverting input and ground.

Horizontal scale- 1 ms/div

Vertical scale - 5 V/div

The sensor is inductive pick up and has one terminal connected to ground.

By the way, why are the negative pikes smaller than the positive ones?

PS: This is my first circuit with ampops.

Thanks.

#### serbar

#20
##### Dec 24, 2012, 10:30 pm
Allready wrote a sketch for this to work, and it works fine. Some noise when i disconnect motor on the op amp but i will study something to avoid this.
Code: [Select]
volatile float npulse=0;
volatile int  freq=0;
volatile int rpm;
//////////////////////////////////////////////////

void setup()
{
Serial.begin(9600);
while(!Serial){
;
};

pinMode(2,INPUT);

digitalWrite(2,HIGH);

attachInterrupt(1,react,FALLING);
}

//////////////////////////////////////////////////////

void loop()
{
if (freq<1500)

{

Serial.println("Frequencia do sinal");
Serial.println(freq);
Serial.println();

Serial.println("Rot por segundo");
Serial.println(rpm);
Serial.println();

Serial.println("Rot por minuto");
Serial.println(rpm*60);
Serial.println();
Serial.println("---------------------------");

delay(1000);
}
else
{
Serial.println();
Serial.println("RPM maximo atingido");
Serial.println("---------------------------");
delay(3000);
}
}
/////////////////////////////////////////////////////////

void react()
{
volatile float n2pulse = micros();
volatile float ndentes=10;

/////////////////////////////////////////////////////////

freq=1000000/(n2pulse-npulse);

rpm=1000000/(ndentes*(n2pulse-npulse));

//rpm*=60;

npulse = n2pulse;

}

///////////////////////////////////////////////////////////////

#### Darshandarshu

#21
##### Mar 20, 2016, 01:34 pm
Can anyone help me out in finding a inductive sensor that can suit to calculate the rpm of cvt  and it's average rpm is 3800 .considering the temp and other factor like input voltage I need a prefarable sensor .

#### aarg

#22
##### Mar 20, 2016, 01:46 pm
A four year old thread... that is a serious necro! Did you see the warning message before you posted?
... with a transistor and a large sum of money to spend ...
Please don't PM me with technical questions. Post them in the forum.

Go Up