Ways of interfacing a speed sensor (phototransistor) with a microcontroller

Alec_t

Joined Sep 17, 2013
14,280
Depends on Vcc and whether or not you have a use for the other gates in the 74HC14 package. Both circuits will do the job, but note that the 74HC14 has an absolute maximum supply voltage of 7V.
 

Bordodynov

Joined May 20, 2015
3,177
Simply the circuit on the two optocouplers is much faster than on one. Although, as I understand it, you do not need it. But I modeled one of the options discussed.
 

joeyd999

Joined Jun 6, 2011
5,237
Or you can just connect it directly to the input, depends on the need for fast edge transitions.
Many MCUs have built-in comparators and adjustable references on chip. Often, the comparator output can be configured to also control one or more timers with very little code.

I try to eliminate as much analog front-end as possible these days. It makes for more flexible, lower-cost, and higher reliability designs.
 

MaxHeadRoom

Joined Jul 18, 2013
28,619
I use the slot opto's connected directly to the Micro input, either a 10k pull up or down as needed.
Usually used in conjunction with the TMR1 external clock in.
There is also the pic18F2331/4431 that has inputs geared to encoder input, quadrature etc.
Max.
 
Last edited:
Top