Automatic Light Circuit For My Car

Status
Not open for further replies.

Thread Starter

tonysticks

Joined May 2, 2008
5
Hi All,

I'm new to this forum and I was hoping someone here can help me with my problem. First I want to appologize for the long description. I hope you bare with me.

thanks.

==>
I have a car and I'm trying to create a circuit that will turn the car's headlights on automatically when it gets dark.

I'm attaching two images that show the circuit. the circuit works great outside the car (or at least if I didn't connect it to my headlights). The relay respondes to light changes perfectly.

My problem happens when I connect the relay to turn the car's headlights on. At that moment, if I cover the light sensor with my hand, I hear a buzzing sound from the relay like if it's turning on/off very quickly.

I think the problem happens because I'm using the car's battery to provide the power to the circuit and the headlights at the same time. When the relay closes, the resistance of the headlights is lower than the resistance of the circuit and this will acutally cut the power off the circuit which makes the relay turn off. then the power comes back to the circuit after the headlights turn off and then the circuit turns the relay on again. This of course happens very quickly and that what causes the buzzing sound. (take a look at the second photo).

I tried today to use a separate battery to provide the power for the circuit and used the car's battery just to provide power for the headlights and everything worked perfectly.

However, this is not an acceptable solution because when it gets dark, the circuit will close the relay and keeps it close all night. This will consume the external battery very quickly. (btw, the battery is a normal 9v battery)

What I'm looking for is a solution where I can use the car's battery to provide power for the circuit and at the same time to use it to turn the headlights on (without getting the buzzing sound of the relay).
 

Attachments

Norfindel

Joined Mar 6, 2008
326
I don't think this would solve your problem, but you should be using an inverted diode in parallel with the coil to avoid harmfull negative spikes by the coil. Transistor manufacturers tend to have application notes regarding transistors as a switch element for motor, relays, etc. Look for them.

To what wire are you conecting the circuit? If it's the same wire that powers the lights, that can be your problem. Use a wire without anything that draws high currents to power the circuit, or use your own wire (remember to use a fuse near the battery, if you do this). The relay contacts should switch the original cables going to the lights.
 

Thread Starter

tonysticks

Joined May 2, 2008
5
Hi Guys,

thank you very much for the replies.

@Norfindel:
Yes, I'm using the same power wires which are used to supply the power to the headlights switch to provide the eletricity for both the circuit and the headlights themselves. I guess this explains the problem, but are you aware of any solution that you can use to provide the power for both without one of them affecting the other?

@thingmaker3:
I already tried to provide the electricity for the circuit from a normal 9v battery and the whole thing worked. The problem is that, this circuit will keep running at night even if the car is not switched on. This will consum the battery very quickly.
 

Norfindel

Joined Mar 6, 2008
326
Hi Guys,

thank you very much for the replies.

@Norfindel:
Yes, I'm using the same power wires which are used to supply the power to the headlights switch to provide the eletricity for both the circuit and the headlights themselves. I guess this explains the problem, but are you aware of any solution that you can use to provide the power for both without one of them affecting the other?
Yes, use one cable to power the circuit, and another one to power the lights.
The problem is that a cable is really a resistor. With heavy currents, there can be a significant voltage drop in the cable, so you don't get 12v anymore. This can be very brief, as cool lamps are almost a short circuit, but heatens very quickly, and their resistance increments a lot.
I think that's what is happening. To solve it, just use one wire to power the potentiomenter/transistor, and the heavy wire to power the lights.
To understand this, suppose that the cable has only 0.1 ohm resistance. Normally, you won't be able to measure any significant voltage drop, but let's suppose there's a sudden 10 ampere surge, there would be a 1 volt drop in the cable, or 10 volt drop for 100 ampere surge. I don't know if this numbers for resistance and current surge make any sense for the car cable, and lamp switch-on surge, but i think that's basically what's happening here.
 

Thread Starter

tonysticks

Joined May 2, 2008
5
Norfindel,

thanks for the info, but I think you didn't understand what I'm trying to do. I want to use one battery (the car's battery) to provide the power for both my circuit and the headlights.

The problem (at least my theory) is that the headlights have a very low resistance which acts like a short circuit when the relay is closed, which in turn stops the circuit from running. I think image 2 above explains it perfectly. When the relay is closed, the headlights work as a small resistance which consumes all the current that is applied to the circuit which makes the circuit stop and the relay to turn off.
after the circuit is turned off (and the relay too), the circuit will receive the current again and work again which makes the relay turn on again and so on. This is what is causing the problem.

I need to modify the circuit so that the circuit keeps receiving current from the battery even if the relay is turned on (and the headlights).
 

Audioguru

Joined Dec 20, 2007
11,248
A car battery can supply hundreds of amps to start a cold engine.
Your problem is the resistance of your wires. Because you use one set of wires for the circuit and for the lights. You need two wires for each.
 

RKEM

Joined May 1, 2008
3
You could try slapping a big capacitor across the input of the relay to keep the control voltage from sagging when the lights come on. If you don't have a big cap on hand, the best way to do this would be to power your circuit from the Acc circuit as suggested above. This is a vehicle circuit that is only on when your key is in the ignition so no worries about draining your battery while the car is parked. Then run a separate, fused, heavy gauge, wire directly to the battery, this wire will be switched on and off by the relay and will power the lights directly.
Ultimately everything is run off your car battery but by giving them separate connections to the battery you lessen the voltage dip the control circuit sees when the light tun on.
 

Norfindel

Joined Mar 6, 2008
326
Listen to Audioguru.
To understand what happends there, just draw the circuit again, but instead of the cable going to the circuit, put a 1 ohm resistor, and assume that the lamp consumes 12 amperes for 1 second. That way you would understand, Ohm's law doesn't lie.
Your problem is cable resistance, not battery performance. The battery voltage won't go down because of the lights, you can consider it a perfect voltage source.
 

Norfindel

Joined Mar 6, 2008
326
Look at the attached image. An image is better than a thousand words :)

At the left it's what it's probably happening now, you have a cable which has a very small resistance, then a high resistance potentiometer in parallel with a lamp (that is a short circuit, for a very small period of time).

Note that any voltage drop at the potentiometer in that moment would turn the transistor off, and you have a short circuit in parallel with you potentiometer.

At the right is my proposed solution. Now there are two cables (simbolized by 2 very small resistors). As you can see, the potentiometer isn't affected, because the heavy current lamp (basically a short circuit when cold, and a small resistor when hot) is on another circuit branch.

Oh, and you should use a separate connection to ground, also. Any piece of wire has enough resistance to develop significant voltage drops if the current is high enough. V = I * R, there's no way around that, other than having the heavy loads "isolated" in a circuit branch, as to not disturb other parts of the circuit.

Look at the cable for the starter motor. It consumes so much current, that the cable is huge and runs directly from the battery terminal. Clearly nothing else should be connected to that cable, and that's why the car manufacturers use that cable to power the motor alone, and nothing else.
 

Attachments

Externet

Joined Nov 29, 2005
2,217
Hi. Make the transistor control circuit for the relay to work on 5 to 8 Volts, regulating its supply with a 78M05 or 78M08.
It will take a lower voltage relay too.
 

Thread Starter

tonysticks

Joined May 2, 2008
5
@Audioguru, RKEM:
I already tried that. First, I used the relay switch to connect both wires that are supposed to turn the headlights on. I then used a direct wire from the battery to provide the circuit with power. The ground was common in that setup. Unfortunately, I got the same issue. Is that what you mean? or I missed something?

@Norfindel:
Thanks again for your explanation. I think now I understand. You're saying that the headlights will consume considerable power *only for a small time* and will make a short circuit for my autolight circuit because they're using the same supply wire.
but I already tried to use a separate wire to provide the power directly to the circuit from the car's battery and I had the same problem. Is that what you're suggesting as a fix?
 

Audioguru

Joined Dec 20, 2007
11,248
You used a common ground wire. Its voltage drop with the high current of the lightbulb turned off the transistor. Then with the current gone the transistor turned on again. Over and over.
You must use separate wires.
Use two wires to power the electronic circuit and two different wires to power the lightbulb and its relay contact.
 

Norfindel

Joined Mar 6, 2008
326
@Norfindel:
Thanks again for your explanation. I think now I understand. You're saying that the headlights will consume considerable power *only for a small time* and will make a short circuit for my autolight circuit because they're using the same supply wire.
but I already tried to use a separate wire to provide the power directly to the circuit from the car's battery and I had the same problem. Is that what you're suggesting as a fix?
You're welcome.
Remember that you cannot use a common ground cable, as Audioguru said. Cables aren't perfect connections, consider all of them like small value resistors. It doesn't matter if they go to the - (GND), +, or any other place, they have some amount of resistance, and that resistance can be problematic sometimes. The heavier the current a cable conducts, the heavier the voltage drop in that cable, as ohm's law says:

Vdrop = I * Rcable​

In your circuit, the problem is that you have a heavy current load next to a very sensitive device. In the very moment the light is dim enough (as set by the potentiometer), the transistor will switch the relay on. However, any disturbance around the potentiometer and/or the transistor, can cause it to stop conducting. As the disturbance is created by the lights, once they're shut off, the transistor would conduct again.

Another thing that can cause problems, is if part of the lights are reflected back to the sensing device. That would make them to turn on and off continuously. Moreover, any strong enough light seen by the sensor would turn the lights off. This can be lights from another vehicle, or streetlights, etc.

I also recommend connecting a diode in parallel to the relay coil. The diode must be connected backwards, it shouldn't conduct any current normally, it's only to discharge the coil reverse voltage that can damage the transistor, and who knows if it cannot cause it to stop conducting briefly.

To resume:
-Use dedicated + and - cables to power the potentiometer/transistor.
-The relay should only switch the original cable going to the lights.
-Use the diode to protect the transistor from reverse voltage spikes.
-Watch out for other light sources, they can turn off your lights if they're powerfull enough.
 

Thread Starter

tonysticks

Joined May 2, 2008
5
Thank you both Audioguru & Norfindel. I will try to use the cables that power the headunit (my cd player), both + & - to power my circuit as well. I think you're right about this because the CD player keeps running even if I turned my headlights on (manually), so it's not affected by the current drop in the headlights circuit.

I will let you know if it works.
 
Hello, i have a circuit to do the same and once i got the buzzing sound on the relay. i rechecked the connections and it was a wrong connection on the relay...check if it's everything connected in the right place. it worked for me.
 
Last edited by a moderator:
Status
Not open for further replies.
Top