Help with accelerometer+gyro

Hi guys,

I am new in this forum and using arduino. My project consist in use accelerometer+gyro linked to a ball and I need to send the information of the rotation of this ball to my computer. But I am really lost about how to do this, and what accelerometer and gyroscope to buy, it could be in the same device or separately and it needs to use battery because the device will be inside the ball, and I need to send this information via bluetooth to my computer.

I already have the arduino mega and I was thinking to buy a bluetooth module to the arduino, but I dont have any idea about which accelerometer+gyro to buy, it doesnt matter the range or interface.

Thanks.

How will you fit an Arduino Mega into a ball? o_o Besides, the mega is expensive, and you're gonna be putting it in a ball and throwing it around?! Meanwhile, even the '328p is overkill for this project - you'll have tons of unused pins even on a '328p based board.

I'd use a pro mini or nano (the former has no usb serial adapter, and needs an external one, the latter has that on-board, which makes the board a little larger and increases power consumption). You can buy on ebay little modules that fit an I2C accelerometer and gyro (sometimes also a magnetometer) - The MPU6050 seems to be very popular, and has both gyro and accelerometer on it. HC-05 bluetooth, as a module with the 4 pins broken out, not the one where all you have is the castellated pads for soldering the whole thing onto a board. $2-3 for the nano, $4 for the gyro and accel (not $40 like $parkfun wants), and $3-4 for the bluetooth module - $10 BoM, not including the battery.

Then you could have your sketch write out sensor readings over serial and just connect your computer to the thing in the ball through the bluetooth serial adapter. There's lots of stuff on forums and elsewhere about getting serial data into a computer.

I'd suggest you put some LEDs on the extra pins, assuming the ball is clear, specifically on the PWM ones pins. Then you could take over the timer that PWMs them to make them flash at a specific, known rate (faster than the eye can see, probably), and then turn the lights off, and take a long exposure photo, and the picture will have a dashed trail tracing the path of the ball, and you can calculate the speed from the length of the dashes. Then you can cross-reference that with your data from the same trial, and make sure that they agreed. I did this for telemetry on a spud-gun a while back (with a blinkey projectile)

Thank you very much DrAzzy.

Actually I was thinking in just put the accelerometer and gyro inside the ball and then this device would send it data via bluetooth and the arduino would get this data linked to my pc, it is not how does this work?

Thanks again.

rsouza:
Thank you very much DrAzzy.

Actually I was thinking in just put the accelerometer and gyro inside the ball and then this device would send it data via bluetooth and the arduino would get this data linked to my pc, it is not how does this work?

Thanks again.

No, won't work. You need a microcontroller inside the ball to get the data from the gyro and pipe it out over bluetooth. Once you have that, there's nothing for the arduino sitting outside the ball to do, since you can get the data to the PC directly more easily.

Also, it is much harder to make the arduino act as the bluetooth master - wheras it's trivial to make an arduino act as a bluetooth slave (as easy as using serial).

Before planning to put anything into a ball, learn how to use all the pieces in stages.

  1. Get an Arduino and an IMU (accelerometer/gyro combination). Learn how to read the devices and make sense of the output.

  2. Get a bluetooth or other radio module and learn how to send data between two devices, like the Arduino and a PC.

  3. Combine everything and after it all works, put into a ball.

Thank all of you guys.

If I use, for example, this accelerometer: BlueRadios provides Low Energy Bluetooth 4.0 Smart Ready wireless sensors and single-mode modules for wireless medical patient monitoring, I could get the data from my computer using just this accelerometer inside the ball?

Close - but if you read the description, they only mention iOS app, and state that it is not an open system. You can't get data from it on a pc, only onto an iOS device, in a likely useless (for analysis) form. And it doesn't have gyro, just an accelerometer.

The easiest route is probably to get a IMU on a chip (like the MPU-6050) in
a breakout-board which means only having to find a single library to drive it,
and these can directly put out quaternion or DCM with minimal programming.
These days its probably the cheapest way too. Just pump out the quaternion
over BT with a Pro Mini in the ball

Questions: 6DoF or 9DoF? Maximum degrees/second turn rate? Maximum acceleration
to be measured?

Thank you all again.

Actually I dont need to use arduino in my project, I just thought that it was the easiest way to get the data from an accelerometer. Anyone has any accelerometer or gyro that I could use to get the data from the ball without using any wire? The accelerometer could be separately from gyro, it doesnt need to be a IMU

You need some kind of MCU to read the accelerometer and send the data.

That - there may exist units that contain a microcontroller and are designed for this (like that iOS-only one you asked about), but no matter what, there will be a microcontroller in there. I don't know if you will be able to find a unit which is designed for this kind of thing.

It is definitely not that hard to do with a pro mini, HC-05, and an IMU.

I suggest finding someone with a broken helicopter, and kicking that instead.

DrAzzy:
That - there may exist units that contain a microcontroller and are designed for this (like that iOS-only one you asked about), but no matter what, there will be a microcontroller in there. I don't know if you will be able to find a unit which is designed for this kind of thing.

It is definitely not that hard to do with a pro mini, HC-05, and an IMU.

Thank you for everything.

I change my mind, but I am not sure if this is going to work. I am thinking in buy an arduino nano or pro mini, hc 06 module and I have a MPU6050 (IMU with accelerometer+gyro). To fit this in the ball I dont think it is hard to do, but with a battery and inside the ball this could work?

It will be like a russian spacecraft landing on venus. The camera will work for about 4 minutes and then it will melt.