Absolute Encoder takes too many PIN slots

Hi, I'm new here and I have a problem regarding my project.

I'm going to create something like a robotic arm using a BLDC Motor. I'm going to control it by using position control method.

So, I attach the Absolute Position Encoder to the Motor Shaft and use the reading as a Feedback to the determined Set Point.

The problem is, the absolute encoder takes too many slots.

Even though I use Arduino Mega (which has a relatively lot of pins), the Absolute Encoder itself takes like 9-10 pins because of the reading is like (2^1 + 2^2 +2^3 +...) about 7 bits or so.

It might be barely enough if I only use one set of encoder and driver, but the thing is, I need to control 3 sets of Encoders and Motors (It's a robotic arm, which arm only has one joint?)

Is there a way to simplify the 7 or so cables (of the Encoder) into like one or two pins? Or do I have to use Pin Expander as there's no other way?

Or is using triple Arduino for three separate sets of Motor and Encoder a viable option?

Please enlighten me: smiley-cry:

Many thanks!

Shift registers can be handy for this purpose. Just a few pins on the Arduino for as many input pins as you want. It just takes programming and most of that is already supplied.

but the thing is, I need to control 3 sets of Encoders

You don't control encoders you read them.
It is possible you could multiplex the three but as you haven't said what encoders you have, who knows.

vaj4088:
Shift registers can be handy for this purpose. Just a few pins on the Arduino for as many input pins as you want. It just takes programming and most of that is already supplied.

I think I read it somewhere else, but I thought using a shift register for a continuous reading isn't really good?

Maybe you can clear my misunderstanding on this part.

Grumpy_Mike:
You don't control encoders you read them.
It is possible you could multiplex the three but as you haven't said what encoders you have, who knows.

Yeah, what I meant is 3 sets of Motor and Encoder, what I use is an Optical Encoder with 7-8 bits

Still haven't said what encoders these are so we still don't know if you can multiplex them directly.
You could use four 74L153s to act as an input multiplexer.

I think I read it somewhere else, but I thought using a shift register for a continuous reading isn't really good?

So the option of not reading them at all is better?

What about I/o expander chips? They have 8 or 16 inputs and can monitor them for changes and interrupt the Arduino when that happens so they can be read. The most common type use i2c bus but if that is not fast enough there are SPI bus chips also.

Example would be pcf8574 which has 8 pins, interrupt output, i2c bus and up to 8 chips can be used on the same bus.

ardaputra wrote (in part):

I think I read it somewhere else, but I thought using a shift register for a continuous reading isn't really good?

Arduinos are discrete in time and discrete in value, so I do not understand what "continuous" means in this context.

In any case, shift registers and/or multiplexers should be fine with absolute encoders as long as the voltage levels are acceptable.

Thank you for the answers, I decided to buy another Arduino because multiplexing seems rather difficult.

cheers!

ardaputra:
Thank you for the answers, I decided to buy another Arduino because multiplexing seems rather difficult.

cheers!

Oh dear, you will never learn anything with that approach. You then have the much bigger problem of getting the two to communicate in a seamless manor and you have two codes to change to make changes. It is a very short sighted approach, especially as the answer could have been simple if only you had answered the f***ing questions you were asked.