2
\$\begingroup\$

I have a very simple central locking system in my car that I installed last weekend. It came with no remote at the moment it only works if I use the key in the drivers do where the master actuator is or if I touch the lock/unlock wire to ground. It has a small control box.

Now to lock and unlock the car via remote(Arduino). I need to pull the lock or unlock wire of the control box to GND. How do I do this? The wire only needs to be connected to ground for a second as the control box controls the timing on the actuators.

Can I do this with the Arduino only or need something like a transistor?

I have a sketch that uses a RFID module to check if the correct tag is presented and toggles the lock. It also locks the car in the setup method in case of a power issue.

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

I understand "control box" to be part of the central locking system, installed in the car and running on the car +12V supply and car-ground.

A transistor is needed if

  • The current required is more than the Arduino can "sink"

    Chances are that the current required will be low enough to present no problem to the Arduino.

  • The voltage switched is higher than the Arduino can tolerate or

  • If you want a degree of isolation against disaster.

I do not know if some Arduino's have open drain outputs (which can switch ground on and off to lines which have more that the Arduino's Vcc (Vdd) BUT
- The Arduino Duemilanove does not seem to have. If I/O buffering is not provided this capability will depend on the processor model used.

enter image description here { photo from here}

and even if it did it would be unlikely to be wise to expose it to the nominal 12V levels in an automotive system, as they may be a source of noise or spike or surge voltages of much more than 12V.

A transistor circuit is a very low cost add on and gives you more flexibility in the above areas.

The diagram below shows what is required at minimum. That circuit is from this superb webpage that deals with basic interfacing. Their focus is for PIC microcontrollers butit applied equally to Arduino. R1 (shown as 1K) is 100 ohms to 10k depending on load current.

enter image description here

If the load current is modest and you want complete isolation for safety purposes then use of an optocoupler may be wise. eg as below. That grounds the output when the input is low. To get the opposite sense (grounded output when input is high, ground the existing input pin and drive the "+5v" line from the Arduino.

enter image description here

From.

Once you have this setup working, adding an RF triggered capability can be handled with off the shelf units such as you already have.

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

You should be able to use an Arduino pin set to open drain mode. All this means is that the pin effectively works like an internal MOSFET with the input wired to drain, and when the gate is pulled high the MOSFET conducts and shorts the input to ground.

You could also use an external N-channel MOSFET/NPN in the same way, with the gate driven from a digital pin (in "standard" mode - pulse high to lock/unlock)

The external transistor would only be needed if the voltage is higher than the Arduino pin can cope with (say >5V), or you need to sink more current than it can handle (probably around 25mA) which is unlikely as most signals that use this method will use at least a 1K pullup resistor. You can confirm these points with a multimeter.

If there are no open drain outputs, then you could use a pin set to 0, and toggle from input (high impedance so line pulled high) to output (set to 0 so line pulled low) although the open drain setting is preferable.

\$\endgroup\$
  • \$\begingroup\$ I will try a NPN as its car voltages 12volts \$\endgroup\$ – Ashley Hughes Oct 15 '11 at 8:21
  • \$\begingroup\$ Do you mean the actual lock/unlock signal is 12V? It would be okay if the signal is less than Arduino Vdd. If you are not sure then it's probably best to use the NPN though, as they only a few pence each, and there is less risk of damaging the Arduino. Use a small resistor (say 500-2000 ohms) in series with the base/gate to limit current and help isolate the Arduino pin. Here is a link with some info on transistor use (about 4/5 of the way down it discusses selecting a base resistor for an NPN connected to an IC pin) \$\endgroup\$ – Oli Glaser Oct 15 '11 at 8:40

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.