Working on a project that connects to mains - Page 1
Forum section: electronics / beginners

author: listener
author_rank: Newbie
timestamp: March 22, 2017, 09:29:45 pm
content: Hello Everyone,This is my first post but I'm long time lurker.I'm computer programmer doing hobby electronic and mostly so far I have played with different micro controllers, simple circuits for different kinds of gadgets but something I wish to make is bench power supply and since this involves connection to mains I would welcome pointers, directions, tips of how not to electrocute my self (apart from the obvious ones of course). Some guides on how to properly deal with this kind of circuits, proper connection and protection of wires and whatever would be helpful. I have found a lot of information on the internet but mostly it is scattered and not coherent.My project will be essentially toroid transformer that connects to 230V then splits to multiple secondary ones from 5-50v. It will involve probably color display some micro to control it some digital encoders for setting voltages and current probably two lines haven't yet designed it in full just have rough idea so far and high concept the details I'm assembling slowly.I welcome any and all input. Thanks!

author: james_s
author_rank: Super Contributor
timestamp: March 22, 2017, 09:49:59 pm
content: It's not rocket science, but use some common sense on the mains side. Use properly rated wire, appropriate connectors, take care to make the wiring tidy and lay it out in a logical fashion. Make good mechanically sturdy connections and insulate with heatshrink tubing where possible. Don't forget to include a fuse, preferably in a fuse holder accessible without opening the cabinet. Watch your clearances, make sure nothing on the secondary side can easily contact anything on the mains side, and don't forget to earth the cabinet and/or any exposed metal parts securely. Post a schematic and/or pictures of your finished wiring here to get feedback if you are unsure.Fortunately the mains side is really simple, and once taken care of you can focus on the secondary side with much less concern.

author: rstofer
author_rank: Super Contributor
timestamp: March 23, 2017, 12:17:13 am
content: Quote from: james_s on March 22, 2017, 09:49:59 pm?

author: james_s
author_rank: Super Contributor
timestamp: March 23, 2017, 12:56:16 am
content: Whoops! Good catch, it was a typo, I've corrected my post.Don't *forget to* earth the cabinet and any exposed metal parts.

author: listener
author_rank: Newbie
timestamp: March 23, 2017, 08:58:39 am
content: Too late I'm already dead:)

author: SingedFingers
author_rank: Frequent Contributor
timestamp: March 23, 2017, 09:12:17 am
content: Here's one I did as an indicator of what to aim for (criticism welcome)

author: renster
author_rank: Newbie
timestamp: March 24, 2017, 01:46:18 am
content: Quote from: SingedFingers on March 23, 2017, 09:12:17 amWhere do you get enclosures of this kind from?

author: james_s
author_rank: Super Contributor
timestamp: March 24, 2017, 04:59:55 am
content: Pac-Tec makes enclosures of very similar style, IIRC I got mine from Digikey. I don't think that's one of theirs but it's the same basic style.

author: SingedFingers
author_rank: Frequent Contributor
timestamp: March 24, 2017, 07:11:58 am
content: It's a Hammond RM2015M. Available from just about everywhere. Got mine from here:https://www.bitsbox.co.uk/index.php?main_page=product_info&cPath=185_189&products_id=1415(incidentally better service than the bigger suppliers here in the UK)Front view:

author: analogo
author_rank: Regular Contributor
timestamp: March 25, 2017, 09:18:44 am
content: SingedFingers: Wouldn't it be better to screw the protective earth connections instead of soldering them?

author: Zero999
author_rank: Super Contributor
timestamp: March 25, 2017, 08:07:27 pm
content: Quote from: analogo on March 25, 2017, 09:18:44 amCrimping is the ideal method for protective earthing but not everyone has the proper tools to do it.

author: listener
author_rank: Newbie
timestamp: March 25, 2017, 10:18:52 pm
content: Looks nice!I do plan to properly crimp wires I guess it's worth it not just for protection but for servicing along the road.You only need some silk screen or labels to make it complete.No bridge rectifier you just need it for AC ?Do you guys have any recommendations for when testing power transformer (I have custom made toroidal with multiple secondaries so I have 5V, 12V, 24V, 34V and 50V secondaires) for example something that would be between actual mains socket and power adapter that will disconnect in case I try to electrocute something.... is it called FI protection or something like that?Here is transformer for the record.http://imgur.com/a/OBfIF

author: Messtechniker
author_rank: Frequent Contributor
timestamp: March 26, 2017, 03:44:30 pm
content: For the protective earth connection see enclosed pic. Print out the pic and keep it with the needed parts.Maintain a clearance of at least 5mm with respect to conductive parts at 230 V mains potential.Check your mains wiring according to this:http://www.merz-elektro.de/compose_bilder/File/Katalogteile/prueftechnik_informationen_DE.pdfor ask a professional electrician to run these tests and accept the results. There is no place for complacency or over self-confidence here.Be strict. Do not skimp. Be critical. Do not try to save money, time or effort. Always remember: Your life/property or that of others may be at risk. Even if the project is for your use only, you never know in which hands it will end up in future.Yours Messtechniker

author: SingedFingers
author_rank: Frequent Contributor
timestamp: March 26, 2017, 10:37:25 pm
content: For ref, I'm aware that crimping is the best approach but I don't have a crimp tool and do so very few crimps that the justification to purchase one is low. Soldering is thesecond bestapproach. You will see that the copper is looped entirely around the loops to give mechanical stability before soldering. This is the same approach Tek use with their old 400 series oscilloscopes. You'll also see it on the binding posts and boards in an Agilent E3630 to this day.For ref, this was an experiment. I wanted an AC supply so I can derive some odd voltages from a small package. This gives me 2x 6v windings. That is also one 12v winding. Some I've got out of it adding a few external components:1. +/-12v DC2. +18v DC3. +5v DC4. +96V DC (neons)5. 6/12v AC for vacuum tube heater testing.Quite useful. I've got three bench supplies already but it's nice to have around.

author: listener
author_rank: Newbie
timestamp: March 29, 2017, 11:17:14 am
content: Messtechniker, Thank you very much for explanations and material it helps very much so. I fully agree with you my intention is not to go with cheap parts that is one really nice benefit when you are making your own thing you can make it with quality in mind.Thanks everyone for great advice except james_s he killed meJust kidding:)

author: Messtechniker
author_rank: Frequent Contributor
timestamp: March 29, 2017, 03:40:31 pm
content: Quote from: SingedFingers on March 23, 2017, 09:12:17 amWell SindedFingers, you're certainly on the right track with your wiring here. But you might still improve a bit (with details explanations as to the reasons):1.) The central earth connecting bolt should not be used to affix the transformer (or anything else for that matter). It must be separate. Reason is the worst case scenario where the transformer comes loose thereby impairing the protective earth connection at the same time. I.e. you need a separate central bolt to which all metal parts are connected in star fashion.2.) The bolts holding the mains power inlet should on the outside either be covered with a non-removable plastic cap (welded in place) orboth bolts should be individually connected to the centre protective earth connection point. Reason is the worst case scenario here: a live wire comes loose flapping around in the inside.3.) Just to make sure as I believe it is the case here: The protective earth wire running from the mains power inlet socket to the central protective earth point should be the longest of all wires. Reason is the worst case scenario here: live wires have been torn off and are still live. In such a case the protective earth connection must be the last connection to fail. You can ensure this by making the protective earth wire longer than all other wires.4.) If the tabs have a hole then this hole should be used to thread a wire end forming a hook through the hole. I believe this is the case here. Just to mention this.I know that the worst case scenarios are very unlikely to happen, but with mains voltages involved it is always essential to be on the absolutely safe side.5.) All inlets and outlets should be marked accordingly. Reason: if someone else finds this box in future, then it will be immediately apparent what this box is and what its basic specification limits are. I do one-off front panel inscriptions using a printout on ordinary paper which is then laminated and attached to the box with double sided adhesive tape. If you are really mad, you might even engrave the inscriptions.Just some food for thought.Yours Messtechniker

author: SingedFingers
author_rank: Frequent Contributor
timestamp: March 30, 2017, 10:05:14 am
content: Thanks for the feedback - much appreciated.1) Good point. Will resolve that today. I will add a separate post and a strap to the transformer and the earthing point. At the moment it has anti-vibration washers underneath the unit and under the nuts with a small blob of screw-lock on the nut. This can definitely be improved.2) Another good point. I was worried about this to start with. I actually have another IEC inlet available here which has no bolts on it that I was going to use originally but it took a month for RS to send it out so I used one I had lying around that neatly fitted into the hole. It clips into the case and has no mounting screws. It cannot be pulled back out when installed. The existing drilled holes will be filled with epoxy.3) Well spotted. That is the case here. It's why it is run over the top of the connector (to keep it slack) and the other wires are as short as possible. The earth was wired first and then all the other connections done so that they were under tension.4) Wires are run through the loop, hooked over and pulled back out so they are wrapped once around each hook. I have been told I should use crimps here in case the joint melts but the probability of that is much lower I think. I have done this in the past and have managed to push 30 amps through an earth with no damage. Also Agilent and Tektronix don't use crimps in my scope and PSU5) This is an old photo. It is actually labelled up now clearly with a Dymo. Front has "AC SUPPLY" and "6V", "6V" and "EARTH" next to/between respective terminals. Rear has "230V 250mA" next to the fuse holder. The inside has the schematic written into the top with a marker.Thanks again - this is really useful

author: Messtechniker
author_rank: Frequent Contributor
timestamp: March 30, 2017, 10:52:04 am
content: Quote from: SingedFingers on March 30, 2017, 10:05:14 amAs far as i know, one does not have to expect under worst case considerations that soldered joints will loosen (melt or crack). Since this is old knowledge, things may have changed in the mean time. I will discuss this with an expert in due course.

author: james_s
author_rank: Super Contributor
timestamp: March 30, 2017, 04:53:41 pm
content: Properly done, either solder or crimp is very reliable. Improperly done neither is reliable. IMHO I think soldering is easier to make a reliable joint, I've seen a LOT of crimped connections that were not crimped tightly enough or did not use the right size connector for the wire.

author: Ian.M
author_rank: Super Contributor
timestamp: March 30, 2017, 05:21:11 pm
content: The trouble with soldering is its very hard to avoid it wicking up the wire and forming a weak spot where the solder ends and all bending forces are concentrated as tension in the outer strands. This can be partially alleviated by heatshrinking over the joint to stiffen the wire past the weak spot.

author: Vtile
author_rank: Super Contributor
timestamp: March 30, 2017, 09:31:54 pm
content: Quote from: Ian.M on March 30, 2017, 05:21:11 pmI have read this claim from many sources, but is there any study on it? When I think about it isn't the same case also in grimped joint? I think the only source I have seen on this is the old wirewrap vs soldering studies and it weren't the wire itself, but the PCB joint that would give up.One thing for the grimped joint is that it survives from bigger heat load in shortcircuited fault. In mains related circuitry the thermal shock resistance is somehting that always should taken account. Edit. ... But I do not have any official guidance / rules in my head for this sort of devices.

author: Ian.M
author_rank: Super Contributor
timestamp: March 30, 2017, 09:50:48 pm
content: I have personal experience with soldered stranded wires that suffered fatigue failure just past the limit of the solder wicking, so I can assure you it does happen. Most crimp systems grip the insulation as well as crimping onto the wire so there is less stress on the strands where they exit the crimp joint itself as they are supported near rigidly by the grip on the insulation. Of course this only applies if the crimp is properly made with controlled deformation using the correct dies. $5 crimp 'tool' kits are absolutely useless and more dangerous for mains wiring than wrapping the strands round the terminal and taping it!By the time a joint in the mains wiring gets hot enough to melt solder, you have worse problems - e.g. melted insulation in the flex cord and probably an arc eating its way back up the cord towards the wall plug. However, you do need to make sure that all such joints are mechanically sound before soldering as solder becomes weak quite a way below its melting point.

author: SingedFingers
author_rank: Frequent Contributor
timestamp: March 30, 2017, 09:52:30 pm
content: I've just semi tested this. Once the solder has wicked up typical UK mains lead, it'll take a good minute or so of vigorous wiggling to break the connection off at the solder joint.I don't think this is likely to be an issue if both ends of the wire are fixed i.e. there is a standard IEC inlet and the other end is soldered to a solder tag somewhere. There isn't a lot of mass in the cable to cause that sort of fatigue and if there is the cable should be tied anyway.Back in the old days when the inlet was a bit of flex stuffed through a hole with a strain relief grommet on it, I could imagine this being a bit of an issue with cable flexing inside the unit.

author: Ian.M
author_rank: Super Contributor
timestamp: March 30, 2017, 09:58:25 pm
content: Its also can be an issue if you have a heavily loaded transformer, motors, speakers or any other source of vibration.

author: listener
author_rank: Newbie
timestamp: April 01, 2017, 07:29:40 pm
content: And apart from whats already said crimping allows for clean modular design where you can interchange component with very little fuss.Can anyone recommend good crimping tool set and good crimp connectors ?

author: Richard Crowley
author_rank: Super Contributor
timestamp: April 01, 2017, 08:08:40 pm
content: Re soldering vs. crimp and wicking in stranded wire: I believe the NASA/aeronautical standards require crimping for its superior vibration resistance. And proper gas-tight crimping produces a connection at least as good as (and typically superior to) soldering.While I agree with all of the points made previously about grounding. Note that none of them are effective in non-conductive enclosures such as the OP shows. In this case, the only conductive point that is vulnerable to contact with mains power are the transformer mounting screws. I would have connected the green-wire safety-ground to the transformer bracket exactly as the OP shows.

author: Ian.M
author_rank: Super Contributor
timestamp: April 01, 2017, 08:52:55 pm
content: No. NOT exactly as shown. There aren't any extra fixing holes that could be used to give the transformer a separate earth for its core, so as a minimum use a Nylock or other type of locknut + a Belville or wave spring washer so the ground connection remains effective even if some idiot tries to turn that mounting screw without opening the case. The IEC power inlet fixing screws should also be grounded, and unless the rear of the connector is shrouded, they should also be locknutted as there is a significant short-circuit risk if the ground wire to them comes loose and it and the socket are flapping around.Fortunately there aren't any metal bodied toggle switches - grounding them (or other metal bodied controls) safely in a plastic case can be a royal PITA.