# Which accelerometer and storage chip should I use to measure Foosball rod acceleration?

I want to prove my coworker rotates and laterally moves a foosball rod twice as fast as me.

I was thinking I'd need a biaxial accelerometer (which one?) attached to the rod in between men (to not hinder gameplay). I guess there'd have to be a memory chip near it (which one?), too, to store 20 minutes of accelerometer output. And a battery. And some way to put that data on a computer, after which I'd analyze it.

I'm new to building real things, if you get my drift. Any tips?

(source: wikimedia.org)

Your requirement is a means of measuring shaft longitudinal rotation and acceleration rates. Telling us how you think it can be best done may hide easier or better answers from you - unless accelerometers must be used for some unknown reason.

(1). Video camera: An already built widely available high tech solution which can be adapted with an essentially free low tech add on is to use a video camera and add markings to the rods.

For radial acceleration and velocity you can add longitudinal lines on a section of the rod that is always visible as the rod moves sideways and long enough such that as the rod slides left or right the markings at a chosen circumference do not exhibit any change. ie only haft rotation affects an image of that point. A properly zoomed in and focused camera could produce an image that could be viewed visually in real time or slowed for checking and which allowed like;y peak acceleration or velocity portions to be checked more closely.

Similarly, a series of circumferential stripes would allow rod sideways motion to be visually analysed.

Is video fast enough?: A quick mental Foosball game suggests you may turn the shaf 1/2 turn in 1/4 second. Faster just scales. See below.
1/2t in 1/4s = 2 rps.
Many modern cameras provide 30 fps, quite a few 60 fps, and a number have vastly higher frame rates. Video far less than VGA will be adequate.
At 30 fps a 2rps rate will produce 360 x 2 / 30 = 24 degrees per frame or about 7 frames for a full 180 degree rotation. Rotations over 1890 degree are unlikely to be very useful. BUT it is easy to either formally encode or visually examine a frame by frame record and estimate how many degrees a shaft has rotated in 1 or more frame times. The "players" already provide some input and even very simple marker and paper encoders taped to the shaft would allow as accurate determination as is liable to be useful.

(2) Electronic optical reading Both the above stripe marking system would be easily adapted to electronic reading with an optical sensor.

At its simplest a very workable system could be implemented with some stick on paper labels and tape or glue, plus a photo transistor and photo diode detectcor or an off the shelf tx-rx reflective pair.

eg QRB1113/4 - one of many possible units.
Datasheet here

Extremely good example that comes close to this one in some respects - in this case he is reading a scale in a gas meter.

(2) Similar to the above but use more formal rotational or linear encoding systems. eg encoder disk on shaft outside Foosball body so it is driven rotationally and either has axial moving rod slide through it OR detector hangs off rod adn wires accomodate left-right motion.

Linear motion sensors are available - either using optical coding as above or LVDT transformers or ... .

Some excellent LVD illustrations here each hot linked to a web page. DIY example in image below is from here

• I don't think it can work: the rotation speed is usually much higher than the frame rate of a normal (not super-expensive) camera, and it may be difficult to distinguish the markings. Plus, it's hard to make straight markings and prevent them to be deleted when moving the rod. May 3, 2012 at 8:01
• @clabacchio - Plenty workable in my estimate - see added "Is video fast enough?" May 3, 2012 at 9:10
• Well it may be my fault, but 24 degrees seems quite high since usually rotations are much less than 180 degrees, more likely 45-90 degrees. And I'm also concerned about the lateral movement which will require long markings which may also be deleted by friction. And I'm faster than 1/4 sec :P May 3, 2012 at 9:18
• @clabacchio - lower total movements reduce and faster rotn rate increase the degrees per frame. Much much faster video frame rates are available. As noted - you can establish accuracy to far better than the movement per frame with ease.// Making adequately durable markings for the purpose is "simply a matter of engineering. As noted. you could place a rotational encoder disk on the outside arranged to rotate but not slide. Q:How? A: Just engineering :-). Shaft travel could be measured by a wheel which is driven by longitudinal motion and not rotational motion - eg mechanical mouse encoders. May 3, 2012 at 12:09
• Electric drives do something similar to this using an optical encoding wheel to determine how fast the motor is spinning. May 3, 2012 at 13:43

More than accelerometers, you need a (1 axis is enough) gyroscope. It's specifically made to measure angular acceleration, so it will measure only the rotation of the bar.

Tha problem is that it should be mounted inside the bar itself, or in line with it, to provide the best measurement and not vary the "balance" of the handle. But probably you can live without it, and just stick it firmly at a random point.

UPDATE: I'm not sure that Russel's solution of using a camera with markings can work, but you may have a very rough idea putting a camera in line with the rod and looking at the slow motion of the puppet. While it may be too fast to clearly see the movement, you can try to compare the movement between two (or more) frames to say who's the fastest.

UP-UPDATE: You will also need a very quick gyroscope to implement that solution, but there are some with fall detection, which means that the measurement is event-driven and with very quick sampling.

• Plenty workable in my estimate - see added "Is video fast enough?" in my answer May 3, 2012 at 9:11
• +1 My first thought was also a gyroscope. May 3, 2012 at 9:13
• It should be easy enough to mount the gyroscope on-axis; just place it on the end of the rod. May 3, 2012 at 18:27

One of your main problems here is mechanical. You're trying to take measurements from something that both slides and rotates very suddenly and quickly. Thus you need two sensors which can separate those two movements.

Furthermore, you don't really want to mount any sensing electronics on the moving parts themselves, for the following reasons:

• Adding mass to the moving parts will affect the measurements, slowing them down.
• To prevent wires getting twisted up, you would have to make it wireless, or have a microcontroller on board to record the data.
• It's a reliability nightmare to be smashing home made electronics around.

Russell's idea of using stripes and an opto sensor is a very good one. This allows you to make a sensor which is only sensitive to rotation of the shaft, and won't respond to sliding. But you could use this idea to measure sliding too. It's nice to be able to use the same type of sensor for both directions.

So, print out two stickers covered in black stripes. Stick one on one rail, oriented to measure rotation. And stick the other on another rail, mounted at 90º to measure sliding.

Now, how to get the data into a PC for examination? It really depends how much you're willing to spend on this, but I suggest a cheap 2-channel USB oscilloscope. These are available for as little as \$30 on eBay.

It only has a sample rate of 8kHz or something terrible, but this should be enough. Get someone to take a sample while you're playing the game, and measure the time between pulses.

An even cheaper way to read the data might be to send it into the PC as audio data. It should be possible to wire up the two channels as L and R on your audio line-in. Now you can record the 'audio' for a long game, and examine it at leisure on one of the many free audio editors. The signals should be changing fast enough that they should get through any capacitive coupling in the input circuit in the PC.