How to drive digital inputs from car to an Arduino?

All hardware topics
Locked
Go4IT
Pro
Posts: 967
Joined: 08 Feb 2019, 12:25

How to drive digital inputs from car to an Arduino?

Post by Go4IT »

In this blog post i will show how to detect 12V signals from the car using an Arduino in a way, the Arduino will survive ;-)

The common problem is to
  1. Get voltage level down to a value that Arduino (Atmega328P chip) can handle
  2. Protect input from high current flow
  3. Remove noise (spikes, pulses, etc.) from the signal so it won't hurt the chip's electronic nor produce false results
The easiest way to do 1.) and 3.) is using a voltage divider, made up from two resistors. It will limit the current and also lower the voltage level:

<PICT>

The main problem here is that it won't protect against high voltage. For this a Zener Diode is a nice and simple way. A Zener will clip to the given voltage, e.g. 5V for the Arduino Nano digital IO-pins (beware, other shields may use 3.3V or something different!):

<PICT>

To cancel high frequency noise, add a ceramic capacitor to ground (low pass filter):

<PICT>

To prevent the signal detection against low frequency voltage pulses, add a electrolyt capacitor to ground:

<PICT>

To prevent against reverse polarity current, add a Diode in flow direction:

<PICT>
Locked