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

Alec_t

Joined Sep 17, 2013
10,267
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.
 

Sensacell

Joined Jun 19, 2012
2,428
Or you can just connect it directly to the input, depends on the need for fast edge transitions.
 

Bordodynov

Joined May 20, 2015
2,353
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.
 

Thread Starter

Xavier Pacheco Paulino

Joined Oct 21, 2015
724
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.
Alright, got it. But I just have one phototransistor, so your model U8 is the one suitable even though is slower.
 

joeyd999

Joined Jun 6, 2011
4,231
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
18,863
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