I am making a circuit to unlock my car doors. The central locking in my car works with 2 wires one at 12V, the other at 0V. When the 12V line is pulled low, the door locks. When the 0V line is pulled high, the door unlocks.

I breadboarded a circuit to let me do this ( testing circuit uses push buttons - will be replaced with remote arduino commands in future), and that works fine. I soldered up the same circuit, but when connected the doors continually lock and unlock - even when the gates on the transistors have no voltage applied. I've included a photo of the soldered perfboard (please excuse the shitty soldering) in case there is something there.

My first thought was that I had cooked the transistors, so I took another piece of perfboard and redid the whole circuit (wires were wrapped together), but I still had the same problem of it continually unlocking and locking.

This is my first time using perfboard so I am not sure whether this is an issue related to that, or something else. Any help would be much appreciated.

  • \$\begingroup\$ Are there +12 and GND wires to the auto electrical supply that are not shown? There should be four wires going to the car, from your description. \$\endgroup\$ – Spehro Pefhany Mar 25 '14 at 14:25
  • \$\begingroup\$ Looks like you've shorted the two terminals on one of the FETs together? (Backside perfboard, at the top) Also there is a wire on the 2nd Fritzing diagram that doesn't do anything. (Black, between the green switch wires). I would recommend drawing a proper schematic, as that is the "language" Electrical Engineers speak. \$\endgroup\$ – dext0rb Mar 25 '14 at 14:26
  • \$\begingroup\$ You will get much more answer if you provide a schematics. Schematics are much more readable for an EE than an Arduino wiring diagram. And it's more efficient if you do it once, rather than every EE that want to help you translate your wiring diagram into a schematics. This is a kind of annoying barrier that will, for sure, discourage a lot of people that would have helped you. \$\endgroup\$ – Blup1980 Mar 25 '14 at 14:29
  • \$\begingroup\$ Most likely, you have an incorrect understanding of your car's wiring, that while it (the incorrect understanding) works in theory (your breadboard), actually wiring your car up causes it to fail. You look like you are shorting 12V Power to Ground, I'm surprised you didn't fry more than just some transistors. First step, find (and post) an actual/relevant wiring diagram of your car's door locking wiring. \$\endgroup\$ – Passerby Mar 26 '14 at 0:00

You connection seems to be like this:


simulate this circuit – Schematic created using CircuitLab

The central locking in my car works with 2 wires one at 12V, the other at 0V. When the 12V line is pulled low, the door locks. When the 0V line is pulled high, the door unlocks.

I'm not very clear on this. Do you mean that the 12v and 0v lines you describe are similar to weak pull-up and pull-down lines? Can you connect the 12v to GND without getting a short and that is also the case when you connect the 0v wire to 12v?

Lets go to your circuit.

M2 section
M2 operates as a low side switch and is able to pull down the 12v line (ground it) when the 5v is applied to the mosfet gate. Assuming that this is what you want to do, it will work fine.

M1 section
The first problem is that in order to use a N-mosfet as a high side switch you have to apply to the gate a voltage higher than the voltage of the drain, so unless the 5v is from an isolated supply (not coming from the car supply) you'll need to apply to the gate more than 12V (about 15V or more).
The second problem is that according to your description you are trying to apply 12v to the 0v line , but what you do is connect the weak 12v to the weak 0v, how can this work?
You can replace the N-mosfet with a P-mosfet and a transistor to control it, but I can't help much without understanding the characteristics of the 12v and 0v lines you describe.

I think it would be safer to just use optocouplers between the car lines and Arduino. Also a P-mosfet for the high side switch and the N-mosfet for the low side switch.


simulate this circuit

| improve this answer | |
  • \$\begingroup\$ I think so? If I connect the two wires (12V and GND) from the car together, nothing happens. The 5V to the gate is coming from an arduino powered from a 5V DC line. M2: That's correct. M1: Okay, the 5V is coming from an arduino, does that make a difference. You make a good point, but it does (or did) seem to work... I breadboarded up another prototype as above last night, and it was working as intended, but tried the same circuit (exactly the same. Not touched from overnight) and had the same problem as I had with the perfboard. Thoroughly confused. \$\endgroup\$ – cjdbarlow Mar 26 '14 at 0:13
  • \$\begingroup\$ @user2975986 If connecting the weak 12V and weak 0V lines does nothing, then how is the M1 part of the circuit supposed to work? The purpose of the mosfet is to connect these two lines which will not have any effect as you said. Are you sure that you are not supposed to use the true 12V from the car battery? If the ground of Arduino supply is isolated from the car ground then you can connect the Arduino ground to the source pin of M1 and drive the mosfet fine. If the ground is common then it will not work, it will just pull the 0V line to about 7v or so (unless you are fine with that level) \$\endgroup\$ – alexan_e Mar 26 '14 at 8:55
  • \$\begingroup\$ Sorry alexan_e - that was an error before. Connecting both wires causes the door to unlock. The arduino supply is separate from the car battery and they have separate grounds. If I connect the arduino ground to the M1 source does that risk damaging the arduino when the M2 gate is open? \$\endgroup\$ – cjdbarlow Mar 26 '14 at 9:55
  • \$\begingroup\$ @user2975986 If the car and Arduino grounds are isolated then you can connect the Arduino ground to M1 source and M1 will work, but if you also connect the Arduino ground to M2 source then the grounds may not be isolated any longer. If you don't connect the Arduino ground to M2 source then the M2 circuit will not work because the gate voltage will have no reference. I think it's better to just use a P-mosfet for M1 and A N-mosfet for M2 and drive them both from optocouplers to be safe. I'll update my reply. \$\endgroup\$ – alexan_e Mar 26 '14 at 10:24

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.