Opto-interrupter (arduino)

Sensor

You could just purchase a couple of H206 opto interrupters and wire them up to your microcontroller, however you’d probably wouldn’t be satisfied with the results. That’s because in the real world the output pulses directly from the phototransistor are poorly formed and as a result your code would end up giving a lot of errors.

Add an LM393 Comparator

in the real world the output pulses directly from the phototransistor are poorly formed and as a result your code would end up giving a lot of errors.

What is needed is a way to clean up the output a bit and generate some nice clean 5-volt pulses suitable for using with an Arduino or other microcontroller. And the perfect component to do that is a “comparator”. => These sensors are often called “LM393 Speed Sensors”.

Wheel sensor & interrupt

If you want to detect a voltage threshold with a microcontroller in a timely fashion, you normally use an external analog comparator chip to generate a digital signal to feed to one of the microcontroller interrupt pins. You can get a quad-comparator for a few cents (LM339) - forum

Digital Sensor Model

Analog Sensor Model

caption

  • LED indicator
  • G -> GND
  • S -> analog signal
  • V -> 3.3 or 5V ?

<4 mm opening

Written on August 6, 2019, Last update on August 7, 2019
arduino