Shop OBEX P1 Docs P2 Docs Learn Events
Detecting vehicle motion — Parallax Forums

Detecting vehicle motion

Don MDon M Posts: 1,652
edited 2015-05-13 06:04 in Accessories
Which sensor would be used to detect a vehicle stopping / starting ? A gyroscope or inertial sensor ?

Comments

  • Duane DegnDuane Degn Posts: 10,588
    edited 2015-03-10 12:36
    Is this sensor to go inside the vehicle?

    If so then an accelerometer would probably provide enough information to detect when a vehicle starts. Detecting when the vehicle has come to a full stop will be harder. While the readings from an accelerometer can be integrated to compute speed, there's always some error and one generally needs additional information to compute speed.

    An accelerometer coupled with a GPS unit would probably work reasonably well. Then a GPS unit by itself may be enough to do the job.

    Can you hack into the vehicle's computer and read the speedometer?

    A gyro detects angular motion. If the vehicle traveled in a straight line, the gyro wouldn't detect a change.
  • GordonMcCombGordonMcComb Posts: 3,366
    edited 2015-03-10 16:34
    Don M wrote: »
    Which sensor would be used to detect a vehicle stopping / starting ? A gyroscope or inertial sensor ?

    A gyroscope is a kind of inertial sensor.

    As Duane mentions, an accellerometer would be the main component to detect the forward motion of a car, but a gyroscope -- especially a 3-axis one -- is also useful; for example, it would detect the movement of the car from or to stop, since that would almost always entail a momentary change in pitch.

    Most late-model smart phones and other consumer devices combine both a gyroscope and accelerometer in one unit. There are some internal measurement modules that give you a "fused" output that gives a single reading per axis.
  • Don MDon M Posts: 1,652
    edited 2015-03-10 19:26
    Ok to be fair I'll give a bit more info about what I'm trying to do. Presently I'm timestamping stops along a route and I press a button when I stop and then again when I resume driving. I'd like to eliminate the manual interaction. I was considering GPS as I have one of the Parallax modules (the latest one they sell) but have never tried it out. Was thinking I could use that to identify each stop and then trigger when I have reached my stop. Wasn't sure how accurate the GPS would be for detecting (to the second) of when I resume travel. That's where I was thinking maybe an accelerometer may be needed.
  • kwinnkwinn Posts: 8,697
    edited 2015-03-10 19:42
    Measuring wheel, axle, or drive shaft rotation would probably be the most reliable. An accelerometer might work but braking and accelerating in traffic would give erroneous readings. If you put the transmission into park each time you stop a push button or optical interrupter would work.
  • Don MDon M Posts: 1,652
    edited 2015-03-10 19:45
    kwinn wrote: »
    Measuring wheel, axle, or drive shaft rotation would probably be the most reliable. An accelerometer might work but braking and accelerating in traffic would give erroneous readings. If you put the transmission into park each time you stop a push button or optical interrupter would work.

    I should mention that I am not able to connect to anything in the vehicle to detect movement etc..
  • GordonMcCombGordonMcComb Posts: 3,366
    edited 2015-03-10 19:55
    The GPS is your best option. When parsing, pick a NMEA sentence structure that includes MPH. Many of them do.

    Of course, it won't work in tunnels or parking garages (or the like), but maybe you can include an override for such things.
  • W9GFOW9GFO Posts: 4,010
    edited 2015-03-10 21:13
    If it is a gasoline powered vehicle you may be able to plug something into the cigarette lighter to sense the ignition, and therefor the rpm. A stop would be registered when the rpm dropped to a certain value.
  • Don MDon M Posts: 1,652
    edited 2015-03-11 04:15
    The GPS is your best option. When parsing, pick a NMEA sentence structure that includes MPH. Many of them do.

    Of course, it won't work in tunnels or parking garages (or the like), but maybe you can include an override for such things.

    Thanks Gordon. I'll look into this when I connect the GPS module and do a bit more playing with it.
  • Don MDon M Posts: 1,652
    edited 2015-03-11 04:18
    W9GFO wrote: »
    If it is a gasoline powered vehicle you may be able to plug something into the cigarette lighter to sense the ignition, and therefor the rpm. A stop would be registered when the rpm dropped to a certain value.

    Thanks Rich. I've heard of doing that before but as I mentioned this won't rely on any connections or feedback from the vehicle (which happens to be a diesel anyway...). Fully self contained and reliant on whatever sensors I build into it.
  • Don MDon M Posts: 1,652
    edited 2015-03-11 04:21
    Now onto finding some good SPIN examples. I see the module I purchased only has C demo code... I'll look at the OBEX for some examples. I'd prefer SPIN at this point.

    I found this APP Note but in the resources section the zip file it refers to doesn't exist. Anyone have the spin code for this APP Note?
  • Don MDon M Posts: 1,652
    edited 2015-03-11 05:55
    Thanks so much!
  • abecedarianabecedarian Posts: 312
    edited 2015-03-11 11:32
    If you get in / out of the vehicle at stops, a pressure sensitive cushion starts timing when you sit down, stops timing when you get up, maybe a few seconds delay to compensate for rough roads.
    ... OR ...
    A cigarette lighter adapter detecting AC ripple from the alternator: no ripple=engine is off / stop timing; has ripple = engine is running / start timing.

    GPS could give you time stamps and location data if you need those logged.
  • DomanikDomanik Posts: 233
    edited 2015-03-11 13:40
    Don M wrote: »
    Which sensor would be used to detect a vehicle stopping / starting ? A gyroscope or inertial sensor ?
    It seems road noise and vibration might be a possibility. Perhaps an accelerometer output could be monitored for a drop off in peak to peak change/vibration. If it stops for a period of time (longer than a traffic light) the car might be stopped. If the quiet time is less than 2 minutes add the time back into the travel counter. Another possibility is a microphone that tracks low frequency sound and has an AGC amp to adjust to the road noise sensitivity. A low pass filter and threshold detector would be the on-off sensor and the prop could then track time pauses and actual stops. It could fit inside a small box with a diaphragm on the bottom for the mic. I can't think of anything that might generate similar noise when stopped. Unless, of course, your car is suddenly attacked by a gang of zombies.
  • MSDTechMSDTech Posts: 342
    edited 2015-05-12 09:30
    This may sound crazy, but have you looked at the xband motion detector? You could aim it out the window at the street and detect the motion of the pavement.
  • xanaduxanadu Posts: 3,347
    edited 2015-05-12 15:13
    You could do all of the above in a reasonably small package and still have pins and cogs left over.

    I wonder if you could sense the zero mph position of the speedometer needle, with some kind of stick on sensor.

    I'm interested to know about the no interface requirement. Is that a company rule or a design goal?
  • GordonMcCombGordonMcComb Posts: 3,366
    edited 2015-05-12 16:59
    I agree that a lot of these methods could be used. The XBand motion detector is clever, but it means sticking something out a window or mounting it externally where it could be damaged.

    Other approaches: I've seen speedometer cable sensors that clip around the cable. Apparently they are sensitive to the turning of the steel cable inside. I've also seen some really simple aftermarket add-ons for wheelchair wheel sensors where a simple IR sensor reflects off the inside rim of the tire. It would be fairly easy to hotmelt an IR sensor -- similar to how the encoder on an Activity Bot works -- in the wheel well of the car. Look for a spot that doesn't show a lot of dirt or mud.

    Anyway, we could go on...
  • Don MDon M Posts: 1,652
    edited 2015-05-12 17:25
    xanadu wrote: »
    I'm interested to know about the no interface requirement. Is that a company rule or a design goal?

    Because it's a vehicle I do not own. Also it needs to be portable meaning it can be just connected to power in any vehicle. This is a project for in a school bus.
  • xanaduxanadu Posts: 3,347
    edited 2015-05-12 19:45
    Don M wrote: »
    Because it's a vehicle I do not own. Also it needs to be portable meaning it can be just connected to power in any vehicle. This is a project for in a school bus.

    Now this is getting interesting. I was thinking in bad weather anything pointing outside will have issues.

    What are the conditions of stopped time? Stopped at red lights, or stopped engine off taking a nap in the back stopped?

    What accuracy are you looking for? Down to the second or minute on a couple hour drive?
  • MSDTechMSDTech Posts: 342
    edited 2015-05-13 06:04
    I agree that a lot of these methods could be used. The XBand motion detector is clever, but it means sticking something out a window or mounting it externally where it could be damaged.

    ..

    Actually, I thought of the X-band since it can "see" through the glass and would not have to be outside the car. It can also see through walls (if they aren't metal) since it uses radar signals.
Sign In or Register to comment.