Shop OBEX P1 Docs P2 Docs Learn Events
Has anyone used any relays from SainSmart? — Parallax Forums

Has anyone used any relays from SainSmart?

vanmunchvanmunch Posts: 568
edited 2012-06-06 07:06 in General Discussion
I just found these relays on Amizon and I was wondering if anyone has had experiance using them? They're meant for 5V, but I'm hoping to use them with a Propeller.

http://www.sainsmart.com/module/acceleromete/4-channel-5v-relay-module-for-pic-arm-avr-dsp-arduino-msp430-ttl-logic.html
«1

Comments

  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-05-06 02:34
    Many people want and love these relays that are soldered to a circuit board and have some sort of direct digital interface, but there are several limitations that occur.

    1. Circuit boards cannot handle as many amps as 10 gauge copper wire with 220VAC insulation. Putting a 10 amp rated relay on a copper circuit board usually means that the traces are only able to use 2 or 3 amps.
    2. Failure replacement requires soldering.
    3. Often relays rated at 5VDC coils are not able to give adequate pull for large loads.
    4. Often the 5VDC power supply runs the relays through transistors that drop the voltage further - about 4.3VDC is the real voltage at the coil.

    So what do I do. I drive either a 2N2222 that will provide 12VDC to relays that are socketed and mounted on a rail. From there I can handle substantially more power and I can easily service any eventual relay failures.

    Of course there is a trade off. You pay $7.99USD per board of 4 relays while I pay more than that for one relay and socket set.

    Of course there is an additional item with the Propeller. You would have to provide a jump to +5VDC and 20ma output from 3.3VDC. Use a 74LS04, 74HCT04 or some other logic chip (these invert the signal so your code has to be adapted to inverted outputs) to boost for +5VDC drive.

    A 2n2222 controlled with 3.3 volts and powered with 12VDC does just fine with my alternative scheme. For really big relays, a TIP120 or a MOSfet might drive greater output. It is wise to use something to buffer rather than drive relays direct as they are very current demanding and have flyback voltages that need to be handled by a flyback diode.
  • LeonLeon Posts: 7,620
    edited 2012-05-06 02:42
    With my home-made boards I solder thick copper wire on tracks that need a lot of current.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-05-06 02:53
    @Leon
    That is an EXCELLENT IDEA. These rather inexpensive boards can be enhanced with a bit of 12 or 14 gauge copper wire from the relay to the connection posts.

    Nonetheless, I would NOT try to get all 10amps out of any 10amp relay and expect an indefinite useful life. They would be far more suitable for 5amp service.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-05-06 08:41
    I've used a relays for controlling oven temperature for a couple of years. I use a PWM of sorts with a freqency of 0.1Hz. Since these oven are on (at a relatively low temperature) eight hours at a time, the relays get a lot of use.

    I've had several relays die on me being used this way. One of the relays froze in the closed position making the oven much to hot for its intended use (drying ore samples) which ruined the experiment in progress.

    I've since switch to solid state relays. Some SSRs can be driven directly from a Prop pin. They don't have the same voltage spikes as electromechanical relays and they don't have contacts to wear out. The downside is they cost more and can only switch one type of load AC or DC(depending on which SSR is used), not both.

    If the relay is to be used a lot, you might want to consider SSR. If your load just needs to be switched on and off occasionally then normal relays are fine. You ought to keep in mind what will happen if the relay gets stuck either on or off.
  • vanmunchvanmunch Posts: 568
    edited 2012-05-06 14:37
    Thanks everyone for their insight!

    Loopy Byteloose or Leon, do you have a schematic (or link to one) of what would be a "good" non SSR set-up? From what I've read there's a lot of details/ special considerations?
    Duane Degn wrote: »
    I've used a relays for controlling oven temperature for a couple of years. I use a PWM of sorts with a freqency of 0.1Hz. Since these oven are on (at a relatively low temperature) eight hours at a time, the relays get a lot of use.

    I've had several relays die on me being used this way. One of the relays froze in the closed position making the oven much to hot for its intended use (drying ore samples) which ruined the experiment in progress.

    I've since switch to solid state relays. Some SSRs can be driven directly from a Prop pin. They don't have the same voltage spikes as electromechanical relays and they don't have contacts to wear out. The downside is they cost more and can only switch one type of load AC or DC(depending on which SSR is used), not both.

    If the relay is to be used a lot, you might want to consider SSR. If your load just needs to be switched on and off occasionally then normal relays are fine. You ought to keep in mind what will happen if the relay gets stuck either on or off.

    I'm hoping to do two things:

    1) Connect the main battery power after the prop has started. The main drive motors are from a power chair that came with a 50 amp rated joystick so I've been looking for a 50-60amp relay for this part of the project.

    2) The second part of the project is where I'm controlling a small pump (~2gpm) that refills a small water tank.

    I'm think that the SSR will be perfect for the pump side of the project and I was wondering if you need any other components along with the SSR you suggested or if you can connect it directly to the controller.

    Out of curiosity, I've also been wondering if you could use two 25 or 40amp SSR in parallel (stacked) for the main battery/ motor power, or if that's a bad, bad idea?

    Thanks for all of your help,

    Dave
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-05-06 15:18
    I couldn't figure out a good relay schematic symbol with the Prop Tool's font so the relay looks like a push button.

    This is the circuit I use with relays.
                                               5.0V
                                         ─┴─    
                      Load to switch  ──┘ └────┼───── Load to switch
                                       ┌──────┫     
                                       ┣──────┘     
                                       │                     
                   Prop Pin ─────── 2N3904  
                                 100Ω  │
                               to 1KΩ  │
                                       
                                      Vss
    

    I thought a 1K resistor would work on the base of the transistor but last time I tried it (a few days ago) it didn't work until I used a lower resistor value.

    Depending on the resistance of the relay's coil, you may need another resistor to limit the current through the coil. Hopefully someone else can comment on this.

    Edit: I just checked the resitance of the coil of a relay I had handy. It measured 130 ohms. I don't think you'd want to add a resistor to this particular relay. As I think about this, I don't think current limiting resistors are often used when driving relay coils.

    The SSR I use has the same sort of connection since I just swapped it for the electromechanical version. I didn't know a Prop could drive a SSR directly until I saw Beau do it. It would be a good idea to measure the current from the Prop to the SSR if you're driving it directly to make sure it doesn't pull too much current from the Prop (I doubt it does). I don't know if there are other issues to worry about when driving a SSR relay with a Prop.
  • charlesmarkcharlesmark Posts: 1
    edited 2012-05-07 03:41
    They have a website, you may find some help there. www.sainsmart.com
  • vanmunchvanmunch Posts: 568
    edited 2012-05-07 12:12
    Thanks Duane! This will is very helpful.

    Thanks charlesmark, welcome to the forums! I had found their website while deciding if I wanted to try the board and was significantly impressed by their website to wager the $ and try their board. I'm also planning to try the new relay kit the Parallax is coming out with.
  • ercoerco Posts: 20,259
    edited 2012-05-07 13:10
    @vanmunch: That looks like a great value on relays, David! Four SPDT relays, optocouplers, LEDs & driver transistors. Per Loopy, I wouldn't bet much that it will work properly at 3.3V, but should work fine for us 5V folks. I actually tried to order one, but the Paypal transaction was hinky. After Paypal logon, it kept asking for more bank account info. Could be the computer I'm using at the in-laws. First-gen XP machine, IE6, no updates in ages, using a slow dialup connection. I'll try again later on my netbook at the hotel. Some of those international sellers are phishing scams, trolling for your info.

    But if it's legit, at $8 it's worth a shot for relay lovers like me. Does Sainsmart sell plywood too? :)
  • vanmunchvanmunch Posts: 568
    edited 2012-05-07 20:57
    Hey erco,

    I was hoping that you would chime in. :) I purchased the 4x 10 amp board from a reseller on Amazon (free 2 day shipping). It arrived tonight and it looks good. I haven't had time to play with it, but the relays are through hole with wide (~5mm) traces. It looks like you would be able to connect wires to the pins like Leon suggested.

    Anyhow, hopfully I'll have time later this week and I'll let everyone know how it goes.

    BTW My current robot sports a double deck of plywood... All of the electronics are stuffed in the middle like a cookie :)
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-05-08 08:22
    Sorry it took so long to get back to you. My computer and network have been down due to a bit of tweaking with my router/gateway. And then, I updated to Ubuntu 12.04 and the bootloader went south.

    50 to 60 AMPS!

    First off, you are not going to get anything that fits on a circuit board for that and a lot of solutions could be very costly.

    There is ONE cheaper solution - Automotive relays. These for trucks and heavier vehicles come rated that high and maybe higher at a lower costs. They don't tend to be socketed, but come with tabs. They also tend to be very weather proof. In some cases, sockets with wire pig-tails are available. But if you really are providing 60 amps, you need some seriously heavy wire - like battery cables.

    Fortunately, you can buy such wire at any welding supply as they use heavy amp cables for arc welding.

    http://www.wiringproducts.com/contents/en-us/p66.html

    http://www.google.com/products/catalog?q=80+amp+automotive+relay&hl=en&client=ubuntu&hs=MiS&channel=fs&prmd=imvns&bav=on.2,or.r_gc.r_pw.r_qf.,cf.osb&biw=959&bih=625&um=1&ie=UTF-8&tbm=shop&cid=6018996652701066161&sa=X&ei=xDmpT46pEqvqmAWZmMjhBA&ved=0CF0Q8wIwAA

    The schematic that Duane provided is quite good, but the 2n3904 transistor may not be adequate to drive these relays as the coils may want 12VDC at hundreds of milliamps or higher. The 2n2222 transistor is a better fit AND a TIP120 darlington is even better.

    Fittings need to be sweat soldered on the cable ends. It isn't that hard if you have every done soldering of copper plumbing with a propane torch. Just be sure to tin the bare wire ends with lots of solder before you try to fit the connector on to them.

    I suspect that SSRs will just as easily fail in an ON mode and they certainly are more failure sensitive to inductive loads.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-05-08 21:11
    A couple of added thoughts.
    A 1K resistor between the microcontroller and the 'transistor' is more appropriate for a MOSfet, but MOSfets can be somewhat of a challenge to turn fully on at 3.3VDC. So it is better to use 100ohm and a BJT or Darlington to drive a relay if you are not very sure of your engineering.

    The ratings for transistors are something like this.

    2n3906 will handle about 60ma max.
    2n2222 will handle about 500ma max.
    TIP120 will handle about 3amps max.

    So big relays have big coils that demand more amps at similar voltage.

    And regarding wire....
    You can use multiple strands of 12 gauge in parallel to get a higher rating, like 50 amps. These days, you see this commonly done in switching power supplies for a variety of reasons. It does have advantages in terms of flexibility when you want cable to go through tight spaces.
  • ercoerco Posts: 20,259
    edited 2012-05-09 17:46
    I never could get a transaction thru Sainsmart, but I bought one of these (looks identical) off Ebay for $6.79, free shipping.

    Click away, mighty relays! http://www.ebay.com/itm/320899701112
  • ercoerco Posts: 20,259
    edited 2012-05-09 18:09
    More interesting relays, ten SPST reed relays for $11 shipped, from a US seller. Guaranteed operation at 3.75V, will probably work at Prop 3.3V. 500 ohm coil, just 10 mA at 5V! Me like, me get too.

    http://www.ebay.com/itm/Lot-10-HASCO-713-5-High-Voltage-Reed-Relays-SIP-5V-Coil-2-5A-max-/260991831092?_trksid=p4012.m1374&_trkparms=algo%3DUPI.GIROS%26its%3DI%252BC%252BS%26itu%3DUCI%252BUCC%26otn%3D8%26pmod%3D320899701112%26ps%3D63%26clkid%3D8305890566347398948
  • vanmunchvanmunch Posts: 568
    edited 2012-05-09 20:44
    Thanks guys,

    @erco, you'll have to let us know how they work out. I'd like to know how you set them up too. I'm not going to have any time during the next couple of weeks to work on any robotics stuff, but I'll let you'll know how it goes.

    @loopy
    I don't know if the motors really need 50 amps or not, that was just what the power chair’s joystick is advertised at. I think they're just talking about surges up to 50 amps for a couple of seconds. The battery wires that the manufacture used were only 8awg so that says something and the motor wires are 10awg. I have some 6awg wire and it's jsut a beast compared to the 8 and 10 that they used. I've left there orginal wire, maybe I'll just go with a 40 amp relay? ( http://www.amazon.com/40A-SSR-Solid-State-Relay/dp/B004HZLMTW/ref=pd_sim_sbs_auto_2 ) However, I don't like the idea of a SSR failing in the open position... So many decisions, I love this stuff :)

    @Duane Degn Do you have to worry about SSR failing? Have you ever had one fail?
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-05-10 03:28
    The existing wire size is probably you best indicator of true power demand in amps. So you don't have to increase wire size.

    At first, I was all for SSRs, but at 40-50amps they need rather large heat sinks and may actually be a much larger footprint than a mechanical relay of similar rating. And one must be careful to get the output side in DC when one needs DC as it is not always clear (I cannot read the label of the device you show). The "SSR-40DA" appears to be only an AC rated relay when I search for detailed specification.

    Failing to an ON position is likely to best be dealt with by having several items. First is fuses, maybe Slo-fuses on the motors. Second, a watchdog setup on the overall power and running of the motors. Both mechanical and solid-state relays seem capable of failing to an ON state.

    So if the joystick is rated at 50 amps, I suspect you do need 50 amp relays if you are going to have a durable set up. These types of switches - joysticks and relays - are often 'de-rated' for intense use as the amperage rating for the switches is merely a guide to the maximum at normal operation, not frequent operation. One can have capacitors or diodes protect the points in various wiring schemes. DC wear is more severe than AC wear because metal from the points only migrates in one direction with wear due to the constant direction of plus and minus poles (so you often see a relay rated for 30VDC and 220VAC).

    Reed relays? There is an attraction to use very tiny relays - but will they last long enough in a real application? I dunno, but I tend to shy away from the tiny ones. Previously I bought quite a few and I still have them in case I need such, but generally I use a relay to kick up the power, both the volts and amps. And then, I want something that is durable -- not smoke-able.
  • ercoerco Posts: 20,259
    edited 2012-05-10 07:43
    @Loopy: You're right, I certainly wouldn't advocate using reed relays to drive wheelchair motors! I just added that link to this relay discussion instead of starting a new thread. Reed relays are reliable, simple to use, and perfectly fine for an amp in light duty applications. Bulletproof, no polarity to worry about, no voltage drop. I'll use the heck out of 'em for a buck!
  • ercoerco Posts: 20,259
    edited 2012-05-10 08:29
    Plus, my favorite latching relays are on sale now for 79 cents, a new low. Even Loopy liked these previously! :) I tested these, 100% work at 3.3V. DIP, DPDT: http://www.goldmine-elec-products.com/prodinfo.asp?number=G2011
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-05-10 09:04
    Those little latching relays are very special and have some unique appeal. One of the best applications for them is to have a one button on/off toggle pulse for a microcontroller. Of course, you might be able to find a switch that would do that without having to insert the latching relay, but where is the fun in that.

    I like the idea that they remember position in a power failure situation. That is great on a boat, when temporary power outages are a very common occurance due to dockside boats bouncing around and long runs of flexible wire being exposed to weather and water. Batteries are there for backups, but they to tend to fail.
  • ercoerco Posts: 20,259
    edited 2012-05-23 20:12
    Just got my 4-relay board today. Works great, best $6.79 I've spent lately!
    ' {$STAMP BS2e}
    ' {$PBASIC 2.5}
    PAUSE 255
    
    DIRL=15
    a:FOR B0=0 TO 15
    OUTL=B0
    PAUSE 100
    NEXT
    PAUSE 250
    FOR B0=15 TO 0
    OUTL=B0
    PAUSE 50
    NEXT
    PAUSE 250
    GOTO a
    
  • ercoerco Posts: 20,259
    edited 2012-05-24 09:09
    Now the BIN price has jumped to $7.99. I bought two for $6.79 and ruined it for everybody! :)

    http://www.ebay.com/itm/5V-4-Channel-Relay-Module-for-Arduino-8051-ARM-PIC-AVR-DSP-Electronic-/221024893822?pt=LH_DefaultDomain_0&hash=item33761c3b7e

    Edit: But then I found this slightly smaller one for $5.99. Looks to function the same, I ordered one.

    http://www.ebay.com/itm/180866396859?ssPageName=STRK:MEWAX:IT&_trksid=p3984.m1438.l2649
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-05-24 10:27
    vanmunch wrote: »
    @Duane Degn Do you have to worry about SSR failing? Have you ever had one fail?

    The only SSR I've used over a long period of time is the one in our kitchen oven. It hasn't failed yet and I've been using it about two years.

    Loopy is right about the SSR being larger than its electromechanical cousin. I haven't noticed much of a heat issue with it though. Although I don't touch the relay while it's in use if I can avoid it so I don't really know how warm it gets.

    In my limited data set, the SSR seem to last longer than the traditional relays. As I mentioned previously, I've had two normal relays fail after extended use.

    After seeing erco's relay board, it's hard to strongly advocate for SSRs since they don't make the lovely clicks normal relays make.

    While I like the clicking, my wife doesn't. So guess which kind of relay goes into the kitchen oven?
  • ercoerco Posts: 20,259
    edited 2012-05-24 10:30
    Duane Degn wrote: »
    After seeing erco's relay board, it's hard to strongly advocate for SSRs since they don't make the lovely clicks normal relays make.

    http://www.youtube.com/watch?v=7xZP7p7Zpe4
  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-05-24 10:41
    @erco,

    Yes, I'm pretty sure I've seen that video before.

    I regret I never made a video of my relay powered text message dialer. It was a lot of fun to hear the clicking as the relays made the needed connections to send a text message. It was a very impractical way to use a cell phone with a microcontroller, but I think I may need to wire it up again so I can record it in action.
  • Peter KG6LSEPeter KG6LSE Posts: 1,383
    edited 2012-05-24 11:01
    Leon wrote: »
    With my home-made boards I solder thick copper wire on tracks that need a lot of current.

    same I use solder braid or some sold house wire ... I took apart a Old inverter when I was 10 and this is how they beefed up there traces ..

    works wonders ..
  • ercoerco Posts: 20,259
    edited 2012-05-26 14:30
    Now on sale for $5.39 free ship: http://www.ebay.com/itm/4-Channels-5V-Relay-Module-for-Arduino-ARM-PIC-AVR-DSP-aii-/160809461854?pt=LH_DefaultDomain_0&hash=item2570fda85e

    That's just $1.35 per SPDT relay, assembled, on an optoisolated breakout board. Must be McDonald's, cuz I'm lovin' it!
  • ercoerco Posts: 20,259
    edited 2012-05-28 23:25
    That sale's over in 5 hours. Am I the only one who stocked up at $5.39? You'll be seeing these relays in action soon and wondering why you didn't get some. :)http://www.ebay.com/itm/160809461854?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1439.l2649
  • ercoerco Posts: 20,259
    edited 2012-06-02 15:25
    Received my $5.39 board today. Fast ship! The PCB is red, it's a bit smaller and has different input pins than the previous blue PCB, but functions the same. It has one more LED, simply a power on indicator.
  • ercoerco Posts: 20,259
    edited 2012-06-06 00:22
    I just nabbed 2 more boards tonight when I saw them at the rock bottom price of $4.19 Buy It Now/Free ship. That's a steal. Click on the blue "6 sold" link and you'll see that price.

    http://www.ebay.com/itm/160809462051?ssPageName=STRK:MEWNX:IT&_trksid=p3984.m1439.l2649

    Well apparently it was a mistake, 'cuz now they're showing $5.99. Guess I went & ruined it for everybody. :(
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-06-06 03:28
    Does anyone every use more than 4 relays? I have an 8 relay board I never use. And my 4 relay set up often gets deployed with only 1 or 2 relays in use.

    There is something about relays and networks where we thing we really need more than we do.
Sign In or Register to comment.