# Detect current in car handbrake circuit

Using Arduino, how can I detect that the switch is on? I have access to the wire within the red rectangle only. That's because the switch is closely connected to the car body (ground). When the handbrake is up, the switch is pushed by a coil to touch car body and close the circuit. And when the handbrake is down, the switch go away from the car body and the circuit is open.

• Can you insert a voltage monitor? Or other parts? – Code Gorilla Jan 19 '18 at 15:41
• If you literally only have access to that wire, you cannot. You will need access either to the ground or 12v, or the bulb to see if it is lit. – Mark Smith Jan 19 '18 at 19:39
• Actually that's not quite true. You could do it by cutting the wire and putting a resistor in series, then measuring the voltage across the resistor. – Mark Smith Jan 19 '18 at 20:00
• this seems like a school assignment. ... did i guess correctly? – jsotola Jan 20 '18 at 5:45
• @MegamindSaiko it will monitor the voltage. – Code Gorilla Jan 20 '18 at 17:42

If you truly only have access to the red rectangle content, and not the Ground or +12V supply, you could use an opto-isolator, assuming you can use enough of the wire in the red rectangle to be able to form a voltage divider to get at least 1-2 mA through the input side of the opto.

• It gets easier if you have access to the Ground point, too... – jose can u c Jan 19 '18 at 19:34

Wrap the wire around a ferrite or some iron core and detect magnetic field.

• This may not be the most practical answer, but here's an upvote for creative thinking! – Bart van Heukelom Sep 27 '19 at 17:49

"It's the handbrake switch button..." and "..if the switch is closed, the voltage would be zero as the ground, and if the switch is open, it will read 12 V.",

you could splice into the wire and use it as an input for the Arduino. You can NOT connect it directly to an Arduino because 5V is the maximum voltage permitted on a digital input (assuming your Arduino is running at 5V).

There are several ways to connect it to the Arduino safely, such as an opto-isolator, a level-shifter or using passive components.

This circuit using 2 resistors and a zener diode may work for you:

Be sure to connect the vehicle ground to the Arduino GND.

If you can modify the cabling, you can add a shunt resistor in series and measure the voltage drop between the terminals. This way you can measure the current draw that would be 0 if the switch is open and something if the switch is closed. Other way you can use an ACS712 Current Sensor.

After examining the answers provided by "Jose can u c", "Alberto Perro" and "VE7JRO", and the comments by "Mark Smith", It was clear to me that there are a lot of methods to use, but I found out that the simplest way is to just measure the voltage at any point within the red rectangle. While the circuit is close, it will read 0V, and while the circuit is open, it will read about 12V. And of course we will use voltage divider to reduce the voltage to about 4V, and 4.7 zener diode to protect Arduino's pin.