Best product to connect 5 ADXL335 and one MPU-6050

Hi all

I am new to Arduino and electronic in general, but got the idea to explore more this world (I used to build kits when I was 12, simple stuff like filters and such).

I am planning to make something usable as mocap device just for the hands; I work a lot with animations in 3d that require precise rendering of the real movement (it is an application for hand sign language, but it can be used technically for anything that uses hands movements).

I settled on the idea to use 1 gyro to find the overall position in space of the hand, and 5 accelerometers to measure position and movements of each fingers, related to the gyro (so it is easier to actually get the position in space for each finger, trough interpolation and inverse kinematic). I want to use I2C as bus; altho the problem seems to be the 335 sensors, which uses the same address, from what I can understand reading online.

Now, I need something to drive these sensors, so I can plug this glove to my computer and I can basically record the hands movements on a 3d rigged model of a hand.

Which product would allow me to control the sensors and achieve this peripheral? I've seen big rigs for full body mocap, like the animazoo and similar, but very few were made just for the hands; so I thought that I could just build mine (plus I love to write code). Unless there is something already out there that I can base my project upon, but the few ones that I found, were using resistor strips for the fingers, not sensors.

Would be enough something like an Uno, or can I use something smaller? All the calculation would be done on the computer running the capture software.

Thanks!

The Arduino Uno is the easiest board to start with to make a prototype. To interface with a computer as if the Arduino board is a mouse, you need the Arduino Leonardo or Arduino Micro.

This is what a prototype looks like with 2 accelerometers: http://hackaday.com/2012/05/04/sign-and-speak-glove/

Does this project use induvidual finger accelerometers ? http://www.mielelab.org/projects/wearabraille

This one has accelerometers on the fingers: http://www.embedds.com/virtual-keyboard-from-acceleration-sensing-glove/

You plan to use 5 analog accelerometers ? 5*3 is 15 analog signals. That is too much analog signals for the Arduino. Arduino Uno has 6 analog inputs. Arduino Nano has 8 Arduino Micro has 12 Arduino Mega 2560 has 16, but that is a large board.

If you use digital accelerometers, you could use the SPI bus with seperate chip selects signals, or the I2C bus with some kind of multiplexer.

To know the position in 3D space of an object (your finger) you need an accelerometer plus a gyro. However, I don't know if an Arduino board can calculate the position of 6 sensors.

You could start with the Arduino Leonardo with two MPU-6050s, as a learning exercise. http://www.ebay.com/sch/i.html?_sop=15&_from=R40&_sacat=0&_nkw=%28mpu-6050%2Cmpu6050%29+module&LH_PrefLoc=2&rt=nc&LH_BIN=1

Interresting and very complex project proposal,,, hairy problems. I think you'll find that you will be better off using six (base hand, one each for each of five digits) MPU6050's, or similar MPU's. First issue is going to be you'll need to know how to set up different I2c Chann.s (you can only discriminate between two 6050' on the same chan.). Using full MPU's will offload a lot of processing to the MPU, freeing up the Micro (somewhat). Next issue I see is discriminating between types of detected motions (as in: curl, or swipe of a finger; roll vs. swipe of the hand) As a hobby project, I wouldn't even want to think of attacking this one (and I thought Quads and tricopters were a bear)....... Good Luck. You certainly have your work cut out.

Thanks for your reply Caltoa; I really appreciated :)

So the Uno won't be recognized by the computer as external peripheral, while the Micro and Leonardo offer this possibility ? This is definitely an option to explore.

BTW seems that the first link uses only one accelerometer, unless I read it wrong (not sure what a contact sensor is, but it mention flex sensors and 1 accelerometer). Nice solution; altho it is limited to just the sign language field, which is a bit reductive for such device (IMHO).

The second link is (conceptually) similar to what I want to make (it is just missing the gyro), but I can't really figure out what was used for the connection (I2C? SPI?), nor what board is used to handle the whole thing.

The third example is spot on! I wish I could contact the author of this prototype to get some advices :) Is there a comparable Arduino, to the Atmel AVR MC? I assume that it is something similar to the mega?

Could you tell me why you are multiplying by 3, when you talk about the sensor signals? I thought that I2C uses 2 wires; so a chain can have multiple sensors connected, using one address per sensor, so 5 sensor = 5 address to reserve (they all share the clock and data signal, don't they?).

BTW I just need to bring in the computer the raw data of the accelerometers and the gyro; the application on the computer will do the rest (wired for now; it is already complicate as is, to plan for a wireless connection :) ).

Thanks!

123Splat: Interresting and very complex project proposal,,, hairy problems. I think you'll find that you will be better off using six (base hand, one each for each of five digits) MPU6050's, or similar MPU's. First issue is going to be you'll need to know how to set up different I2c Chann.s (you can only discriminate between two 6050' on the same chan.). Using full MPU's will offload a lot of processing to the MPU, freeing up the Micro (somewhat). Next issue I see is discriminating between types of detected motions (as in: curl, or swipe of a finger; roll vs. swipe of the hand) As a hobby project, I wouldn't even want to think of attacking this one (and I thought Quads and tricopters were a bear)....... Good Luck. You certainly have your work cut out.

Thanks for the advice, 123Splat

So you suggest to use all 6050 instead than use one, and replace the other 5 ADXL335? I heard that MC are able to supply more than one channel for I2C, so you can swap in software; and since each channel can hold no more than 2 sensor each (otherwise they will conflict, since they use the same address), I thought that 3 channel were enough (6 sensor total, 2 per channel).

The discrimination of movement is done trough the translation program: I have a 3d model with limits, modeled after the human hand, so it has the range of motion that a real hand has. Once you calibrate it, the movements are translated thanks to the fact that fingers don't rotate, but just curl or wiggle in a limited range. So the parent of the hierarchy is always the 6050, and everything else is attached trough 3d bones to limit the movement. In this way, the app knows that if you rotate a finger, it is in fact rotating the whole hand, or if you move a finger but the hand won't rotate with it, it has to be a curl.

This is all in theory of course; until I get the real sensor hooked up, I can only say that in theory it should work :)

I am aware that is a complex project, but I think that there is a possibility to actually break in into this kind of applications....there are many people that has disabilities, and sometimes, they can just move their hands.

Thanks for the suggestions!

I searched for more info on that third example, here it is: http://siliconrobot.com/fingeracc/fingeracc.html There are also links to pdf files with more info. They used an old small Atmel microcontroller. The Arduino uses mostly the Atmel ATmega328p, which has more memory and can do more.

Since you mentioned the ADXL335 in the subject, I assumed you wanted to use those on the fingers. That is an accelerometer with analog outputs for x,y,z. So for 5 fingers you need 3 axis times 5 fingers is 15 analog inputs.

Splitting the I2C bus to get six MPU-6050 sensors working can be done in a number of ways.

You want to do all the calculation on the computer ? Even the 'dmp' firmware for the MPU-6050 ? You should really get your hands on such a sensor, because the gyro is not a real gyro but more an indication for the change in rotation and the accelerometer is highly sensitive for tiny fast motions.

Thanks a lot Caltoa!

So the Atmel is the same that is mounted on the Arduino, I see

YEs, I am planning to use the ADXL335 for the fingers, and I realize only now that they are analog only; so is like you said: 3x5=15 analog IO. That's why they sell for cheap on Ebay :) The 345 is the one that has I2C connectivity, right? Altho it is more expensive.

At that point would be better to just use the 6050, as you said; I just don't know how to split them, unless I can run 3 different I2C networks (2 sensors per network, since I can't put more than 2 on each network or they conflict). Is the Arduino able to support multiple concurrent I2C networks?

Yes, I would like to grab all the data from the sensors and elaborate it on the computer. Not sure what the dmp firmware is....you mean the dump of all the registers of the 6050 chip?

I have purchased one today; but I don't have either any Arduino, so I can't really do anything with it yet. So you would suggest that for my application, I need a different product from a MPU-6050?

The MPU-6050 is a MEMS sensor, the output is like other MEMS sensors. But it has an processing unit in the chip, called 'dmp'. The i2cdevlib uses that dmp, it uses the dmp to do some precalculations. However the i2cdevlib uses the interrupt and the fifo. Perhaps 6 sensors are possible with that library, but I'm not sure. http://www.i2cdevlib.com/devices/mpu6050

I forgot the best options for multiple I2C busses. You need extra hardware. You can use a special chip, for example the PCA9546 or PCA9548. Or you can build something with mux logic chips. Search for : i2c multiplexer or for : i2c channel switch

While the ADXL345 used I2C, it still only has two I2c base addresses (selectable by hardware) available, and you have a chip select to decide how to handle, so you are still limited to two per channel, or tying up another pin(s) for chip select. While the MPU6050 is more expensive, it has the same addressability constraints, but offers more data and does most processing requirements on chip. Makes your job much simpler on the micro-controller side.

I see, but I read that the processor on the 6050 has basically no real documentation, and all that is out on the site was basically reverse engineered...is quite scary to invest in a project and know that there could be some sort of flaw because of the lack of information about how the sensor works :) That's why I was planning to use the Arduino to do the pre-calculations...after all the arduino needs to simply grab the data and send it to the computer for analysis, so does not have too much to do.

Isn't a plex, something that has multiple connections but just one at time is active? In the case of 5 sensor; I would have to manually select which one, and I do not know the sequence in which they fire (and sometimes they may all fire at the same time).

I was not aware that to calculate the 3d position in space I need necessarily 1 gyro+accelerometer per each finger; I made the assumption that I could connect all the sensor together and interpolate the data, using the 6050 gyro to find the position, and just the accelerometers for the fingers....seems that I was quite wrong to start with.

I was looking into ADC, that I can drive via SPI, but it seems that there is neither a shield for the Arduino, nor an affordable solution (it would cost me more than 2 Arduino mega, attached together :) ); so I guess that I have to abandon the idea of using either the analog 325 and the 335 via I2C, since I won't fit more than 2 on each channel.

The 6050 seems not fit either...it still gets 2 max on each I2C channel, is not SPI so it is not a viable option

Now 2 solutions would be in sight:

1) find a gyro+accelerometer sensor that support SPI, or that has the capability to assign the registers, so I can put more than one on I2C

2) make a mix of sensors: some analog, some I2C; altho it feels like a nightmare if the data is slower on one sensor, since the gesture would be incorrectly evaluated by the program.

What would you suggest? So far the Mega seems the best bet for the board; but the smaller I go, the better it is (plus I need a board that is easy to connect to the computer to process the data; but all the Arduino boards are friendly on that aspect, from what I can understand, since they communicate via console?).

Thanks a lot for your help; I feel quite lost sometimes, and the fact that I do not have anything in my hand to experiment is quite frustrating.

SPI is also a good choice.
The MPU-6000 is the same as the MPU-6050, but the MPU-6000 has also SPI.
I don’t know if there are SPI libraries for it.

You don’t have to use the undocumented part, you can read the raw gyro and accelerator values from the MPU-60x0 and that is documented and that is the same as with every other sensor.

Ok, guess that I will settle for SPI then

There are library for the 6500 that I can use, so it makes sense to use that.