Pages: [1] 2 3   Go Down
Author Topic: Using Solid State Relays with PWM on an Incandescent Bulb - Wiring Help Needed  (Read 5088 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 21
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey guys,
So I've made it to the point where actual things can start happening. I went to the electronics store and they helped me pick out two things:
a few 2n7000 Transistors
An Omron G3MB-202P Solid State Relay:
http://ca.mouser.com/ProductDetail/Omron/G3MB-202P-DC5/?qs=%2fha2pyFadujX1dKDtNe8XUFceDbAKi%2f2MwjxYJj2tOxcbPlBiEITVw%3d%3d

I'm ready to start playing with the SSR, but let's face it: AC power is scary for someone like me who is just learning all this stuff.

I could do with some safety tips moving forward - I can't seem to find an especially good guide which includes how to wire everything up.

The Omron has 4 leads on it - two for the Arduino (DC), and two for AC power, which will be for my Incandescent light.

It's a tiny little thing, which is a large part of my concern - how could this thing possibly be rated for 240V at 2A!

Well, it is, so I already grabbed a wall plug and wired it up. The problem now is, I don't really know how to connect my light to the wall plug. Where do I hook up the Omron? Inline with the AC power? Which wire?

I have more questions, but seeing as these pressing ones could save my life, I'll save them for later.

Thanks for your help guys!
Logged

Offline Offline
Full Member
***
Karma: 3
Posts: 244
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Are you trying to dim a light bulb with a relay, If so that's a bad idea you burn the bulb out it no time.
Now if you just want to switch it on then it's ok to use as switch.

But you said pwm so I'm thinking dimer.

« Last Edit: November 12, 2012, 04:27:09 pm by be80be » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 21
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm going to be using PWM on a transistor, which will switch the Solid State Relay. It is my understanding that, because it will switching so fast, it will not notably affect the performance of the bulb.

Ultimately, my main concern right now is wiring it up correctly. If I need to, I will switch to LED's and use all-DC later if I have to - but I want to use full-spectrum bulbs, which I happen to have laying around.

Any tips on how to wire up the Omron to the AC power safely are very much appreciated.
Logged

Offline Offline
Full Member
***
Karma: 3
Posts: 244
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

For starters you don't need and transistor to make this work the max input is 20mA
which is easily handled by the Arduino digital pin to the relay you have has zero crossing built in
and is not made to do phase shifting. It's meant to be used as a switch.

If you want to try this with a bulb you'll need to make a PCB to hold the relay and some kind of case
to keep it in with the I/O line on one side and a plug on the opposite side    

If you want I'll draw you something up.
 smiley-grin smiley-grin
« Last Edit: November 12, 2012, 05:02:00 pm by be80be » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 46
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Agreed. Your relay only needs 5v to be tripped which can be supplied by Arduino. I did something similar with LH1156 Solid state relays, but im only using 12VDC from a car. Some people told me it would not handle PWM like a transistor, but to my surprise, it handles it like a boss smiley

I'm fairly n00b too so verify anything i say before you try it.
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17263
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm going to be using PWM on a transistor, which will switch the Solid State Relay. It is my understanding that, because it will switching so fast, it will not notably affect the performance of the bulb.

That won't work, PWM runs at too fast of a switching frequency and results will be random and incorrect. Most all common SSRs use AC zero crossing switch timing so can't be turned on or off quicker then 8.3 milliseconds (half of 60Hz). You control them with simple digitalWrite() commands to turn on or off at some timing slower then a AC cycle time. They are not suitable for light dimming applications, special SSRs with proportional control are required for dimming service. Second you don't need a transistor to drive a SSR input, the 5vdc output straight from a arduino digital output pin will drive the optical led input circuit that SSR use just fine, the SSR has an internal current limiting resistor to maintain safe current flow. And lastly the SSR is wired in series with the AC voltage circuit, typically the hot (black in USA) wires to one of the SSR output terminals (either one) and the other output terminal wires to the load device and the other end of the load device wires to the AC neutral wire (white in the US). Mixing black and white won't hurt but does go against convention. And lastly the safe answer to AC power wiring questions is 'if you have to ask you probably shouldn't be messing with it', but I will leave you to your own devices and self educations pursuits.  smiley-grin

Lefty

Ultimately, my main concern right now is wiring it up correctly. If I need to, I will switch to LED's and use all-DC later if I have to - but I want to use full-spectrum bulbs, which I happen to have laying around.

Any tips on how to wire up the Omron to the AC power safely are very much appreciated.
« Last Edit: November 12, 2012, 05:16:32 pm by retrolefty » Logged

Offline Offline
Edison Member
*
Karma: 33
Posts: 1290
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

PWM will NOT work with most AC-output solid-state relays.   AC solid-state relays usually use a TRIAC.   Once a TRIAC (or SCR) switches-on, it ONLY switches off when current stops flowing (i.e. at the AC zero-crossing).  A DC solid-state relay might work with PWM if it can switch fast enough.   (DC solid-state relays can't use SCRs or TRIACs because they could not shut off.)   

AC dimming is usually done by triggering a TRIAC at a constant point in the AC signal's phase.    Then, it stays-on 'till the next zero crossing.  For example, if you trigger it at the peaks (90 degrees and 270 degrees), the light will be on half of the time and will be dimmed (which, I think, doesn't quite appear as "half brightness").  That means you need a way to detect the zero-crossing (or some other constant point/voltage in the cycle.   Of course the phase-dection needs to be isolated form the line voltage.  If your project has a transformer (i.e a "linear" non-switching power supply) you can get the phase from the secondary of the transformer.   Or you can use optical isolation, but be aware that the current-limiting resistors for your opto-isolator need to be bigger & higher power than your standard 1/8W or 1/4 watt resistors (maybe around 1 watt).    Some AC solid-state relays can be used for dimming, and others cannot because they switch on at the zero-crossing point to prevent noise on the AC line.    I'd leave dimming for later... Maybe never if you are switching to LEDs!

Quote
Any tips on how to wire up the Omron to the AC power safely are very much appreciated.
Make sure the AC voltage is connected to the AC terminals of the relay. smiley-wink  And, use heat-shrink tubing (or something) to make sure you cannot touch the AC circuit while it's on.
Logged

Offline Offline
Full Member
***
Karma: 3
Posts: 244
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Here you go have fun and always keep one hand in your pocket when using line voltage.

Oh and one more thing don't use pwm just set pin2 high to turn on and low to turn off



 


* relaySolidstate.PNG (21.18 KB, 925x478 - viewed 272 times.)
« Last Edit: November 12, 2012, 05:56:35 pm by be80be » Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17263
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Here you go have fun and always keep one hand in your pocket when using line voltage.

Oh and one more thing don't use pwm just set pin2 high to turn on and low to turn off



 

Why the 510 ohm resistor between the output pin and the SSR input? SSRs have internal current limiting resistor and adding 510 ohms may indeed prevent enough current to flow to turn on the SSR reliably.

Lefty
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 21
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Wow, thanks for the replies guys! Especially the wiring diagram - that will be very helpful!

I was recommended this part by an electrician at the shop - he's familiar with arduino and I explained what I was trying to do - dim an AC light - and he said I can do it using PWM with this part.

Thanks for the tip with not needing the transistor - maybe he gave me those just so I could practice.

Are we sure PWM won't work in this scenario? There seems to be some mixed information. Will it hurt if I try it, and then upgrade to some other part so I can use PWM?

Remember, I want to dim this light, not just switch it - but it's my understanding that the SSR will let me switch it rapidly with PWM, hence dimming it. Is this not true? Why not?

I'm learning, so explanations are very much appreciated.

Thanks again everyone!
Logged

Offline Offline
Edison Member
*
Karma: 64
Posts: 2466
Now, More Than Ever
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

G3MB-202P - That's a "zero-cross" type, it's on page one of the datasheet.
A G3MB-202PL is a random triggering type.

http://www.components.omron.com/components/web/pdflib.nsf/0/F1D420C93E86CDB685257201007DD5BA/$file/G3MB_0609.pdf

You can try PWM'ing your device, it won't hurt anything.  
It'll be a good lesson for you.

From the datasheet, "page 386":
To use the SSR output for phase control, select a model that does
not incorporate a zero-cross function.

<> Still, PWM won't be acceptable, the SSR has to be triggered in sync with the line frequency.
« Last Edit: November 12, 2012, 06:17:52 pm by Runaway Pancake » Logged

"Hello, I must be going..."
"You gotta fight -- for your right -- to party!"
Don't react - Read.
"Who is like unto the beast? who is able to make war with him?"

Offline Offline
Full Member
***
Karma: 3
Posts: 244
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

retrolefty  your right the relay he said he has does have resistor built in so one is not needed
so here a update  

But it would still work I'm 1mA above the Min. Just to be safe if he didn't have a built in resistor


* relaySolidstate.PNG (22.23 KB, 925x478 - viewed 101 times.)
« Last Edit: November 12, 2012, 06:21:05 pm by be80be » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 21
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

That's a "zero-cross" type, it's on page one of the datasheet.
A G3MB-202PL would be a random triggering type.

http://www.components.omron.com/components/web/pdflib.nsf/0/F1D420C93E86CDB685257201007DD5BA/$file/G3MB_0609.pdf

You can try PWM'ing your device, it won't hurt anything.  
It'll be a good lesson for you.

Ok then. Just to make sure I've got this straight:

I have the G3MB-202P - It's a Zero-Cross type, which refers to the point at which the AC current switches from positive to negative. Isn't this what I need in order to be able to switch/dim an AC source correctly?

Ah yes, I see that in the instructions. So I need to get one that DOESN'T use zero-cross then.

But now I'm even MORE confused. I thought the zero-cross was a reference point for dimming the light correctly!

I'll go back to the store later in the week and get one without zero-crossing - but an explanation of what is going on would be super handy.

Thanks again!
« Last Edit: November 12, 2012, 06:23:29 pm by redlazer » Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17263
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Wow, thanks for the replies guys! Especially the wiring diagram - that will be very helpful!

I was recommended this part by an electrician at the shop - he's familiar with arduino and I explained what I was trying to do - dim an AC light - and he said I can do it using PWM with this part.

He is simply wrong. From the Omron G3MB-202P Solid State Relay datasheet:
Operate time 1/2 of load power source cycle + 1 ms max.
Release time 1/2 of load power source cycle + 1 ms max.
That means unsuitable for driving from an arduino PWM output command.



Thanks for the tip with not needing the transistor - maybe he gave me those just so I could practice.

Are we sure PWM won't work in this scenario? There seems to be some mixed information. Will it hurt if I try it, and then upgrade to some other part so I can use PWM?

Won't work.

Remember, I want to dim this light, not just switch it - but it's my understanding that the SSR will let me switch it rapidly with PWM, hence dimming it. Is this not true? Why not?

Arduino PWM is too rapid around 500hz or 1khz, both unsuitable for interfacing with a standard SSR. You would need a SSR that has random turn on and zero crossing turn off ( like a G3MB-202PL, note the L) and then you would need a AC zero crossing timing reference input pulse for the arduino to read so you could calculate where in the AC cycle you want to turn of the SSR for the desired 'dimming' value you desire. It's simply the wrong device, you would need to get a purpose designed AC lamp dimming controller and then figure out how to interface it best with an arduino.

I'm learning, so explanations are very much appreciated.

I'm trying my best.  smiley-wink

Lefty


Thanks again everyone!
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 21
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Wow, thanks for the replies guys! Especially the wiring diagram - that will be very helpful!

I was recommended this part by an electrician at the shop - he's familiar with arduino and I explained what I was trying to do - dim an AC light - and he said I can do it using PWM with this part.

He is simply wrong. From the Omron G3MB-202P Solid State Relay datasheet:
Operate time 1/2 of load power source cycle + 1 ms max.
Release time 1/2 of load power source cycle + 1 ms max.
That means unsuitable for driving from an arduino PWM output command.



Thanks for the tip with not needing the transistor - maybe he gave me those just so I could practice.

Are we sure PWM won't work in this scenario? There seems to be some mixed information. Will it hurt if I try it, and then upgrade to some other part so I can use PWM?

Won't work.

Remember, I want to dim this light, not just switch it - but it's my understanding that the SSR will let me switch it rapidly with PWM, hence dimming it. Is this not true? Why not?

Arduino PWM is too rapid around 500hz or 1khz, both unsuitable for interfacing with a standard SSR. You would need a SSR that has random turn on and zero crossing turn off ( like a G3MB-202PL, note the L) and then you would need a AC zero crossing timing reference input pulse for the arduino to read so you could calculate where in the AC cycle you want to turn of the SSR for the desired 'dimming' value you desire. It's simply the wrong device, you would need to get a purpose designed AC lamp dimming controller and then figure out how to interface it best with an arduino.

I'm learning, so explanations are very much appreciated.

I'm trying my best.  smiley-wink

Lefty


Thanks again everyone!

So, say I get the G3MB-202PL. How do I move forward from there?

Quote
then you would need a AC zero crossing timing reference input pulse for the arduino to read

How do I do that?

Aww man, I'm sadfaced about this now : (

Thanks again for the assistance though guys!
Logged

Pages: [1] 2 3   Go Up
Jump to: