Skip to main content
Nmo.1
Associate III
November 28, 2021
Solved

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

  • November 28, 2021
  • 1 reply
  • 1361 views

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.

This topic has been closed for replies.
Best answer by Peter BENSCH

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

1 reply

Peter BENSCH
Peter BENSCHBest answer
Technical Moderator
November 29, 2021

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.