How to coding the draw wire encoder

Help me please!!
I want to measure length by the draw wire type encoder via ESP32. I've tried to received the analog data by simple code but it didn't work.
*I use draw wire encoder, which is 2 output data.
This is my wiring diagram and the output from the draw wire encoder.

Any example code would be appreciated.

Do you have a data sheet for the encoder? Please post it or a link to it.

Can you post a photo of the label so that we can read it?

Without some way to track down the pinout, output configuration and other information I don't know how we can help.

Thanks for replying.
This is all the specification that I've got and I already uploaded more details on my post.

In order to know if it is a pot or encoder, the PPR, output type, etc. we need to know the full model number off of the label on your device. That is why I asked for a photo of the label.

CWP = potentiometer.
S = 0 - 2000mm
1500 = 1500mm max range
V = 0 - 10V voltage output.

Red 24V supply, Black supply ground, Yellow 10V output, White output ground.

You will need a voltage divider on the 10V output to drop the voltage to less than 3.3V to be fed to an analog input. I have little experience with the ESP32, but have read that the analog to digital converter in the ESP32 is not the best. Here is a tutorial on the ESP32 ADC.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.