car moving/stopped sensor

Is there a sensor that tells if car is moving or stopped? I am not talking about sensing the difference between 0 mph and 1 mph. A very crude sensor will do. Thank you.

paker:
Is there a sensor that tells if car is moving or stopped? I am not talking about sensing the difference between 0 mph and 1 mph. A very crude sensor will do. Thank you.

Crude? Sure. Connect a stiff wire to the car. Let it rub on ground. Connect a piezo sensor to the wire. Ant noise means the car is moving. No noise, it's stopped.

Paul

I don't expect the wire to last more than a few miles but I get the idea. Thank you. If anyone has a different suggestion, let me hear.

Check for tyre or axle moving (e.g. magnet + reed switch/hall effect sensor; white marking + optical sensor).
Hook up to the speedometer.
GPS data.
Accelerometer/vibration sensor.

Accelerometer is the easiest I think, low-pass filter to 10Hz or so to remove engine vibration, then threshold the
variation. Either 3 axis as a vector, or just z-axis.

I already tried vibration sensor that is sold at amazon and ebay. On a well paved road at 40 mph, there was little vibration.

WVMARLE suggested VSS output. I looked into this. Not much on internet. I only found one writeup. It says Ford F-series VSS signal is AC with varying amplitude and frequency. Zero V and Hz at zero mph. 3.5V at 30 mph. 125 Hz at 55 mph. How do I measure this with Arduino. Precision measurement is not the goal. If car is moving faster than 20 or 30 mph is all I need. Thank you.

paker:
I already tried vibration sensor that is sold at amazon and ebay. On a well paved road at 40 mph, there was little vibration.

WVMARLE suggested VSS output. I looked into this. Not much on internet. I only found one writeup. It says Ford F-series VSS signal is AC with varying amplitude and frequency. Zero V and Hz at zero mph. 3.5V at 30 mph. 125 Hz at 55 mph. How do I measure this with Arduino. Precision measurement is not the goal. If car is moving faster than 20 or 30 mph is all I need. Thank you.

Why don't you tell us what your project REALLY is? First it was moving or nor moving. Now it's 20-30 MPH.

Paul

You are correct. I was ambiguous. My goal is to tell if car is moving. I used 20-30 as an example, that is, as far as I can tell 0 mph from 20 mph, I am happy. Detection error range is large.

Thank you for the clarification.

Easy way to measure AC frequency: use a zero crossing detector, measure time between pulses.
This provided your VSS signal can deliver the 15-20 mA the LEDs in that zero crossing detector need (if not, you'll have to add additional/different electronics). Gives complete galvanic isolation between VSS signal and Arduino as well. Should give you a very accurate speed measurement.

I looked up zero detection. It seems to me any optical coupler has zero detection capability and pulse output. Is this correct?

Since VSS can get several V, I suppose I need an input resistor. Will 500 ohm work? I will also need a resistor in the collector output line. With 5V arduino Vcc, will another 500 ohm work? Thank you. I am not electrical and need detailed instructions. Thank you

[quote author=paker link=msg=3535297 date=1514140034]
I looked up zero detection. It seems to me any optical coupler has zero detection capability  and pulse output. Is this correct?

You need one with LEDs in both direction.

Since VSS can get several V, I suppose I need an input resistor. Will 500 ohm work?

Depends on how much voltage you get, the forward voltage and required current of the LED of the optocoupler. After that calculate the correct resistor value just like a regular LED.

For the output, you need a pull-up resistor. 10k is a common value for this.

Thank you, Sir. I got the idea now.

paker:
I already tried vibration sensor that is sold at amazon and ebay. On a well paved road at 40 mph, there was little vibration.

And when stationary there is no vibration... So what's the issue?

MarkT:
And when stationary there is no vibration... So what's the issue?

When the car is not moving, no vibration. It is good. When the car is moving on a well paved road, still no vibration. It is not good.

wvmarle and other helpers,
I watched youtube videos on zero crossing optocoupler with phototransistor output. Please confirm what I have studied so far. With 10k pull-up resistor, I will get brief 5V pulses at zero crossing. I will use attachInterrupt(0, isrName, RISING). Inside isrName, I will record time and save it as eventTime (global variable). Based on consecutive eventTime, I can calculate vehicle speed. Did I get it right? Thank you.

By the way, according to internet, vehicle speed sensor of my car generates 0 to 200 Hz, and 0 to 6 V AC.

paker:
I watched youtube videos on zero crossing optocoupler with phototransistor output. Please confirm what I have studied so far. With 10k pull-up resistor, I will get brief 5V pulses at zero crossing. I will use attachInterrupt(0, isrName, RISING). Inside isrName, I will record time and save it as eventTime (global variable). Based on consecutive eventTime, I can calculate vehicle speed. Did I get it right? Thank you.

That sounds correct.

But here I see a problem:

By the way, according to internet, vehicle speed sensor of my car generates 0 to 200 Hz, and 0 to 6 V AC.

You need a reasonably stable voltage to be able to get that optocoupler to work, after all it's an LED in there. So too low voltage and it won't light up; too high a voltage and the LED gets too much current and may break.

Small amplitude (current) at low vehicle speed: Since 30 mph will give 3.5V, I am content. I am not much interested in low speed.

Excessive amplitude (current) at high speed: I will start with a large input resistor and incrementally decrease the value. Thank you for the warning.

If I can b

Check the data sheet - and remember that the peak voltage is 1.42 times the RMS value which your multimeter shows - to get to a reasonable resistor value.

The problem is still that at 6V the current will give you 4-6 times the current you get at 3V due to the fixed voltage drop of the LED. Look into fixed current supply circuits - e.g. based on transistors, such as this:
(source)
or by using a regulator like this:

(source)

Adopt those to the required current for your optocoupler - typically 10-20 mA is required.

Wvmarle,
Thank you for the note. Hopefully I don't need to add more to optocoupler.

Delta-g,
I will look into reading OBD2 port. It is new to me. It looks like I need to buy something to go between Arduino and OBD2. There seem to abundance of info on this out there. Thank you for the suggestion.

Delta-G and other helpers,

I need a little more guidance on Arduino+OBD2. Since OBD2 comes with Bluetooth, I will need an HC05 Bluetooth module. Please confirm if the following is correct:

Arduino nano to HC05 Bluetooth module: 5V to VCC, GND to GND, RX to RX, TX to TX

HC05 Bluetooth to ELM327 Bluetooth: HC05 is master, ELM327 is slave. Apparently, HC05 comes in the slave mode. I will have to change it to master. ELM327 seems to default to slave.

Communication between Arduino and ELM327: I will try different sketches available on internet.

Thank you.

I misused the word OBD2. I meant ELM327 OBD2 reader. The short stubby ELM327's come with Bluetooth. I didn't get many search hits but someone posted a similar project with sketch. I will copy him as much as I can.

I will power HC05 separately.

I will connect RX-TX.

Thank you for the corrections. Parts were ordered.