Introduction: Car Auto Light System

About: diy electronics and car related projects

hey guys , modern car comes with automatic car light system which means the headlights turns on and off automatically depends on the ambient light so when it gets dark or you drive in tanel the lights will turn on automatically. even thought switching light on and off manually is not that annoying for the driver, but having this feature in old car like mime is a lot of fun and cool.

so I built a "car light system" circuit that controls the light the components I used are the following :

1- 50K ohm resistor

2- 50K potentiometer

3- 10K resistor

4- 2x 100K resistor

5- 2x 47uf capacitor

6- photoresistor

7- 358 op-amp

8 12v dc relay

9- irf44z mosfet

10- 2x 100K resistors

and few wires

Step 1: The Theory

the idea of the circuit is to convert the ambient light to a signal or a voltage then using few electronics component to control the car headlight

the photoresistor has a resistance between 20 ohm to 20K ohm changes to the respect of light as the graph shows

Step 2: The Circuit Schematic

the photoresistor is in parallel with 10K ohm resistor that is connected to the supply voltage. the voltage drop on the photoresistor changes according to the photoresistor resistance that changes according to light intensity. so we have voltage drop that changes based on light intensity. then this voltage signal is connecting to the inverting terminal of the op-amp.

at the highest light intensity the photoresistor resistance will be something between 20 ohm to 200 ohm lets say

by using the voltage divider formula : 14 * (100/100+10K) then the voltage drop is going to be not even 0.2 volt so let's assume it zero

and when it is the darkest means no light at all the resistance of photoresistor is 20K ohm so the voltage drop is

14 * (100/20k+10K) =9.3 volt

so the light signal ranges from 0 to 9.3 volt . actually in real life it will not reach these values coz it is never too bright or too dark. but the range is just there.
I connected the non-inverting terminal of the op-amp to a voltage reference between the 100K ohm potentiometer and 50K ohm resistor. so as you the op-amp is sat as comparator so when the non inverting signal is higher than the inverting signal the op-amp will out pot low , and when the non-inverting signal is higher the output will go high.

by the adjusting the potentiometer I can adjust the reference voltage , so I can chose at which point or light intensity the op-amp will goes low. in other words I chose the point of light intensity where I want the car light to switch on.

that was the core of the circuit. then at the output side it is connected to a diode, and parallel cap and resistor , the 47uF cap and 100k resistor are there to prevent the output from false trigger or short pulses, so I just want the output to change if the sensor changes and stable for at least 2 or 3 seconds. this period is controlled by the cap and resistor, so when the sensor see dark area for example while driving for very short time less than 3 seconds. nothing happens and it will be just ignored.

the rest of the circuit is just another comparator with another cap and resistor for the same purpose but this time is to ignore the short pulses while the light is already turned on.

then the output is connected to mosfet or/and relay , depends on the way that your car light is wired and how to control them. in my case for the parking light I had to use a relay and for the normal light I just used mosfet, that is how my car wiring.

after testing it on breadboard and led everything was good I did solder it on aboard and ready for installation

Step 3: Installation

the installation is pretty simple but it might be a pain in the butt to access the wires from the car light harness . so I just unplugged the light switch socket and connected the necessary wires to control the lights to the ciruit. and I knew the wires and how to control the light by using a testing light jumper wires and testing. you might be lucky to find your car wiring diagram on the internet , it is not complicated btw for old cars

then connected the ground to nearest body point and the vcc or supply voltage to the ignition wire, coz obviously I just want the system to work while the ignition is on or the car is running.

for the light sensor I connected it in a spot where it can detect the ambient light clearly as you see in pictures and then plug it to the circuit by using two wires

and yeah that's it put everything back and went for testing.

Step 4: Testing

I drove the car while the ambient light was not low still at day time , then I went under a bridge parked there for 3 seconds coz it is darker under the bridge and the lights did turn on automatically, then after I left they turned back off .

then at night they did turn on automatically too

you can check the video to see (it has English subtitles BTW!)

that's all thanks for your time !!

Make it Glow Contest

Participated in the
Make it Glow Contest