Go Down

Topic: Automatic light help (Read 834 times) previous topic - next topic

ProjectFrankenstein

Trying to adapt automatic lights into my project truck. Need help writing a code to take a reading from the light sensor and take 3 ranges of values and send them to output pins for daytime running lights, low beam head lights, and high beam head lights

OldSteve

What sort of light sensor(s) are you using?

What sort of lights are used for running lights, high beam and low beam?

A schematic diagram of your full setup would help. (Not a 'Fritzing' diagram please.)

What code have you written so far, and where is it going wrong?
Post your code, (between code tags of course). Code tags can be generated using the </> button in the "Reply" window.
Please do not PM me for help. I am not a personal consultant.
And others will benefit as well if you post your question publicly on the forums.

ProjectFrankenstein

Day time lights will be a set of led pods in the bumper and in the headlights will be 2 switchback for drl and blinkers and 2 switchback sequential blinker tubes( this is in each headlight) the low beams will be an hid in a projector so the high beam will be the same light with a flap in the projector moved up or down. The drl and low beam outputs from the Arduino will be to relays to turn them on.
I've only messed around with the sample for the light sensor and it hasn't worked out too well trying to adapt my own cut off values( forgot to put the resistor in front of the light sensor, light sensor that came with the starter pack is the one being used)

OldSteve

You answered the question regarding the type of lights, but didn't really answer the others, except an attempt re the light sensor.

You must remember that not everyone is familiar with the "Starter Pack", so more info on the exact type of light sensor would help. ie LDR, photodiode, phototransistor, other?

And:-
Quote
A schematic diagram of your full setup would help. (Not a 'Fritzing' diagram please.)

What code have you written so far, and where is it going wrong?
Post your code, (between code tags of course). Code tags can be generated using the </> button in the "Reply" window.
Looking at your last post, it appears that there are actually daytime running lights, low beam, high beam and driving lights. Is that right? Your full schematic diagram will help. Also an exact description of operation. ie Will the daytime running lights stay illuminated when light levels drop and the headlights turn on?
And I assume that you don't want automatic operation of driving lights/high beam. This could be dangerous if there's oncoming traffic. When light levels drop, do you just want low beam activated automatically?
Please do not PM me for help. I am not a personal consultant.
And others will benefit as well if you post your question publicly on the forums.

gpsmikey

One thing to consider is the time delay you need when "dark" is detected before you turn on the headlights.  My new truck has "automatic lights" and if we stop under an overpass for a traffic light, it often turns the headlights on (which causes the guy in the car in front of me to think I am flashing at him!)  On the other hand, you don't want too long a delay if you go into a tunnel for example.  Perhaps an input from the speed sensor that responds differently to "dark" if you are moving vs. stopped (under that overpass for example).
mikey
-- you can't have too many gadgets or too much disk space !
old engineering saying: 1+1 = 3 for sufficiently large values of 1 or small values of 3

AxeMurderer

Hook a button up to it that you'll be able to reach when driving so you can have the arduino disable the system and turn everything off or on manually. If something happens maybe to the sensor while driving and the lights start going haywire it could be dangerous or illegal or lead to a ticket. Having a panic button just in case makes sense to me.

Paul__B

My new truck has "automatic lights" and if we stop under an overpass for a traffic light, it often turns the headlights on (which causes the guy in the car in front of me to think I am flashing at him!)
These automatic headlights - and drivers in general who put headlights on in the daytime - are becoming quite a major menace on the roads.

gpsmikey

These automatic headlights - and drivers in general who put headlights on in the daytime - are becoming quite a major menace on the roads.

There are quite a few areas where there are signs up telling you to turn your headlights on for safety (at least here in the US).  That said, yeah, not terribly thrilled with the "automatic" feature of the headlights - seems like a Microsoft "help" type thing.  Love the rest of the truck though (if only I could get a shop manual for it !!)
mikey
-- you can't have too many gadgets or too much disk space !
old engineering saying: 1+1 = 3 for sufficiently large values of 1 or small values of 3

Paul__B

There are quite a few areas where there are signs up telling you to turn your headlights on for safety (at least here in the US).
Yes, they appeared here in Australia some (15? 20?) years back, and then quietly all disappeared.

My guess is that someone actually looked at research and figured that headlight glare from oncoming traffic was actually a serious hazard, causing fatigue and obscuring events (such as unwise overtaking) in the oncoming traffic stream.

And my further conspiracy theory :smiley-lol: is that the actual reason for the idea was at the behest of police to interfere with the common habit of flashing headlights to warn oncoming traffic of radar traps.  If some idiot is blazing his high beam (or coming over a rise on low beam) at you, you tend to indicate your displeasure, do you not?

Go Up