I have a project that will control three 120v devices with three 5v relays, 240 max voltage (TE ORWH-SH-105D1F.) The relays will not fire at the same time, but the random code may make two of them fire at the same time.
I see most projects using a relay module. I've seen this thread which suggests a transistor and diode to absorb the "large reverse voltage spike" when relay is turned off.
How dangerous would it be to just use the raw relay? My (fuzzy) plan is to power the relays with the Arduino 5V/Gnd and control the switch with digital pins, will this blow up an R3 or a Nano?
I have no sketches or schematic yet as I'm just starting to think this part through, so completely open to suggestions.
Edit: Forgot to mention, I "sorta" get that "what" is on the 120v side matters, especially with motors. The relays are a substitute for a standard fog machine switch. Basically when closed, the switch closes the "on" circuit for the fog machine which activates the pump which is inherently a motor. The heater is always on.
The Arduino can't supply enough current to directly-drive a relay coil. A transistor (with it's own power source) can "boost" the current and/or voltage.
There are solid state relays that can be driven directly by the Arduino.
The diode protects the transistor, and everything else.
That will quickly kill your Arduino. Use the standard circuit using a transistor to switch the relay.
So, your plan is build a printed circuit board to hold the relays, so include the switching transistor and other components just like all the other relay modules. And a separate 5 volt supply for the relays. Put that on the PC board as well.
PaulKD7HB and DVDdoug, thank you for the quick replies,
I may have (probably did) mis-spoke, I am basing my idea off this project in the Elegoo Super Starter, there will be an external 5v power supply but originally didn't include this image because I won't be using the L293D. It's not shown, but in this case the Arduino is actually powered by the USB port.
Or do I totally not understand it and the L293D is acting as an amplifier and diode in this case?
As you image shows, the IC is controlling a relay. The IC is a switch. And yes. you could do that to operate a relay. Did you study the data sheet for the IC?
Yes I did, it is designed to only drive two motors AFAIK. Just studied a video on creating a relay module, maybe a mechanical relay isn't the way to go and I should consider a semiconductor switch instead. I'm just so weary of waiting for parts LOL
The data sheet I looked at showed three motors. One that could be reversed.. Did you know there is NO electrical difference between a relay and a motor? So, the IC could certainly operate two relays and perhaps the part of the IC that can reverse could also operate the third relay.
Well, I know they both have a coil hahaha . . . never made the connection. in the Super Starter tute it says "the left side of the chip is for the first motor, the right is for a second motor," I took that as fact - it indeed looks like this chip can handle four outputs, correct? I'm going to try it and hope nothing blows up! (wouldn't be the first time. )
The only question remaining is if this is the "best" way to do what I'm trying to do.
Mind the diodes on each motor/relay. Also be aware the temperature ratings for the relay and the IC ALL assume the device is mounted and soldered to a printed circuit board so the copper traces. solder and even the board material can act as heat sinks.
And wouldn't you know it, I only have two 2n2222A's in my box (to go the module route LOL)
I'm beginning to doubt my relay idea now, reading a lot about arcing in these relays, maybe a mechanical relay isn't the way to go and if I'm going to have to wait for parts, maybe a solid state relay is the ticket.
Sorry to switch gears on you Paul, but I think the below may be a better idea, especially based on a lot of the posts here in the Arduino forum (many of which @Paul_KD7HB participated in! )
Being mechanical, mechanical relays will fail sooner. There is the potential for arcing which can be reduced with a snubber circuit which = more stuff to learn when my head already hurts. SS relays are faster.
-Pictured in the DS is 24V, but below it specifies they come in 5V, 12V, and 24 with the input resistor.
-257F max
does need ventilation
Peak 30A (I won't even get close)
600V
Digikey says they're no longer made (red flag?)
Mouser and eBay as below have them
Will these work?
The reason I'm looking at these is there are people on eBay who have built 1/2/4 channel 5v versions using this exact chip. This would make a lot of problems go away (among which, finishing this project LOL)
Thanks again Paul maybe I just needed to think it through. I've worked on cars and their relays for over 40 years but first time in small electronics.
I don't know what you have been listening to or reading, but mechanical relays can last way beyond your and my lifetimes.
And mechanical relays will not fail before SSR. But all up to you and how you will eventuall begin to test you assumptions.
Haha was going to say almost that exactly. Most of the posts I've read are here on the Arduino forum, SS vs mechanical sounds like a Ford vs. Chevy discussion. I really don't know "what is best." I'm going to try the SS relays, will probably refer to this thread often and come back to mechanical relays for a different project (after I have module components.)
For anyone reading, the solid state relay modules, although cool beyond my dreams, will not work for this project (at least the ones I got.) They work GREAT if you actually have 120 V on the switch side, but as confirmed by @DvDdoug in this thread, they're not just a "switch." In my initial test I tested a 120V light unit, worked great, as expected. Since the fog machine switch is just a switch,
There is (apparently) no actual current between the two switch leads. The Relays cycle along fine, sometimes it will fire on the first signal, but none after. I experimented with bursts from 500ms to a full second. To test I disconnected the relay leads and shorted them out manually, fired every time.
So I guess it's back to mechanical relays but I don't have protective modules, investigating circuit protection as mentioned by Paul above.
You missed the part on AC SSR that they turn on when the internal LED lights, but only turn OFF when the AC current goes to the zero crossing of the sine wave.
Hi, I think I'm understand that you were hoping to use SSRs to switch the 120VAC to a fog machine, like a Hallowe'en fog machine? If that's true, it won't work because switching the AC line will cause the fog machine to cool off. The switch on the fog machine that plugs into the back is to allow the fog to trigger once it's already warm enough.
These things can be tempermental to work with, even the store bought timers that take the place of the stock switch aren't always on time and of the exact duration you dial in. I know, I've tried with all the Spirit Hallowe'en fog machines unless you're using something more professional (I have no experience with those). Dialing in the precise time duration of fog in my Hallowe'en laser with an Arduino and a relay module is, well good enough for my purposes. I can ignore the transistor and diode since it's built in to the module which uses optoisolators and is therefore not electrically connected to the Arduino via the JDD jumper).
How are you making out?
Thanks Paul but not sure what you mean. ? I'm aware I must send HIGH via the trigger port to turn off, LOW when on, though it seems backwards to me it works perfect with a 120 V light on the switch of the relay. They're just not working on the fog machine pump (details below.)
Not the entire machine, just the pump switch via the IEC connector. It has a 120V, neutral, and ground switch and it controls the pump, not the entire machine. The 120V is not used. Once warmed up typical switches short neutral to ground on this connector and it turns on the pump.
Correct, additionally even after a short burst "fire" there is still fluid in the nozzle that shoots a little out, for this application it will be OK - I just need to time it "close enough."
Setting up mechanical relays today with protection circuits, found several resources and think I know what to do (diodes, transistors, etc.) The relays will have their own power source.
Initial test 1 second burst at 10 second intervals. The Arduino and relays have separate wall-wart power sources.
For anyone interested, the 120V black wire in the IEC plug is used to drive an LED to tell you when the machine is warmed up, the circuit inside a stock on/off switch looks like the below. I'll probably incorporate it in my final project. Thanks again for everyone's guidance on this, we're on to putting it all together!