Go Down

Topic: Help with rotation sensor (Read 1 time) previous topic - next topic

i_dont_know

I am starting with arduino and I need to do a rotation sensor with a inductive sensor. I never ever program before and I would like to know how I can started.

My program needs to read a rotation in RPM or RPS and write a txt with this. If I can I would like to transfer the data to serial port.

Anybody here can help me?

Grumpy_Mike

Sorry we need a bit more information than this,
What is the sensor? A link perhaps.
Exactly what does "and write text with that" actually mean.
What sorts of speeds are you expecting to read?
What equipment do you have?
What environment will it be in?

If you have ever programmed before start off doing some tutorials before trying something new.

i_dont_know

The sensor is that: http://www.relkocz.com/katalogy%2Fschneider%2Ftl3%2F31114.pdf

It will work on 1000 rpm.

I already can see a 1 or 0 on my pc, but i dont know how i can count the pulse and write on a .txt.

Grumpy_Mike

Wowi last used those sensors back in 1968. And one thing I did with them was make a RPM sensor, so yes they will work at that sort of speed.
The arduino can not write text files because it has no place to write them.
Basically get the sensor to trigger an interrupt on pin 2 or 3 and then have the interrupt service routine make a note of the millis counter each time it is triggered. The time between pulses then gives you the rotation speed.
There are lots of examples if you just google arround.




i_dont_know

I did the sensor and it is work, but my program only show the frequency like a integer number. I need the program shows the decimal part of frequency, anyone can help me?

wildbill

It's doing integer arithmetic. Try:
Code: [Select]
  freq=1000000.0/(n2pulse-npulse);


Go Up