4
\$\begingroup\$

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?

\$\endgroup\$
  • \$\begingroup\$ What happens when you send the command to the transistor? Its just a pulse or stay in the new state? \$\endgroup\$ – Butzke Oct 9 '13 at 17:28
1
\$\begingroup\$

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.

\$\endgroup\$
1
\$\begingroup\$

The easiest solution is your solution 2. Connect the push button from relay coil to ground, across the transistor.

The best solution in my opinion is your solution 3. It is best fit for future changes to your requirements. If you change your mind, eg. you don't want the push button to work under certain conditions, it is easy to implement in software without having to change the wiring. Do add some extra input protection on your Arduino though to protect from overvoltage and noise. Use a series resistor and a couple Schottky diodes to clamp the input to Vcc and GND.

schematic

simulate this circuit – Schematic created using CircuitLab

The diode in parallel to the relay is cheap and protects the transistor (and in turn the Arduino's microcontroller) in all three of your solutions.

\$\endgroup\$
0
\$\begingroup\$

The diode will prevent arcing on the switch, which would otherwise reduce its lifetime. You only need a single diode to protect all parts in line with the coil though.

\$\endgroup\$
0
\$\begingroup\$

Outside of this making it absurdly easy to steal your car, the pushbutton would go around Q1.

Keep the diode where it is. The diode is acting as a flyback diode and absorbing the "kick" the relay coil gives off when the power is stopped.

You need one diode per relay coil, not per switch (the transistor counts as a switch). If you omit this diode, the relay's voltage spike is going straight back into your +12V system, and that spike can be hundreds of volts.

\$\endgroup\$
  • \$\begingroup\$ Yes, stealing the car will be easy thing, but I am halfway through emulating transponder chip on the arduino. Hopefully no one steals it before that is done. Besides keeping already existing diode, would I want to have one more for a push button around Q1? \$\endgroup\$ – jM2.me Oct 9 '13 at 17:33
  • \$\begingroup\$ You only need the one diode, around the inductor itself. I'll edit my reply. \$\endgroup\$ – Bryan Boettcher Oct 9 '13 at 17:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.