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.
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.
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.
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
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
I'm fairly n00b too so verify anything i say before you try it.
redlazer:
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. 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.
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!
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. And, use heat-shrink tubing (or something) to make sure you cannot touch the AC circuit while it's on.
be80be:
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.
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.
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.
redlazer:
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.
redlazer:
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. Lefty
Thanks again everyone!
So, say I get the G3MB-202PL. How do I move forward from there?
then you would need a AC zero crossing timing reference input pulse for the arduino to read
[quote author=Runaway Pancake link=topic=132107.msg993822#msg993822 date=1352761923]
That's a "zero-cross" type, it's on page one of the datasheet.
A G3MB-202PL would be a random triggering type.
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?
To switch voltage on or off, yes it will work. To dim, no it won't work. A G3MB-202PL would allow you to switch on the SSR any time in it's positive or negative cycle and turn off the SSR during any zero crossing. However even with a PL device your arduino doesn't know where in the AC cycles the voltage is at any given time without some form on timing signal created from the AC voltage and inputted to the arduino. Quite complex, not impossible but you don't have the correct SSR anyway and if you are going to get something else anyway, get a AC dimming control device that can interface with an arduino, I'n sure such devices are available. Lefty