Arduino rebooting when shut down relay + 110V + transistor + diode + desk lamp

Hi.

I'm new using arduino and i'm trying to control a desk lamp with an arduino and a relay.

I'm using a PN2222 transistor to drive relay and a 1N4001 diode because i read at some tutorials that i have to use one to avoid EMF problems. I'm using a 10k resistor plugged into the base of the transistor.

Even with the diode, when i turn off the relay, my arduino reboots.

Here is the representation of my circuit. Consider the LED like being a desk lamp.

Hello,

You should put a capacitor on the 5 volt, near the relay circuit. Try 100uF / 25V

wimb

Hi wimb.

Thank you for he answer.

Can you explain exactly how i must use the capacitor?

I'm really new to electronic and arduino.

First: Do it work with the 110 volt unconnected? If so, try a PMR209MC6100M100R30 across the relaycontacts.

The capacitor (100uF) should be placed between the powerlines near the relaydrivertransistor on the breadboard.

Pelle

Thank you for the answer Pelleplutt.

It works fine without the 110v connected.

So the capacitor must be connected between the transistor and the relay?

Connect the capacitor between plus and minus rail on the breadboard, close to the other components.

Your problem can be sparks and arcs when the relay contacts open and the RC net from Kemet perhaps helps.

Pelle

HI Pelleplutt and thank you for the answer.

I have to plug this way?

Up!

Up!

physyx:
Up!

physyx:
Up!

And Away!

Did you try it that way? How did it go?

Thank you for the answer Runaway Pancake.

I didn't tried that yet because i need to know if in the second image, the capacitor is at the right place.

If the setup works with 110V disconnected, and fails when it's connected, you need to get a mains-rated snubber-network to put acoss the high-voltage terminals of the relay.

There is no idea in placing a cap on the power rails, if the problem is when the relay is turned OFF.

// Per.

Isn't a snubber, in this context, more for stopping relay chatter?

physyx: Thank you for the answer Runaway Pancake. I didn't tried that yet because i need to know if in the second image, the capacitor is at the right place.

Do you have a capacitor near the value Pelleplutt called out? Near that value (uF) and >=20V ?

Place it the way you've shown - and be sure that the positive lead of the cap goes to the positive "rail" (and the negative lead goes to the Gnd "rail".)

[quote author=Runaway Pancake link=topic=245961.msg1762809#msg1762809 date=1402580287] Isn't a snubber, in this context, more for stopping relay chatter? [/quote]

It's to stop the relay contacts being a radio-transmitter when it chatters.

// Per.

[quote author=Runaway Pancake link=topic=245961.msg1762813#msg1762813 date=1402580464]

physyx: Thank you for the answer Runaway Pancake. I didn't tried that yet because i need to know if in the second image, the capacitor is at the right place.

Do you have a capacitor near the value Pelleplutt called out? Near that value (uF) and >=20V ?

Place it the way you've shown - and be sure that the positive lead of the cap goes to the positive "rail" (and the negative lead goes to the Gnd "rail".) [/quote]

I didn't buyed the capacitor yet. I only placed that at the image.

I will try that.

There is some specific and easy to find model of capacitor?

Zapro: [quote author=Runaway Pancake link=topic=245961.msg1762809#msg1762809 date=1402580287] Isn't a snubber, in this context, more for stopping relay chatter?

It's to stop the relay contacts being a radio-transmitter when it chatters.

// Per. [/quote]

So the capacitor is to be used between 110V pins or between arduino 5V power and GND?

The resistor is plugged between pin 8 of arduino and the base of transistor. I have to put another resistor and a capacitor between 110V?

This is starting to go seriously sideways. Someone needs to take over and advise this guy. Stop throwing vague ideas out, be specific, and stay with him.

That's why i posted a drawing. Sigh...

The RC snubber needs to be across the contacts of the relay.

You will never need to connect anything between Arduino and mains wiring, -that stuff is really dangerous.

// Per.

Pelleplutt: First: Do it work with the 110 volt unconnected? If so, try a PMR209MC6100M100R30 across the relaycontacts.

The capacitor (100uF) should be placed between the powerlines near the relaydrivertransistor on the breadboard.

Pelle

In reply #3 I suggested a snubber circuit PMR209MC6100M100R30 across the rely contacts.

The capacitor on your breadbord looks like a small ceramic disk, not as a 100uF electrolytic. And closer to the other components.

Pelle