Electronic – arduino – Will I need diode if I add button to this schematic

arduinobuttondiodesrelaytransistors

Here is some pre-story. I removed ignition switch in my car which had five wires connected to it (accessories, ignition, starter, +12V for ACC&IGN, +12 for STARTER), and connected the wires to the relays. Relays are controlled by arduino board. The arduino board is controlled by phone over bluetooth. Everything works great, just like I wanted it to be. However, I noticed that in some cases I might want to have a button to control starter relay without arduino. This might be useful if I stall the car and have to re-start the car. In this case I wouldn't want to reach for the phone, but just use starter button. So I bought 3A@125VAC/1.5A@250VAC pushbutton just for that.

Now I have three options of connecting this pushbutton.

  1. Put it between 5V and resistor that goes before transistor.
  2. Put it between ground and relay coil wire
  3. Connect the button to arduino. Read the input on arduino and then set the output for +5 control pin.

Here is the picture of schematic. "Digital pin" is some digital pin on arduino board that send +5V. On the top "+-12V" is just a sing +12V wire. And finally RLY1 is the relay.

enter image description here

I kinda see why and how I would want to have a diode for case 1 and 2 so that the current doesnt flow to the collector side of transistor. Or similarly have diode so that current doesnt go to the digital output pin on arduino.

Does this make any sense?

Best Answer

All the methods will turn your car unsecure, do it with caution.

The easy way:

I think that the easy way is to connect the button in a input of the Arduino, then, Arduino send the command normally to the transistor. But its not the most reliable way, because if the Arduino for some reason doesn't work, your car won't work too.

The reliable way:

Is just put your button in parallel with the transistor, that will work as the example below.

schematic

simulate this circuit – Schematic created using CircuitLab

The 3rd solution will work too, but you will have more work, because you will need get 5V somewhere to power it, and putting in parallel with the transistor is already there 12V.

Keep the diode the way it is. It is helping to raise the lifetime of the relay.