# Incremental encoder for measuring system

**URL:** <https://discourse.nodered.org/t/incremental-encoder-for-measuring-system/40890>\
**Category:** General\
**Created:** [12 February 2021 19:34 UTC](https://discourse.nodered.org/t/incremental-encoder-for-measuring-system/40890 "2021-02-12T19:34:29Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![josecruz](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/josecruz/32/37137_2.png) [@josecruz](https://discourse.nodered.org/u/josecruz)\
**Post date:** [12 February 2021 19:34 UTC](https://discourse.nodered.org/t/incremental-encoder-for-measuring-system/40890/1 "2021-02-12T19:34:30Z")

</div>

Hi community.  
Im a newbie to node red and after google a lot, still unable to get a solution or direction.  
I have a incremental encoder with 2048ppr (AMT-103) attached to a moving table that i want to use to make measurements using a Raspberry Pi W.  
The encoder is attached to a leadscrew and when i rotate it (doing it by hand, later on will add a motor) i can move it to the position i want.  
The main goal is to implement a flow that allows me to calculate the distance between 2 points, and therefore getting the distance.  
There will be a factor to define the distance per encoder step in order to get the distance.  
The main doubt is if this can be done in node-red, or if i also need to add encoder coding in phyton?  
If i use a code to get the encoder counts how to get them in node red?

Your expertise is very welcome.  
Hope you guys can help me.  
Stay safe

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [12 February 2021 21:03 UTC](https://discourse.nodered.org/t/incremental-encoder-for-measuring-system/40890/2 "2021-02-12T21:03:09Z")

</div>

> [@josecruz](#):
>
> The main goal is to implement a flow that allows me to calculate the distance between 2 points

You haven't really explained what you are trying to do with the pi. Do you mean the encoder will be connected to the pi and you want node-red to monitor the position and do some calculations? If so that should be ok. Search the forum for encoder, also try the flows site. I am sure there has been discussion of these.

---

<div class="post-metadata">

**Author:** ![josecruz](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/josecruz/32/37137_2.png) [@josecruz](https://discourse.nodered.org/u/josecruz)\
**Post date:** [12 February 2021 21:26 UTC](https://discourse.nodered.org/t/incremental-encoder-for-measuring-system/40890/3 "2021-02-12T21:26:17Z")

</div>

Hi Colin,  
Sorry i didn't explained it very well, and many thanks for the feedback.  
The incremental encoder is connected to the Pi ( Pin2 for channel A and Pin3 for channel B), and i want to use node-red to calculate and display the values.  
I will give another try in the forum.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [13 February 2021 11:44 UTC](https://discourse.nodered.org/t/incremental-encoder-for-measuring-system/40890/4 "2021-02-13T11:44:21Z")

</div>

This looks like a good place to start

> [@Using rotary encoder](https://discourse.nodered.org/t/using-rotary-encoder/29775):
>
> How do I make an rotary encoder work properly in node red? I have multiple inputs and I want to control them using an encoder, any ideias? [image]

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [14 April 2021 11:45 UTC](https://discourse.nodered.org/t/incremental-encoder-for-measuring-system/40890/5 "2021-04-14T11:45:12Z")

</div>

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