cancel
Showing results for 
Search instead for 
Did you mean: 

Convert encoder output voltage (5 and 24 volts) to 3.3v to use in STM32f4 Timer in encoder mode

Nmo.1
Associate III

Hello everyone.

I have 2 incremental encoders. One of them has the output voltage of signals A and B 5 volts and the other one 24 volts.

I need to count the increments with stm32f4 and timers in the mode encoder.

But I have to first convert the 5 and 24 volts to 3.3.

Can I use a comparator like LM393? Does it support high frequency of the encoder?

Or do you have any other suggestions? I also tried Voltage Divider but it didn't work.

Thank you so much.

1 ACCEPTED SOLUTION

Accepted Solutions
Peter BENSCH
ST Employee

You can convert either with a level shifter, or with a comparator you mentioned (of course with suitable dimensioning). It depends on the frequency of the encoder signal what is to be used, e.g. type of comparator.

A simple voltage divider will not work for various reasons, including because capacitive effects distorting the signal, and the encoder has an output resistance that must be taken into account.

Regards

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

View solution in original post

1 REPLY 1
Peter BENSCH
ST Employee

You can convert either with a level shifter, or with a comparator you mentioned (of course with suitable dimensioning). It depends on the frequency of the encoder signal what is to be used, e.g. type of comparator.

A simple voltage divider will not work for various reasons, including because capacitive effects distorting the signal, and the encoder has an output resistance that must be taken into account.

Regards

/Peter

In order to give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.