Time delay relay module for automotive use

Thread Starter

Ping pong

Joined Feb 13, 2022
78
Hey. I have been using a relay module which basically allows for a delay on/delay off function on the relay without the need of any microcontroller like a nano controlling it, hence making it pretty compact and easy to work with.
I have been using this module for quite some time now to mimic the coming/going home feature in modern cars where the car lights turn on for a couple of seconds after someone locks/unlocks their car to illuminate their path or what not. The relay module has positive and negative trigger terminals for it to initiate its task which in my case is to turn on the relay for 20seconds after the car is either locked or unlocked. Currently i am using the dome light as the trigger since that turns on/off when the car is locked/unlocked.
However, this is not the case in some older models where the dome light does not respond to the car locking/unlocking. What I have found though is that every car has two wires, one for locking and other for unlocking, running through which gives a pulse of negative trigger (is grounded) when the car is either locked/unlocked. these wires normally maintain 5v, dropping down to around 2.5v-2.7v when the car is in its sleep state aka the car has been locked for over 2-5minutes.
The question is how can i make use of this negative pulse where the wire gives a ground signal momentarily with the relay module when someone locks/unlocks their car. i would love to join the two wires with two diodes in between and connect these wires to the negative terminal of the trigger with the positive terminal connected to a constant 12v source so when the locking wires give a pulse of ground signal, the relay starts its function. However, connecting those wires to the negative terminal of the module would probably fry it as the two wires idle at 2.5-5v as described earlier and the module definitely does not have any protection if the polarities are swapped as it would be in this case.
Using a second relay to act as a trigger switch does not seem to be a viable option either to me. I'm pretty much out of ideas which is why i need your help.
If the answer was pretty simple and pretty much in front of my eyes, i do apologize in advance as i am an accounts student with a keen interest in crappy old cars lol. electrical stuff is still somewhat new to me even though i have been dabbing into basic automotive electrical stuff as somewhat of a hobby for a year almost. And yes, before you warn me, i take full precautions of everything and do not execute a project similar to this unless I'm 90% sure it wouldn't end up in an electrical fire :)

The module used:
https://a.co/d/9wrS5nd
 
Last edited:

sghioto

Joined Dec 31, 2017
5,388
Using a second relay to act as a trigger switch does not seem to be a viable option either to me.
Have you looked into using an opto-isolator? When the voltage is at 2.5 volts does it go all the way to zero volts when locked or unlocked?
I'm thinking something like this: Needing a 2.5 volt source for the opto using a small linear regulator.
1705856163803.png
 
Last edited:

Thread Starter

Ping pong

Joined Feb 13, 2022
78
Have you looked into using an opto-isolator? When the voltage is at 2.5 volts does it go all the way to zero volts when locked or unlocked?
Don't really know much about an opto isolator but will look into it.
As for the voltage, I'm basically using a cheap multimeter to check it. If I connect one probe to constant 12v and second to let's say the unlock wire and unlock the car, it shows 12v for a split second during which the car doors unlock, otherwise it remains at 0v. Whereas if I connect one probe to ground and the other to the unlock wire it shows a constant 2.5-5v and when I unlock the car it shows 0v.
 

Thread Starter

Ping pong

Joined Feb 13, 2022
78
In that case I believe the circuit posted in #2 should work.
yeah, I did look into optocouplers, and they definitely serve my purpose. the diagram is pretty clear as well. However, i do have questions for the implementation. Why am i stepping down voltage to 2.5v. can i not plug it directly to12v with a resistor in between as shown in the image below. is it because voltage would flow from the 12v source to the unlock wire?
How exactly do i use linear regulators for this purpose as i have only ever used a buck converter when stepping down voltages. Secondly, why is there a 10k resistor between the 12v line. And can I use a 1k resistor in place of R1 as shown in the image.
 

Attachments

Last edited:

sghioto

Joined Dec 31, 2017
5,388
Why am i stepping down voltage to 2.5v. can i not plug it directly to12v with a resistor in between as shown in the image below.
Because with respect to ground the the output on the Lock and Unlock line is 5-2.5 volts and goes to zero volts when activated.
I'm using a 2.5 volts supply source so the internal IR LED diode is reversed biased when the Lock or Unlock line is at 5 or 2.5 volts.
Meaning there is no current draw until the output from the Lock or Unlock goes to ground.
Secondly, why is there a 10k resistor between the 12v line.
Actually that 10K resistor R2 can be removed as the Relay Module input has a pullup resistor already.
Linear regulator I'm speaking of is just a small transistor looking component like this:
1705859746485.png
Complete circuit using a more common 3.3 volt regulator.
R1 and R2 may need to be adjusted depending on the input current required for the relay module.
1705862378219.png
 
Last edited:

Thread Starter

Ping pong

Joined Feb 13, 2022
78
Couldn't find much info for the input current. Just mentions the voltage but I'll measure it when I have the components with me. As for the regulator, I might just stick with a mini360 to step down the voltage.

Thank you very much!!! That was very helpful..
 

Attachments

sghioto

Joined Dec 31, 2017
5,388
It's the negative trigger input. You said in post #1 it had positive and negative triggering but after further review of that module I see it's positive trigger only with the negative side of the input isolated from the negative DC power.
Give a minute to redraw the schematic.
 
Last edited:

Thread Starter

Ping pong

Joined Feb 13, 2022
78
Should be wired like this for a positive trigger on the Relay Module.
Nah. Since I'll be using a mini360 buck converter to reduce voltage to 2.5v, I'll probably have to use negative trigger as the minimum trigger input voltage for the module is 3v. But not a problem, both implementations are pretty clear and easy.
However, now that I know some what about optocouplers, my spidey senses have started tingling and I kinda want to have some sort of implementation for these in my Arduino project as well.
The project I'm referring to does the same job as the one above where the car lights are turned on for a set number of seconds. However, Arduino allows me to add several more triggers like door, ignition etc, both positive and negative triggers at the same time and separate delay times for each trigger. But I have a few more questions.
The Door trigger basically has no current running through it when the door is closed. However, when the door is opened, the wire gets grounded. Unlike the unlock wires where there was always voltage present in the wires, this isn't the case for the door. This means if I use a pull up resistor connected to 5v with the Arduino, the voltage drains through the door wire when it isn't open.
If I use an optocoupler instead, connecting pin1 to 5v/12v and pin2 to the door wire, will the voltage from 12v line still run through from the optocoupler to the door wire?
How can I isolate the door wire and use the ground signal from it for the Arduino.
 

sghioto

Joined Dec 31, 2017
5,388
Are you sure there isn't any voltage on the door wire when the switch is open?
BTW in the previous circuit the voltage regulator was changed to 3.3 volts for positive or negative triggering using a 1K resistor.
 

sghioto

Joined Dec 31, 2017
5,388
How can I isolate the door wire and use the ground signal from it for the Arduino.
From your description of the wiring this arrangement might work to isolate the Arduino input from the Door switch depending on how the vehicle electronics are wired.

1705898352463.png
 
Last edited:

Thread Starter

Ping pong

Joined Feb 13, 2022
78
From your description of the wiring this arrangement might work to isolate the Arduino input from the Door switch depending on how the vehicle electronics are wired.
So the voltage does not drain from pin1 of the optocoupler to pin2? I'm comparing this with a standard relay where if you supply 12v to one end of the relay coil, the other end will also show just below 12v considering no other wire is connected to the other end of the relay coil.

And btw is there a limit to the number of triggers I can connect to the Arduino (nano in my case) using the internal pull up resistor? I've always used external 10k resistors but if I can connect up to maybe 3-4 triggers without the need of external resistors, that would make everything more simple.
 
Top