Dangerous Prototypes

In development => Project logs => Topic started by: t0mpr1c3 on November 23, 2013, 08:55:31 pm

Title: Relay Control Board on DP5031
Post by: t0mpr1c3 on November 23, 2013, 08:55:31 pm
A little breakout board for cheap Songle SRD series relays. Based on Sparkfun COM-11041.



Blog post: http://smokedprojects.blogspot.com/2013 ... 1-pcb.html (http://smokedprojects.blogspot.com/2013/11/relay-control-board-on-dp5031-pcb.html)
Title: Re: Relay Control Board on DP5031
Post by: t0mpr1c3 on November 23, 2013, 11:01:38 pm
Twin relays on DP5050.



Blog post: http://smokedprojects.blogspot.com/2013 ... 0-pcb.html (http://smokedprojects.blogspot.com/2013/11/twin-relay-control-board-on-dp5050-pcb.html)
Title: Re: Relay Control Board on DP5031
Post by: t0mpr1c3 on November 23, 2013, 11:40:02 pm
BC547s replaced with BC337s
Title: Re: Relay Control Board on DP5031
Post by: t0mpr1c3 on November 24, 2013, 09:58:55 am
And a new lightning strike logo!
Title: Re: Relay Control Board on DP5031
Post by: t0mpr1c3 on December 03, 2013, 04:13:32 am
Relay footprint changed to JS-M. I've ordered 10 of the DP5050s from Elecrow, let's see how they turn out.
Title: Re: Relay Control Board on DP5031
Post by: Sleepwalker3 on December 03, 2013, 12:10:51 pm
Can I suggest a bit more clearance between the LV side and the mains switched side? Balance up that track to the centre pole so that it's equal distance from each of the coil terminations. Personally I dislike using mains on relays with that layout. It would probably also be a good idea to keep put the tracks to the coil on the other side of the board compared to the mains tracks - preferably with the LV coil tracks on the top layer, so the mains tracks are fully visible and you can see if there's any issues like a solder dag or whatever. Anyway, all just suggestions :)
Title: Re: Relay Control Board on DP5031
Post by: t0mpr1c3 on December 03, 2013, 02:48:15 pm
Thanks for the constructive suggestions.

It certainly wouldn't hurt to increase the clearance between HV and LV lines to 2mm from 1.5mm and I will probably do that on the next revision of the boards.

I opted for having the HV tracks on both sides to increase the current capacity but that might have been better served by having the HV tracks exposed on the bottom layer so that you can build up a big solder layer if necessary. And then the signal traces on the top layer as you say.

I figured that it didn't matter anyway since there were pads for the coil pins on both sides of the board. The possibility didn't occur to me to edit the package to get rid of the pads on one side.
Title: Re: Relay Control Board on DP5031
Post by: Sleepwalker3 on December 03, 2013, 03:16:45 pm
OK, I didn't click that you had the mains tracks on both sides. You could always go with 2 Oz copper. The clearance will also depend on what your local mains is, here it's 240V (actually officially now it's 230V, but most places here are still 240-250V). If you're on 110V main, then it's a touch less critical, but one of the things I dislike about Sparkfun doing things like this, is that they tend to design for 110V (if that) and then sell it as a mains relay' world-wide. I've written to them a couple of times about the dangers of some of their relay boards, some had virtually no clearance for mounting screw heads, with the danger of metal mounting hardware actually very likely to contact the mains tracks!  Even their second attempt wasn't up to scratch, which was pretty disappointing. In the hands of somebody who didn't know what they were doing, it's downright scary! - and lets face it, many of the people there are only hobbyists with limited experience and knowledge.

I prefer the layout of power relays like the Idec RH2B-UDC24V for example and you can get them in SPCO, DPCO or 4PCO, with bases for PCB mounting (to allow plug-in) or DIN rail bases. Also same thing made by various manufacturers like Finder (56.32.xx (DPCO), 56.34.xx (4PCO), etc series), Omron and others.  In most cases I'm far happier making something like this with a DIN Rail base and keeping all the power stuff safely mounted away from the PCB, with decent size screw terminals for all the mains stuff. It's more expensive, but much easier to change the relay if required, easier to wire and inherently safer.
Title: Re: Relay Control Board on DP5031
Post by: t0mpr1c3 on December 03, 2013, 06:02:42 pm
I agree with all of the comments you make. These Songle relays are ubiquitous on cheap breakout boards but I don't much like the layout. I see that the "Beefy" version of the Sparkfun breakout board has the HV and LV tracks on opposite sides of the board as you suggest. 2oz copper is another good option.

I used http://www.creepage.com (http://www.creepage.com) to calculate the minimum clearance and creepage for 240V mains, and got these results, based on IEC guidelines. Would you consider these parameters appropriate?

Minimum clearance 1.5 mm (pollution category 2, 150 V >= nominal mains voltage <= 300 V, Vpeak = 400V, not QC program)

Minimum creepage of 0.6 mm (functional insulation, pollution degree 2, material group IIIa/b, working voltage 250 Vrms, coated board).

Specifying a non-coated board raises the minimum creepage to 5.0 mm so clearly if using mains voltage it is necessary to apply conformal coating, pot the board in neutral cure silicone, or something like that. The same precaution would seem to apply to the Sparkfun board.
Title: Re: Relay Control Board on DP5031
Post by: t0mpr1c3 on December 04, 2013, 06:54:50 am
There was a query with the order so I got to redo the Gerbers. Thanks Sleepwalker3 for the helpful comments. I took the suggestion of an anonymous commenter on the Magic Smoke blog to rotate the relays. This helps a lot to separate the high and low voltage sections of the boards.
Title: Re: Relay Control Board on DP5031
Post by: Sleepwalker3 on December 07, 2013, 10:58:31 am
Thanks Tom. I haven't looked up to find official distances, but if I was making it myself, I'd want it as wide as possible, preferably >3mm if possible. I don't think you need to go to the trouble of potting it, but anybody using it would be well advised to just be cautious to give good clearance and insulate things sensibly and most importantly - Use a suitably rated fuse or circuit-breaker upstream.  Elephantide or Presspahn insulation is advisable in situations were there is a metal housing or where there's a fair chance of something shorting or becoming live.  Neutral-cure silicon is no guarantee that it won't damage your circuit, many are unsuitable for bare copper and only certain specialised types aren't (such as certain specialised types from GE). You can get suitable potting compounds made by Chemtronics, Electrolube, etc. but I don't think it's necessary for this. We don't do it with 415V stuff, so it's shouldn't be necessary for hobbyist stuff.

Another thing to watch, as I think I mentioned, is thing like mounting holes. Don't make the holes too close to the edge (something I see a lot in hobbyist's boards and even the Sparkfun board), as it's all too easy for them to crack, especially if you've got screw terminals on the board. It's really important to consider how somebody else might mount their unit. I'd be more likely to use nylon/etc. type mounting hardware, but others may use metal screws and washers, so you have to allow clearances for that - that was a serious problem with the SF designs and in my opinion, still is.

If you wanted an extra layer of isolation you could always use an optocoupler (e.g. a 4N35) instead of the transistor, but it's probably overkill for many applications.  One thing many hobbyists don't realise is to watch the load ratings, switching a resistive load is totally different to switching a reactive load and the 'headling ratings' should never be taken as the proper rating for a particular application. As you probably know, when switching Inductive or capacitive loads (Reactive loads) you have to treat the specs totally differently (derating) to suit the particular load. You also might need to consider the arcing of the contacts and the potential for welding of the contacts if not done right. Probably no issue if you're switching your project is switch on your Christmas tree lights when it gets dark, but I recall a guy over at Sparkfun asking if he could switch his compressor on and off with a relay like this and I advised strongly against it.

 Anyway, you're thinking about it and being safe, so that's the main thing, just use 'common sense' and allow a wide margin for everything - that way hopefully the 'magic smoke' won't be you becoming a charcoaled mess on the floor (it's such a hassle to clean up charred remains ;)
Title: Re: Relay Control Board on DP5031
Post by: t0mpr1c3 on December 07, 2013, 05:42:47 pm
This is the updated version that I have ordered.



I don't think I will be switching large currents, but I do want to switch mains voltage, which for me in the USA means 110V and possibly 220V for some applications. And not necessarily resistive loads either, things like turning on fluorescent lights and contactors with mains voltage coils. I think for the 220V contactors I am going to go with ice cube relays.

I did look into optocoupling. Wasn't sure if it was overkill. I figured the main issue was separation between coil and load voltage, not between microcontroller and coil voltage. If I was buying a relay module I would get one with optocouplers though.

I have looked at a couple of these little relay module boards and the separation between the load tracks is nothing like 3mm e.g. this one by LC tech (http://http://www.lctech-inc.com/Hardware/Detail.aspx?id=9dd92423-4cb0-439f-9c03-34f77cde89ce). The load traces are immediately adjacent to the ground plane and separated from each other by less than 1mm in places. Now that could be OK if the boards are covered in conformal coating, possibly, I suppose, but it doesn't say anywhere on the documentation that that is the case. Perhaps I don't know what to look for but I see no evidence of coating on the board, other than the normal silk screen, just a few smears of flux around the through hole soldering. So one has to wonder who out there has used these to switch 10A at 250VAC and lived to tell the tale. Possibly an opportunity for Afroman (http://http://www.youtube.com/user/Afrotechmods) to do a bit of destructive testing.

[attachment=0]

Thank you for stressing the safety considerations. Much as I love the smell of frying bacon it is so much preferable when it happens to somebody else.  D-:E
Title: Re: Relay Control Board on DP5031
Post by: Sleepwalker3 on December 07, 2013, 09:56:29 pm
Yeah there's tons of examples of what not to do out there and to me, that LC thing looks like that. Just because they do something, doesn't mean it's the right way or the safe(est) way. I tend to prefer to stick on the safe side, I've seen (and experienced) way too many unsafe things over the years thankyou very much!

From the look of that LC board, it would be rather hard to mount it well too, as it's only got two mounting holes and both at one end - and it appears to be at the end away from the screw terminals, so rather difficult to do up the screws in the screw terminal without breaking the board. Also pretty pointless putting using optos if the isolation between LV and HV is stuff-all. The danger is not so much from arcing over (though certainly possible), it's more likely to be from tracking or shorts.

If you're switching inductive loads, then put suitable suppression close to the load, eg. RC suppressors that are suitably rated, perhaps a MOV also. That will reduce the Dv/Dt and help the poor old contacts. Fluros with the old style Ballasts are pretty horrid loads with complex reactance, the electronic ballasts are nicer, but if it's only a couple you should be fine, just preferably use an RC and MOV. If you're talking bigger loads and / or regular switching, then yes, you want a proper Contactor, not a relay (especially not a no-name cheapy one). If using a contactor you'd suppress the contactor coil as well.

Some further suggestions,  maybe changing the 1N4148 up to something like a 1n4004 (or 4007, etc.), or even a fast UF4004, etc. as it could be a fair sort of current peak, even if only for a brief moment. The 1n4148 will work fine, but might cop a bit of a pounding over time. Also preferably have the tracks from coil to flyback diode thicker and the diode closer to the coil - less inductance with the fast risetime when the coil goes flying. I think you'd be better off running that centre track straight to the relay and ditch the vias, then run the coil on the other layer. You can safely widen those output tracks a bit if you wanted, or even run those top and bottom layer if worried about current, your new layout allows much more clearance, so you've got a bit of room to play.

Anyway, I'm nitpicking with all this, Your new layout looks much better, you've done really well there - well done.
Title: Re: Relay Control Board on DP5031
Post by: t0mpr1c3 on December 07, 2013, 10:27:22 pm
Your help is much aapreciated SW. I could maybe use SMT resistors to help make room for better diode placement. The purple parts of the output tracks are top and bottom layer overlaid - a bit hard to distinguish form normal red on a small diagram, I admit.
Title: Re: Relay Control Board on DP5031
Post by: Sleepwalker3 on December 08, 2013, 05:27:56 am
No problem Tom, I think You've done very well with it. SMD might put off some, so it depends what you're aiming for.  I'm used to Altium, not Eagle, so I couldn't easily modify it, but looking at the picture I don't think it will be too hard.

If you decide to modify it, it will depend on how you want your components organised. What you could possibly do is ...
swap the position of the LED resistor and the Diode and re-route appropriately. I think that would all fit nicely and doesn't look too hard to re-route.

The only negative I see with this approach is that it looks like you've made the resistor / diode layout the same top and bottom and if you modify to do the above, then it mucks that up. However if you wanted to maintain that, it wouldn't be shouldn't be too hard to swap the resistors around to get them in a similar identical layout top to bottom again.

Remember too that you can also put the LED resistor in either leg, so you have extra flexibility, but I don't think you'll need it.

Another option would be to use 1/8W through-hole resistors (which these days are likely to be 1/4W anyway), which are much shorter, though you are probably aiming at people who might already have the more common length of resistor.

Really what you had is fine, my suggestions were just silly things that will likely make no real difference - it's your baby, so don't let me tell you how to suck eggs!
Title: Re: Relay Control Board on DP5031
Post by: t0mpr1c3 on December 08, 2013, 05:39:58 am
Yes, the diode and resistor can be swapped without any real issues. Thanks again!

... especially as the design has now been exposed on Hack A Day. (http://http://hackaday.com/2013/12/08/hackaday-links-december-8-2013/) Which I suppose I would rather have happened after I have tested it out.
Title: Re: Relay Control Board on DP5031
Post by: t0mpr1c3 on December 22, 2013, 09:29:35 pm
Prototypes arrived yesterday from Elecrow. It is an intermediate revision of the design that is probably not suitable for the project I have in mind but might be OK for lower voltages. If it looks like they work for that purpose I will distribute them as freebies :)
Title: Re: Relay Control Board on DP5031
Post by: Sjaak on December 23, 2013, 10:00:24 pm
Please put a big warning on it :)
Title: Re: Relay Control Board on DP5031
Post by: t0mpr1c3 on December 24, 2013, 02:54:49 am
Yes of course. I honestly think they are probably safer than some of the commercial offerings I have seen. But I have a 240V use case and they are not suitable for that.

Title: Re: Relay Control Board on DP5031
Post by: Sjaak on December 24, 2013, 10:19:44 am
The magic smoke covers it well I think :P
Title: Re: Relay Control Board on DP5031
Post by: t0mpr1c3 on December 24, 2013, 05:02:03 pm
Magic smoke is prereleased on all designs to ensure zero emissions on site.
Title: Re: Relay Control Board on DP5031
Post by: Sleepwalker3 on December 25, 2013, 08:22:25 am
Looks good Tom.  Merry Christmas  :)

( ! ) Fatal error: Uncaught exception 'Elk_Exception' with message 'Please try again. If you come back to this error screen, report the error to an administrator.' in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
( ! ) Elk_Exception: Please try again. If you come back to this error screen, report the error to an administrator. in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
Call Stack
#TimeMemoryFunctionLocation
10.01792151720session_write_close ( )...(null):0
20.01822283312ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.01822284088Database_MySQL->query( ).../DatabaseHandler.php:119
40.06312422824Database_MySQL->error( ).../Db-mysql.class.php:273