Electronic – Read Quadrature encoders over I2C bus

encodermotionquadraturerobotics

I need to add encoders to the 4 motors attached to a "remote" PCB. The remote PCB in question does not have microcontroller on it, but rather is connected to the microcontroller PCB with an I2C connection (yes, using a differential I2C amplifier). Because of limitations in the cabling I only have the I2C connection between these PCBs.

So, I need to read 4x quadrature encoders over I2C. Some options and their associated issues:

  1. Read encoders with microcontroller using interrupts. This seems to be the most common method. However, I don't have a microcontroller on the remote PCB, so this doesn't work.
  2. Use a Quadrature decoder chip like the LS7266R1, LS7267 or other dedicated chip. However, these chips don't seem to be available on any vendor on Octopart, and they are expensive and they don't have an I2C interface.
  3. Build a quadrature decoder out of a D flip-flop and a counter and connect to an I2C IO expander: There seem to be a ton design issues with the build it myself approach: More flip-flops and NAND gates are needed to get full quadrature resolution and counter stability, counters on digikey only come in 4-bit and 8-bit versions (why are 8-bit counters rare and >$10 each?), … all of this adds up to more cost and complexity than just adding a microcontroller.

Is adding a microcontroller to my remote PCB the best way? Why isn't there an easier way to do this? Given the number of digital encoders in the world, I'm surprised there isn't more available.

Best Answer

However, I don't have a microcontroller on the remote PCB.

So put one there!
It is exactly for this type of application where tiny micro controllers are great. There are lots of 8 pin chips which are far, far cheaper then the $10 you mention. You can even implement 10, 12 or 16 bits if you want and have a choice of interfaces you can use to send data upstream.