Multiplexing analog inputs & servos outputs?

Hi.

I've got two questions. First - is there a multiplexer for analog inputs, or do I have to use smultiplexed A/C converters and read it on the digital pins/serial? I want to read way more than 6 potentiometers.

Second - how to control more servos than I have pins? It should be less complicated, but since the servo is controlled by the length of the signal - do I have to send signal, then wait for it to end, then set output to another servo and then send signal? Maybe I could use some sort of servo controller?

A 4051 will give you eight analogue inputs for the cost of three digital outputs and one analogue input.

For the servos, it sounds like you need an external controller.
Have you thought of using a Mega?
How many servos did you have in mind?

Well... let's say I was only wondering, how complicated would it be to make servo-based robo-hand which could follow the moves of a hand in special glove. That's... five fingers, 3 joints each... 15 servos and 15 potentiometers (or similar joint-bend sensors).

And in the perfect world it could be driver with 4 pins:

  • potentiometer number (serial input)
  • potentiometer value (analog input)
  • servo number (serial output)
  • servo value (serial output)

:smiley:

But I'm sure it can't be easily done like that :slight_smile: thanks for the reply.

Take a gander at http://openservo.com/

OpenServo is an open community-based project with the goal of creating a high quality digital servo for robotics.

Some of the many features of the OpenServo include:

  • High performance AVR 8-bit microcontroller
  • Compact H-Bridge with high performance MOSFETs
  • Precision control over servo position and speed
  • I2C/TWI based interface for control and feedback
  • Feedback of position, speed, voltage and power
  • Advanced curve based motion profile support
  • EEPROM storage of servo configuration information
  • Software written in C using free development tools
  • I2C/TWI bootloader and GUI programmer

That's... five fingers, 3 joints each... 15 servos and 15 potentiometers (or similar joint-bend sensors).

Have you looked at your hand?

The vast majority of people -can't- bend their fingers at each joint independently; the control isn't evolved that way. Certain fingers can't even be bent independently without causing some movement of other fingers. YMMV, but this is generally how it is.

Now, it is possible to bend the second/third joints independently of the first joint on the fingers/thumb...

That effectively reduces your needs to 10 bend sensors (and really, you're going to want to use a bend sensor, not servos - why make it difficult on yourself?), but you could get away with 5. There is also what is known as "abduction", the side-to-side movement of the fingers and thumb; depending on the level of sensing needed, you could get away with as little as a single bend sensor between each finger, plus a couple on the thumb (located carefully).

What you're going to find, though, whatever method you use, is that the glove material is going to slide around. Good luck with that, it has plagued wired glove engineers for over 20 years (you have researched wired gloves, right?).

Your best best is a lycra glove, and to use optical bend sensors, which are essentially a fiber optic loop (sans jacket, and scored with marks to let out light as the fiber is bent) with an IR LED at one end, and a phototransistor at the other, connected to an amplifier, that can sense the bending of the joint via the light loss out the score marks (which reduce internal reflection). The phototransistor/amplifier is set up so that the output is a varying voltage signal, rather than a simple on/off signal (ie, the base of the phototransistor isn't driven to saturation, but acts more like one would in an audio amplifier).

This is the basics of a wired glove; essentially the idea and workings behind the VPL DataGlove (I am pretty sure the patents are expired now), sans some complex software (and this doesn't address position tracking of the hand/arm, which was originally done via expensive magnetic 3D tracking). There are other methods to sense the bending (resistive strain gauges, like used in the Mattel/Nintendo PowerGlove, as well as hall-effect sensors as used by another "exoskeleton" glove, IIRC, at CMU), but the lycra glove and optical bend sensors are a lightweight and fairly simple solution that is easy to put on and take off.

Even so, you are still going to be faced with the issue, over time, of the glove material shifting on the fingers and hand, necessitating their repositioning and recalibration. This may or may not be an issue for you in your application.

A possibility to consider, though, is using a PC and a high-speed USB web camera to track the position of the fingertips and hand using video; if you combined two or more camera outputs, you could potentially track everything in 3D (you need more than 2 cameras to do this effectively, because of potential occlusion issues). The hardware is the easy part, though (you would put IR LEDs or IR reflectors with an external IR source on the fingertips) - its the software that would be the killer. Tracking ten independent "blobs" of light in 3-space using a computer and few web cameras to intergrate the data isn't anywhere near as easy as it sounds. OpenCVS or other vision software and/or vision processing techniques will be paramount to success. It can be done, though, since there are plenty of (expensive) optical full-body motion capture systems out there used by companies for a variety of applications.

Good luck with your task, but you honestly have a lot of research and hard work to do. It is an area that could pay off fairly well if you see it to the end, though!

:slight_smile:

The below sparkfun multiplexing board is a good value for 16 inputs to an arduino analog input. If you want to control a lot of servos, get a servo control board that controls lots of servos and control it with the arduino.

http://www.lynxmotion.com/Product.aspx?productID=395&CategoryID=52

I want to read way more than 6 potentiometers.

This is an example of reading 16 analogue inputs that can simply be extended to 48 inputs by adding more multiplexer chips and feeding them into the other analogue inputs of the arduino:-
http://www.thebox.myzen.co.uk/Hardware/MIDI_Footsteps.html

Thanks for the links. Just to be clear - It was only an idea. I don't have enough time to build thing like that, but every time I think of something, I try to find solution.

Here - the problem was the amount of sensors and servos, so I asked, how to solve it. Maybe I'll need it someday. Not the artificial hand, I hope - I meant the general solution for that kind of problem.

I am using Mark Mayhews mux shield (Mux Shield | Mayhew Labs) on my home automation/security system. (Stacy's Arduino: Mux) 48 analog io for 4 digital and 3 analog pins. Unfortunately he is now out of stock. Maybe you could shoot him an email and he might have one laying around or one of his new design he can sell you.