I tried to read the impulsions using Arduino and BeagleBone Black interuptions but nothing came with that. So I further tried to use an osciloscope to visualize wether impulsions could be read but it seems that I have nothing but a straight line, no impulsions…
What do you guys think about it? Could it be the optical sensor that is just dead?
I performed the step you gave me and I’m happy to say that using a PULL_UP resistor, it works both on the oscilloscope and microcontroller, and I have fancy curves without noise.
Last question, which sampling frequency would be ideal?
As for managing this output, we recommend that you use interrupts. Just make sure to have a proper wiring to prevent noise. If you get spurious signals, you may want to add a filter (resistors, capacitors, inductors) at the input pin.
If you decide to poll the input for the pulses, you will want to over-sample enough so that you do not miss any of the pulses. The first step would be to determine the rate of the pulses.
In this case, the device produces 100 pulses/inches and moves at about 30 inches/s. Therefore, it will produce at most 3000 pulses/s, or a signal that is ~3 kHz. Normally, when sampling a signal, you want to sample at a rate higher than the signal to be able to reproduce it properly / not miss any parts. Many digital systems will over-sample 8 or even 16 times to be certain of the data being read / reduce error rate due to noise.