Sensor for measuring speed

Hi,

I'm searching for a sensor which is capable of metering speed. My first idea was to use an accelerometer with one axis and point it against the direction of movement. This would output the gravitation, the acceleration of course, which might be converted to more or less precise mph/kph or even meters per second. But I'm not sure if that makes sense. I want to avoid using GPS to keep the system simple (yah I know GPS would be the simplest :slight_smile: )

Do you know any sensors or techniques which are capable of metering speed? Just as a side-note, I talking about a range of 10 - 30 km/h.

Best,
Dennis

There are no sensors that directly measure speed, which is relative in any case.
You can measure distance traveled (i.e. with a wheel encoder) and time, then divide to get the speed.
Radar units measure Doppler shift frequency changes to compute speed.

Any chance to convert the output of an accelerometer into something like km/h?

Best,
Dennis

Basically you are looking at an INS (Inertial Navigation System). Unless you have a very good accelerometer, you will miss any gradual changes in acceleration and the error will quickly multiply over time. You don't indicate what medium you are trying to measure the speed over (flying, boat on water, ???). If on land, some sort of wheel is probably the best. You can get speed from acceleration over time by integrating the acceleration value, but that is going to require a very good accelerometer (and if the direction of travel involves random accelerations in other directions (waves, rough road etc.) that is going to complicate the whole issue.

Any chance to convert the output of an accelerometer into something like km/h?

Not with consumer grade accelerometers. They are too noisy.

Well, basically I want to get the current speed of a small vehicle or at least be able to distinguish between fast and slow. The latter would be sufficient actually. The Problem is that cannot use a wheel with a magnetic barrier, although it'd be the best solution.

Could you use a retro-reflective sensor to sense reflective tape or a white stripe on the wheel?

The Problem is that cannot use a wheel with a magnetic barrier, although it'd be the best solution.

I don't understand what that means. You are not giving us all the information we need I think.

People normally use wheel encoders to measure speed. However, if you mainly just need a rough estimate, you might look at using an optical flow sensor pointed at the ground. One of these days, I have one to try on my robot, but too many other things in the queue ahead of it.

oric_dan, wheel encoder sounds good!

MarkT:
I don't understand what that means. You are not giving us all the information we need I think.

Sorry for being imprecise but perhaps I don't know what information you need :wink: I was talking about a magnet attached to the wheel that passes a coil in order to induce an electric pulse. Same principle as used for bike computers

Actually, I think most bike computers use a magnet and a reed switch as the sensor - the magnet past a coil has the problem of if the magnet is in close to the hub and the speed very slow, it does not generate much of a pulse where the magnet and reed switch will work at almost all speeds (I have noticed in the past, if you listen very carefully at the sensor when the magnet goes past, a slight "ting" - that is typical of a reed switch).

laemmen:
I was talking about a magnet attached to the wheel that passes a coil in order to induce an electric pulse. Same principle as used for bike computers

I actually implemented something like this on my robot a couple of weeks ago. It didn't work as well as I had wanted, but I'll tell you my experiences. I'm still playing with it. I glued [using Goop] 4 small magnets around the driveshaft [~12 mm diam] of the Monster truck, and used a Hall sensor for pickup.

For the Hall sensors, I've tried both unipolar [HAL508, no link] and linear here,
http://www.jameco.com/webapp/wcs/stores/servlet/Product_10001_10001_2135881_-1

For the magnets, first I tried refigerator type, but those are very weak due to their being designed having the magnetic dipoles arranged in a grid where the fields do the exact opposite of constructive binding. See here,

However, K&J has small neodynium magnets that are very cheap, and can be glued to anything, eg B111 and B112. I'm using the B111.

These will trigger a Hall sensor at upwards to 1/2" [12 mm], and more. The problem is, they are so strong that, when glued around a "small" 12 mm shaft, the summed magnetic fields are always high, so I'm not getting good on/off triggering of the Hall sensors. I ended up getting a kind of low-amplitude ripple output of the linear Hall, and set a threshold in the middle of the ripple. This doesn't work especially well, because I have to do ADC sampling for 50-msec to get a decent count [which goes from 1...12 in 50-msec], and cannot use interrupts conveniently, as with digital encoders. Also, the resolution is very low, as compared to most digital wheel encoders, but I have a rough estimate of speed. So, I'm still playing.

oric_dan:
small neodynium magnets that .... are so strong

I have some of those things, they're insane. I can hardly prise them apart, and when you put them down on the bench they fly across the room to stick to the nearest stapler.

JimboZA:
I have some of those things, they're insane. I can hardly prise them apart, and when you put them down on the bench they fly across the room to stick to the nearest stapler.

Exactly. I keep losing them all the time when I set them on the bench, because they fly over somewheres, and stick to whatever metal is nearby :-).

EDIT: I should mention that my scheme described above would likely work better with maybe only 2 magnets on the small 12 mm shaft [giving even lower pulse-count resolution], or else on a much larger diameter shaft, and with the magnets set at wider spacing.

WARNING: just a warning here when playing with small high power magnets: Keep them out of reach of children - there have been a number of cases where small children have swallowed 2 (or more) magnets and then when they get in opposite loops of the intestine, they pinch together causing that portion of the intestine to die. That is why a couple of years ago, those little toys that were a bunch of magnets you could play with and make things were taken off the market. (pets can have the same issue if they suck them up (like my dogs would)). See this link for more info if curious: Consumer Product Safety Commission Warning

Thanks for your replies!

@oric_dan
as you mentioned it, how does the hall sensor work, can you give me more information? I understand how the Hall effect works - at least the basics - but I'm unsure about which type of sensor would suit my setup. Do you need to have both poles to toggle high/low or is it possible to measure actual magnetic fields with it? Like if the magnet comes closer the sensor detects this regardless of the polarity. Moreover I was wondering how close the magnets need to be. One could try to use a higher pull-up resistor but this would also increase the noise.

Best,
Dennis

You should read the datasheet, and maybe wikipedia to get background info on the Halls.

They respond to one polarity of the magnet. Sensitivity range depends upon the magnet. As I already mentioned, the frig magnets are weak and range is only a mm or so, but the neodynium magnets trigger up to 12-25 mm or so.

oric_dan:
You should read the datasheet, and maybe wikipedia to get background info on the Halls.

They respond to one polarity of the magnet. Sensitivity range depends upon the magnet. As I already mentioned, the frig magnets are weak and range is only a mm or so, but the neodynium magnets trigger up to 12-25 mm or so.

Will do, I was just wondering whether you can say which sensor type might be suited for "longer" distance measurments. You said you tried unipolar and linear hall sensors, what are your experiences here?

In fact, I don't remember now. I ended up going to the linear Hall sensor for a specific reason which I don't remember. I do remember the "variations" in the linear sensor output are minimal [like a few 10s of units in the 0...1023 ADC output], and I set a threshold in the middle of this window. Looking back, I'm assuming as mentioned that the magnets are so close toghether on the small shaft that the individual fields summate, and the unipolar sensor was always fully activated. Such a world with such strong magnets.

If you have a larger shaft, and the magnets are somewhat further apart than 0.3", you'll likely not have the same problem. But everything is relative - power of magnets, mounting spaces, distances to pickup sensor, on and on. This sort of thing you just have to try different things, and see what works for your own lashup.