# Help me to control this relay?

I have some lights for my car that use these relays:

Front:

Back:

I am getting an Arduino Mega ADK in the next few days so I can control my lights with an android app I am writing. But I can't figure out how I can get enough power to trip this relay. I am not to sure what the coil voltage is...it trips on 12V from my car of course, and it also trips with a 9V battery. I have been unsuccessful so far getting it to trip on anything coming from the Arduino though (I have a UNO currently). I am familiar with this diagram:

But I can't seem to quite figure it out...

Any help would be awesome, thanks!

On the photo you see that it is for 14V. The number "-112DM" seems to indicate that it is for 12V. This is a typical relay for in a car. Can you measure the current through the coil at 12V? I doubt that a 2N2222 can handle this heavy relay.

jangoforhire: I am familiar with this diagram: But I can't seem to quite figure it out...

What's the trouble?

[I thought you were getting some relay board for this deal.] http://arduino.cc/forum/index.php/topic,103055.0.html

That simple circuit will work for your application. An Arduino cannot supply the current needed to energize this relay. The transistor can. It acts like a switch to complete the circuit to energize the relay. What switches the transistor off or on is the signal from the Arduino pin.

Relay power + would be power from the positive battery terminal and Relay power GND would be from your battery's negative terminal. This doesn't mean you have to run wires to the battery; it's just to say that the battery is the source of those two connections.

K1 (written horizontally) is the coil of your relay (pins 85 & 86). S1 & 01 of the K1 written vertically are the 'switch' that turn your lights on or off. S1 & 01 are connections 86a & 30 of your relay.

Diode D1 is necessary to prevent damage to the transistor when the relay goes from on to off.

The resistor in the circuit limits the current coming from the Arduino so as to not damage it.

The lower part of the diagram with all the GND connections is showing that the ground of the Arduino must be attached to the ground you are using to power the relay coil.

Basically this circuit is a s follows: The output from the Arduino turns on the transistor, the transistor turns on the relay, the relay turns on your lights. By the way, I believe this relay can be considered a 'small' relay since a similar relay's data sheet indicates it consumes 1.6 watts which would be around 130ma @ 12V which the 2N2222 can handle.. - Scotty

On the photo you see that it is for 14V. The number "-112DM" seems to indicate that it is for 12V. This is a typical relay for in a car. Can you measure the current through the coil at 12V? I doubt that a 2N2222 can handle this heavy relay.

I have tried to measure it using my DMM (set to the "20k" mode and placing the red probe on pin 86 of the relay, and the black probe on pin 85 of the relay). I get a reading of 0.08 which doesn't make sense to me. I thought it needed to be much higher than that?

What's the trouble?

[I thought you were getting some relay board for this deal.] http://arduino.cc/forum/index.php/topic,103055.0.html

That was my original plan (thanks for the help with that by the way) but when I got the lights I want to control, they already came with these relays equipped. So I figured why not just use the exiting ones instead of buying a new board.

That simple circuit will work for your application. An Arduino cannot supply the current needed to energize this relay. The transistor can. It acts like a switch to complete the circuit to energize the relay. What switches the transistor off or on is the signal from the Arduino pin.

Relay power + would be power from the positive battery terminal and Relay power GND would be from your battery's negative terminal. This doesn't mean you have to run wires to the battery; it's just to say that the battery is the source of those two connections.

K1 (written horizontally) is the coil of your relay (pins 85 & 86). S1 & 01 of the K1 written vertically are the 'switch' that turn your lights on or off. S1 & 01 are connections 86a & 30 of your relay.

Diode D1 is necessary to prevent damage to the transistor when the relay goes from on to off.

The resistor in the circuit limits the current coming from the Arduino so as to not damage it.

The lower part of the diagram with all the GND connections is showing that the ground of the Arduino must be attached to the ground you are using to power the relay coil.

Basically this circuit is a s follows: The output from the Arduino turns on the transistor, the transistor turns on the relay, the relay turns on your lights. By the way, I believe this relay can be considered a 'small' relay since a similar relay's data sheet indicates it consumes 1.6 watts which would be around 130ma @ 12V which the 2N2222 can handle.. - Scotty

Thanks for the explanation, I tried this was a 2N2222 earlier and I couldn't get it to work right. I tested the voltage coming off the transistor in my circuit and got around 5.5-6 volts. I am guessing I need a bit more than this so I am going to see if I can find a TIP102 transistor today and swap them out in my circuit.

Thanks for the help!

We need to see your circuit. - Scotty

scottyjr: We need to see your circuit. - Scotty

I am using this exact circuit.

Except the red wire going to the motor (in the picture) is connected to pin 86 on my relay and the black wire going to the motor (in the picture) is connected to pin 85. It is working with the TIP120 transistor that I got today. But it seems...weak. The "click" of the relay engaging is much quitter then when I use the 9V battery directly. I tested the output with my DMM and got 8.65 Volts. Seems to be right as I am using a 9V battery. So why does the click seem weaker?

Also here is the code:

``````int TIP120pin = 11;
void setup()

{
pinMode(TIP120pin, OUTPUT); //
analogWrite(TIP120pin, 255); //
}

void loop()
{
analogWrite(TIP120pin, 0);
delay(2000);
analogWrite(TIP120pin, 255);
delay(2000);
}
``````

Possible problem. The circuit online lists a 1k resistor. I only had 10k ? +/- 5% and 330 ? +/- 5%. I used the 10k. will this cause my circuit to be weaker?

10K for the base resistor? If so, then use that 330? instead.

[quote author=Runaway Pancake link=topic=104760.msg786873#msg786873 date=1336439520] 10K for the base resistor? If so, then use that 330? instead. [/quote]

Alright that works a little better, I will still swap it out with a 1K resistor when I can find one.

Final question, when I install this in m car, can I swap out the 9v battery with a connection to my car battery? (12v)

jangoforhire: Final question, when I install this in m car, can I swap out the 9v battery with a connection to my car battery? (12v)

Yes.

jangoforhire: [quote author=Runaway Pancake link=topic=104760.msg786873#msg786873 date=1336439520] 10K for the base resistor? If so, then use that 330? instead.

Alright that works a little better, I will still swap it out with a 1K resistor when I can find one.

Final question, when I install this in m car, can I swap out the 9v battery with a connection to my car battery? (12v) [/quote]

Just so you are aware for the future (may help you to find information on them), these relays are known as "Bosch" relays (they were the original manufacturer of them); it is a fairly standard automotive-type relay and pin layout; yours is an SPST relay, some are SPDT (there is an extra terminal on the bottom). There are also standard plugs and harnesses for these relays; in an automotive installation, you should try to use such connections as it makes it much easier later should you have to replace it (versus soldering).