I'm working on a project to read the vehicle speed from my car's speed sensor using an Arduino. The speed sensor outputs voltage pulses ranging from 0 to 12V, which the Arduino cannot handle directly.
I somehow managed to get the speed sensor signal wire and checked that with my multimeter, while moving the car the voltage reading changes with max of up to 12v.
Should I use an Optocoupler or a voltage divider
I'm looking for an explanation on how to set up and any tips and code on ensuring reliable readings from the speed sensor. Thanks in advance for your help!
I suggest using an optocoupler. Use a 1 kOhm serie resistor to the 12 volt side.
Use INPUT_PULLUP on the input.Don't connect controller negative to car negative!
when I start the vehicle, it just shows some milli volts, If I move my car a little bit and further the multimeter shows values 5.1, 7.74, 5.7, 8.6, 3.6, 4.9, 5.3, 10.1, 4.6, 2.8 like that