Send a "0V" signal? (Ground?)

A dumb question, but I need to know.

I've got a car with central locking, the problem is I want to add 3 features to it using an arduino. I know that Pin 23 is the "LOCK" signal, and PIN "35" is the unlock signal.

I will be able to use an interrupt to determine 12V is present on one of the interrupt pins.

The document says that in 'Neutral' (i.e. no lock or unlock signal), there is 5V present on pins 23 and 35. When a signal is sent, it will be at 0V - so to get them to lock / unlock, I plan to join wires to the existing cabling at those pins, and then have arduino provide the ground source for it based on ignition signal.

What I don't know is how can I ground the pin using arduino to deliver the necessary 0V signal ? Is there anything I should watch out for in doing this - Am I right in joining on to the in place circuit (at the pin, there will be two wires leaving, one to arduino, one to the locks / switch - do I need to isolate that at all?

Some more info if it helps!: Page 17 of the PDF describes the involvement of the pins and the locks (5V neutral, 0V when key turned).

I plan to have the "ON" position of the ignition through a zener diode, and use that as an interrupt to indicate the ignition is on. When the ignition goes to "ON", a lock signal should be sent. When it goes to "Acc" or "OFF", an unlock signal should be sent (so a "CHANGE" interrupt should do it). I might then go further to have the key switch (detects key present in barrel), to then have a interrupt timed to send a lock signal.

Anything to watch out for with my plan?

I’ve got the how - digitalWrite(pin, LOW) to ground the pin, configured as an output.

But I’m still not sure if it’ll be electrically safe to simply run the cable to the pin (i.e. what would happen if the lock was turned, and the other wire was left at it’s HIGH state - wouldn’t that stop it working)?
Not sure if I need to do any isolation in terms of resistors or the like to make sure it’s safe to connect with?

Would the solution then be to configure the pin as an input after use - so that it’s not going to interrupt the central locking from it’s usual operation, such as setting it high (5V) would by making the system think there is no key turning the lock…?

The PDF I linked in the opening post shows the signal as 5V neutral. It won't be current, as I think it's just a signal to their control unit - but if an NPN transistor to ground accomplishes the same effect without any negative results - it's probably worth doing.

There shouldn't be any voltages on the pins higher than the 5V neutral that the signal across the lock has - I doubt much current is drawn.

the signal as 5V neutral. It won't be current

Yes it will, you can't change the voltage without involving current flow. It is not 5v neutral, it has a voltage on it already that you have to short to ground. This involves current flow, but it also involves an existing voltage greater than the arduino can cope with, that is why you need a transistor.

Purely out of interest purposes, how is the voltage out of the arduino's range, when it is in fact 5V? I'll put the transistor in, but just curious how that is so?

Is it because of the potential for a fault to develop, and >5V could end up there? From the PDF, it's 5V, and I was of the understanding Atmega328's tolerate input of 5V.

That manual doesn't say what the properties of those control signals are - they might be directly connected via a mechanical switch, a push-pull logic output or a simple open-collector driver with resistor pull-up... Only in the latter case can you do what you want easily (ie without adding logic gates). You could try measuring things with a multimeter to try and figure it out, or try and find the actual circuit schematic.

Be warned that '5V' in an automotive context could be very poorly regulated and have high voltage spikes on it that would trash an Arduino - there can be a lot of crosstalk in wiring harnesses.

A transistor is what I’d need to ground the signal (i.e. after I know an event has occurred), but what about the connection to the interrupt pin?

A diode and resistor to ensure voltage and current remain acceptable I suppose.

What happens at the transistor base if it’s connected to an arduino input pin?
I’ve had a look online for this specific question but could not get an answer, would it being open, cause the transistor to be fully open, or is there still some leakage (I’m just trying to get ahead, as it will be sharing the same connection at the control unit, some leakage could cause intermittent issues that I’d like to get ahead of).

  • A NPN transistor C - to the control unit pin (which waits for the signal to be grounded to decide it needs to unlock / lock all doors), B- Arduino pin set to input mode when not needed, set to output when I need to ground the signal (assuming input is the right pinmode for this!), E- Ground
  • A Diode and Resistor on the control unit pin that gets the grounded signal from the lock, to interrupt Pin 0 / 1.

Then in the code, interrupt will wait for event (such as ignition in on position), if so, issue lock all doors by grounding the pin that would be grounded if the drivers side door was locked.
If key just reached acc position, unlock all doors.
Or if key not in ignition, 300 seconds, lock doors.

I’m mostly concerned about interference by joining onto the existing cabling that goes into the control unit (as logic is easily corrected), so I hope I have my bases covered, but would appreciate any further tips with respect to joining onto the pins (the ones I will be are the pins that get grounded by the lock so I can ground those to get the desired lock / unlock actions without interfering with it’s normal operation) and the ignition ‘key present’ indication (it has a beep alarm that reminds you to remove the key, so it’s electrically possible to know there is a key there, I believe this will be 12V - so a zener diode at 5.1V is what I thought here?)