headlight control

I am trying to make all 4 of my headlights come on with high beams enabled and only the low beams with the low beams enabled. The low beams should stay on all the time while the headlights are enabled.

Is this related to a previous thread of yours ?

Yep, same goal, no need to make people read through 7 pages of nothing usefull

im 100% for using a arduino to solve a problem but in this case just add a relay like everyone else has for the last 30 years. there's hundreds of wiring examples on the net

Or a diode between the relays you already have. Your Arduino is better employed doing something you can tell your friends about. Another option is to connect the low-beam relay to the input of the dipswitch.

These things would work exept i'm using hid's so the power on the low beam lights has to stay on, there can't be any off time for the low beam lights

so you are trying to turn on the high beams with out turning off the low beams?

Ogmudbones:
These things would work exept i'm using hid's so the power on the low beam lights has to stay on, there can't be any off time for the low beam lights

Read reply #4 again. It might be a stretch of the intellect, but the usual way to avoid off-time for low beam is to not switch them off, and what I said therein applies irrespective of the type of light. If you really feel you need to use an Arduino to expedite that, feel free to do so, but it wouldn't be a good idea to tell your friends - or your mother.

I recognise that there are cars around using projector lights with halogen bulbs , but the nature of your post rather makes me suspect you are using junk replacement bulbs in a four-lamp setup not designed for purpose - to the point of it likely being illegal. Typical proper practice includes a properly designed projector that has a shutter controlled by the dipswitch over a single light that is permanently on, thereby solving your problem. High-beam is done by halogen or LED, but I get the impression that modern cars aren't bothering with a separate high beam light, and for good reason.

If I'm guessing right, you might note that you can get proper HID projector inserts for just about anything made in the last sixty years. My daughter has them in an ancient Nissan Patrol with 7" round headlights. Popping for a pair of those will impress the hell out of your friends, and rather lessen the the chances of killing somebody, including yourself. No Arduino required.

Ogmudbones:
Yep, same goal, no need to make people read through 7 pages of nothing usefull

You should at least explain exactly what you are trying to do otherwise there will be another 7 pages of discussion going nowhere.

For instance, how much are you prepared to change the vehicle wiring to achieve your aim ? If I remember correctly you want to just plug the solution into existing connectors rather than cut or connect to any wires. Is that correct ? I also seem to remember also that you posted a link to a commercial system that does what you want.

gpop1:
so you are trying to turn on the high beams with out turning off the low beams?

Pretty much thats the idea

Nick_Pyner:
Read reply #4 again. It might be a stretch of the intellect, but the usual way to avoid off-time for low beam is to not switch them off. If you really feel you need to use an Arduino to expedite that, feel free to do so, but it wouldn't be a good idea to tell your friends - or your mother.

I recognise that there are cars around using projector lights with halogen bulbs , but the nature of your post rather makes me suspect you are using junk replacement bulbs in a four-lamp setup not designed for purpose - to the point of it likely being illegal. Typical proper practice includes a properly designed projector that has a shutter controlled by the dipswitch over a single light that is permanently on, thereby solving your problem. High-beam is done by halogen or LED, but I get the impression that modern cars aren't bothering with a separate high beam light, and for good reason.

If I'm guessing right, you might note that you can get proper HID projector inserts for just about anything made in the last sixty years. My daughter has them in an ancient Nissan Patrol with 7" round headlights. Popping for a pair of those will impress the hell out of your friends, and rather lessen the the chances of killing somebody, including yourself. No Arduino required.

I have never in the year i've had my hid's in been flashed for my low beams being to bright, if anything it makes it safer since im not tempted to just leave the highs on because of the warmup time on the low beam lights.

Bump

To wire in a arduino you would have to understand the current wiring for

headlight low
headlights high
light switch
light selection switch
and possible the light control module

this all depends on the car

its basically if low beams or high beams are on low beams are on

im presuming that your car has one relay doing high and low beams if so then you can install a relay to bypass the low side while the high beams are on. A capacitor on the original relay will act as a time delay bridging the gap between when the lows are shutting off and the highs are turning on. The capacitor will probably have to delay the relay from switching for 0.1 second.

if you car has 2 relays then a diode can be used to power the low beam relay when the high beam is turned on. A cap may be required for that split second the relays are both off (if you have a module there may be no split second they are both off, in which case a diode is all that's required plus a extra few diodes to stop back feed to the module)

use a arduino if you like but be warned if you don't understand the light wiring in the car you will not be able to get it to work. The arduino will be nothing more than a smart time delay for a relay.

gpop1:
To wire in a arduino you would have to understand the current wiring for

headlight low
headlights high
light switch
light selection switch
and possible the light control module

this all depends on the car

its basically if low beams or high beams are on low beams are on

im presuming that your car has one relay doing high and low beams if so then you can install a relay to bypass the low side while the high beams are on. A capacitor on the original relay will act as a time delay bridging the gap between when the lows are shutting off and the highs are turning on. The capacitor will probably have to delay the relay from switching for 0.1 second.

if you car has 2 relays then a diode can be used to power the low beam relay when the high beam is turned on. A cap may be required for that split second the relays are both off (if you have a module there may be no split second they are both off, in which case a diode is all that's required plus a extra few diodes to stop back feed to the module)

use a arduino if you like but be warned if you don't understand the light wiring in the car you will not be able to get it to work. The arduino will be nothing more than a smart time delay for a relay.

I have a relay board that will act as the headlights power control the headlights old relays will only be used to signal to the arduino and yes i am cutting the voltage back to 5 for the sense pins. But basicaly yea i wanna make my arduino a smart time delay

ok write a basic plan including what we are using and when we are using it and I will help with the code

e.g

pin 2 input low beams are on car side
pin 3 input high beams are on car side

pin 4 output turns on low beam relay
pin5 output turns on high beam relay

what kind of relay board (low is on or high is on?)

assumming you have 9004's

gpop1:
ok write a basic plan including what we are using and when we are using it and I will help with the code

e.g

pin 2 input low beams are on car side
pin 3 input high beams are on car side

pin 4 output turns on low beam relay
pin5 output turns on high beam relay

what kind of relay board (low is on or high is on?)

Pins 2&3 input 4,5,6,7 are output its a low active board

Ogmudbones:
Pins 2&3 input 4,5,6,7 are output its a low active board

work with me mate.

2 and 3 are inputs. from what?

4,5,6,7 are outputs to ............ you want me to program the lights then you figure out what I programmed or do you want them programmed to a set point. Im guessing as theres 4 relays then left and right are different relays?

gpop1:
work with me mate.

2 and 3 are inputs. from what?

4,5,6,7 are outputs to ............ you want me to program the lights then you figure out what I programmed or do you want them programmed to a set point. Im guessing as theres 4 relays then left and right are different relays?

2 is low beam in 3 is high beam
If pin 2 high low beams on
If pin 2 goes low but pin 3 goes high within 1 second turn on high beams
If pin 2 goes low and stays low without pin 3 going high within 1 second lights off
And the pins need to be high in the off position since an electronics failure would simply throw all the head lights on

I think this is what you want

const int lowBeamInput = 2;
const int highBeamInput = 3;
const int leftLowBeamRelay = 4;
const int rightLowBeamRelay = 5;
const int leftHighBeamRelay = 6;
const int rightHighBeamRelay = 7;

unsigned long previousMillis = 0;
byte LowBeamHold = 0;

void setup() {
  // put your setup code here, to run once:
  digitalWrite (leftHighBeamRelay, HIGH); //high is off
  digitalWrite (rightHighBeamRelay, HIGH);
  digitalWrite (leftLowBeamRelay, HIGH); //low is on
  digitalWrite (rightLowBeamRelay, HIGH);

  pinMode ( lowBeamInput, INPUT);
  pinMode ( highBeamInput, INPUT);
  pinMode ( leftLowBeamRelay, OUTPUT);
  pinMode ( rightLowBeamRelay, OUTPUT);
  pinMode ( leftHighBeamRelay, OUTPUT);
  pinMode ( rightHighBeamRelay, OUTPUT);

  //Serial.begin(9600);
}

void loop() {
  // put your main code here, to run repeatedly:
  unsigned long currentMillis = millis();
  byte lowBeam = digitalRead(lowBeamInput);
  byte highBeam = digitalRead(highBeamInput);


  //presuming the car will not allow me to choose high beams or low
  //beams unless the lights are turned on


  if (highBeam == 1) {//lights on
    digitalWrite (leftHighBeamRelay, LOW); //low is on
    digitalWrite (rightHighBeamRelay, LOW);
    // Serial.println ("high beams are on");
  } else {//lights off
    digitalWrite (leftHighBeamRelay, HIGH); //high is off
    digitalWrite (rightHighBeamRelay, HIGH);
    // Serial.println ("high beams are off");
  }

  if ((highBeam == 1) || (lowBeam == 1)) {
    digitalWrite (leftLowBeamRelay, LOW); //low is on
    digitalWrite (rightLowBeamRelay, LOW);
    // Serial.println ("low beams are on");
    previousMillis = currentMillis;
    LowBeamHold = 1;
  } else {
    LowBeamHold = 0;
  }
  
  
  // 1/2 second delay between when lights are turned off until low beams turn off
  // this is in case both relays are open at the same time for thousands of a second
  //switching between high and low beam
  if ((currentMillis - previousMillis > 500) && (LowBeamHold == 0)) {
    digitalWrite (leftLowBeamRelay, HIGH); //low is on
    digitalWrite (rightLowBeamRelay, HIGH);
    // Serial.println ("low beams are off");
  }

}