What kind of sensor I have to huse?

Hi, As I said in the other topic, I'm building something... it doesn't matter what :grin: :grin: So, I need to put a sensor in a roll that can say to me how many "turns" make the roll.

I thought of a magnetic sensor or an infrared sensor, which you advise me and why?

Thanks

Yes, either of those will work to measure the number of revolutions.

thanks... but what you think is better?? The revolution can come to 9600 rpm, can i have some problem with one of those one?

Hall effect magnetic sensors are commonly used for measuring rotation, since the only moving part is a magnet (or just a piece of iron).

cntntn: The revolution can come to 9600 rpm, can i have some problem with one of those one?

That's only 160 counts per second; not a problem. A hall sensor will also be more than capable of that rate.

thanks... I'll buy that http://www.futurashop.it/pdf_eng/1350-SS495A.pdf, you think it's ok?

I bought A1302 EUA hall sensor. I have attached the datasheet.
I tried to connect it on arduino as in the scheme attached, and with this code:

const int hallPin= 4;

void setup() {
  Serial.begin(9600);
  pinMode(4, INPUT);
}

void loop() {
  int sensorValue = digitalRead(4);
  Serial.println (sensorValue);
}

but with the serial monitor I have alway 0. why?

datasheet A1302 EUA.PDF (293 KB)

You need to attach it to an analog pin and get a reading that way, see here: http://arduino.cc/playground/Code/HallEffect

You may be better off getting a hall switch instead of a full linear analog device, then you just have to have it close enough and you'll get a definitive 0 or 5v don't forget you need a pullup and that pay attention to the pinout the smd is different than the thru hole one, I've burnt one before I figured that out with your sensor you will have to detect the peak and besides analog reading take more time Google or ebay search hall sensor switch, they are usually cheaper actually (I bought by accident once thinking they were the linear kind)

One more note, The A1302 is a ratio metric device, the quiescent (No Mag field) is approx Vcc/2. As the other gentleman suggested you might do better with a Hall effect Switch if an On / Off sense is needed, although a pair of those A1302’s and containment (pole pieces for shielding) would make a nifty coarse position or X/Y indicator as the output polarity changes with magnetic polarity @ +/-2.5mV per N/S Gauss change in polarity or intensity, A1301’s will give a +/-1.3mV / N/S Gauss change. I bought a couple from eBay for $2.00 or $3.00 and had great fun with them. I thought to make a ‘unique mag key’ with one and an op-amp for level shifting (Decode) small coil of wire (solenoid)/ LM350T (encode) and two Arduino’s for encode/decode… I do hope this is useful information…
From the Allegro Data Sheet @ (1.508.853.5000; www.allegromicro.com)

Doc

Focusing on the device he has now, supplied with 5V the sensor should have an output of 2.5V (digital high) with no magnetic field near it. He’s getting a low.

Unless the sensor or Arduino pin is fried the only possibility I see is that it’s wired backwards.

wildbill: You need to attach it to an analog pin and get a reading that way, see here: http://arduino.cc/playground/Code/HallEffect

thank you... it works nice... :D