Pages: [1]   Go Down
Author Topic: Help with rotation sensor  (Read 1494 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 620
Posts: 33997
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 620
Posts: 33997
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Can you give one pls?
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 620
Posts: 33997
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Can you not use google?

http://tushev.org/articles/arduino/item/51-measuring-frequency-with-arduino
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

thx
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?

* code.txt (0.69 KB - downloaded 17 times.)
Logged

New Jersey
Offline Offline
Faraday Member
**
Karma: 67
Posts: 3681
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Offline Offline
Newbie
*
Karma: 0
Posts: 15
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

it works, thanks
Logged

Pages: [1]   Go Up
Jump to: