Triggering 12V 30A Dual Head Lamp Relays using Arduino UNO R3

Hi,
I need to use a 12V 30A Dual headlamp relays. These types are used for switching the beams of a head light in a car. The picture of the relay and the schematic for the same is attached.

I am using a Transistor driver circuit, consisting of BC639 NPN, with a flyback diode across the inductive relay coil. Pins 4 and 8 on the UNO are triggers for the LOW and HIGH beam respectively. The relay is triggered by providing 12V DC across it; the relay coil has a resistance of 76 ohms and so I calculated that a current of 150mA is required to turn on the relay.

I have connected the 12V power supply and arduino GND together, after frying my first arduino and reading through various posts on this forum for similar relay switching problems.

THE PROBLEM: When I set PIN 4 to HIGH the LOW beam is triggered and the bulb lights up in LOW BEAM MODE. Then after a delay of 2 sec, I set PIN 4 to LOW, which triggers the LOW BEAM to switch off, and so the head light turns off. And give a delay of about 2 sec for the back EMF to safely dissipate. Then, when I set PIN 8 to HIGH, I expect the headlight to turn on in HIGH BEAM MODE, but it turns on in LOW BEAM itself.

After rewiring the circuit again, (removed it and put it back together) I found something more puzzling!!!

Now, when I set either of the pins high (alternately, obviously and never together!) BOTH THE HIGH AND LOW BEAM filaments of the Headlight turn on !! SO it does not matter whether i set PIN 4 or PIN 8 to HIGH, its always this "mixed beam" that I get. Why isn't the driver circuit switching off, like it should when i set the respective pin LOW?

So, please correct me if I am wrong, what I think is both the relay driver circuits are on no matter what delay I give.

Any help will be much appreciated. Thank you in advance. :slight_smile:

Please check the schematic that I have uploaded and the code for doing the same is as follows:

#define lowBeam 4
#define highBeam 8

void setup() {
  pinMode(lowBeam, OUTPUT);
  pinMode(highBeam,OUTPUT);     
 
}


void loop() {
  digitalWrite(lowBeam, HIGH);
  delay(2000);        
  digitalWrite(lowBeam, LOW);
  delay(2000);
  digitalWrite(highBeam,HIGH);
  delay(2000);
  digitalWrite(highBeam,LOW);
  delay(2000);
  
  
}

PJILIPS.JPG

Images from Original Post so we don't have to download them. See this Image Guide

069736390af1fee675f1903eb364bf0d4d706cdb.jpg

(Sorry, my knowledge of transistor circuits is not good enough to offer help)

...R

Both transistors are connected in parallel, so setting pin 4 or 8 HIGH, will always activate both relay coils.

Connect T2 (relay coil common) to +12volt.
Connect S1 to one collector, and S2 to the other collector.
Connect the two diodes across the relay coils (with cathodes to +12volt as drawn).

2k2 base resistors (2mA) is not enough to saturate the transistors (they could get hot).
Change them to ~470 ohm.
Leo..

In fact change the 2k2 base resistors to 220 ohms.

Didn't want to go that low, because OP seems to be using a 9volt battery for the Arduino.

I initially calculated 330 ohm, but changed it to 470 ohm.
Not fully saturated (loosing some) is not so bad if you have a working voltage of 12volt.
Leo..

Saturation losses are due to the current, not the supply voltage.

MarkT:
Saturation losses are due to the current, not the supply voltage.

Yes, I know that, but I think you know what I mean.
220ohm or 470ohm is not going to make a significant change in saturation voltage.
0.5volt or 1volt "lost" from 12volt is not that important. It is if you control a 3volt relay.
Important is that the transistor gets enough base current to not heat up significantly from the 150mA collector current.
Leo..

I think OP still has to explain why/how he blew up his (unknown) Arduino.
Powering an Arduino from a 9volt battery is not going to last very long.
Leo..