Wiring OEM in-chassis SMPSs for 3D printers…

Lots of people in the hobbyist community building RepRap-type 3D printers and other kinds of hobbyist-scale CNC tools often seem to use these switchmode mains-input power bricks designed for OEM integration into another chassis, commonly made by names such as MeanWell, Shenzhen Keyington (kytet) etc.

Since some people sometimes have questions about how to correctly and safely wire up the 110-240VAC line input cable to these kinds of power supplies, and since I was working with one recently, I thought I’d take a few photos to provide an informative guide for beginners.


Here are the materials I’m going to use to get started – the SMPS module itself, a chassis-mount snap-in IEC mains socket with 4.8mm male spade terminals, some spade and fork crimp terminals, some heavy-duty cable for the high-current DC output, and some cable for the mains AC side.

For mains AC wiring, you really want to choose some wire that has copper conductors of an appropriate thickness for the currents involved, insulation of an appropriate thickness, insulation that is intact and not damaged, and a standard color code for the AC mains active, neutral and earth.

The easiest thing to do is to simply start off with a little bit (30cm or so is plenty) of 3-core mains AC flex cable. You could even find some discarded appliance on the roadside, or something, and cut off the cable to get a perfectly usable bit of flex for free. You can see a relevant example in the above photo.


You can just strip off all the outer insulation off the piece of flex and keep the three internal wires, as shown. When cutting the outer sheath, remember to be careful not to damage or cut into the insulation on the inner wires. You want the insulation on these wires intact and not damaged, so check and make sure it’s not cut or damaged. Now you’ve got three perfectly suitable wires ready to go, with standard color coding, appropriate insulation thickness and appropriate copper thickness for mains AC use.


This is just a random photo I’ve pulled from somewhere on the Web of somebody’s RepRap build. Here you can see that every one of the wires – the AC active and the neutral as well as the DC output rail and the DC ground – is the same color. The mains earth does not even appear to be connected, I’m not sure.

Don’t do this. Use appropriate, standard colors for all the wires – brown and blue (or black and white if you’re in the US, I guess) for the AC active and neutral and striped yellow/green for the mains earth. I really think a black wire should be used for the DC ground, although it might be best to try a different color if you’re using US-standard AC wiring with a black active wire. Red, or some other “warm” color other than brown, is best for the +24V or +12V DC output rail, I think.



Now, I’ll start by stripping the wires and crimping on three 4.8mm female spade terminals. When you strip the wire, be careful not to cut off the copper strands inside, as this compromises the integrity, and the current-carrying capacity, of the conductor.

When working with crimp terminals of this sort, it’s really important to use a good ratchet-type crimping tool. Trying to do a half-assed job crimping the terminals with an inappropriate crimping tool, or a vice, or pliers or something like that is just going to waste your time on an unreliable, and maybe even dangerous, result.



Now we can just plug the wires in to the IEC socket. Yes, in theory, you can just solder the wires onto the IEC socket, but I prefer not to. If you choose to go down that path, though, you do need to make a good, reliable solder joint reasonably quickly. If you’re too slow and heat up the socket too much, the plastic can start to melt and the metal pins in the socket can start to move.

Remember that the 3 terminals on the back of the IEC socket are labelled with their functions – L, N and E moulded into the plastic next to each pin meaning live (or active),  neutral and earth respectively. The earth pin is the one in the middle. L, N and E correspond to the brown, blue and green/striped wire respectively, assuming you’re working with the same set of standard colors we use in Australia.



You can just stick the wires under the screw terminals like this. Many people do so, but again, for a production build (as distinct from quick testing) I’d personally prefer not to do it. If you do go down this route, though, remember that a wire wrapped clockwise around a screw terminal will be pulled inwards and fastened snugly against the screw terminal as you tighten up the screw, whilst a wire wrapped anticlockwise around a screw terminal will be pushed outwards and loosened a little bit away from the screw as the screw is tightened. Therefore the wire should go in clockwise.

The active (brown in this case) wire goes to the “L” (L for “live”, which is synonymous with active) terminal, the blue (neutral) wire goes to the “N” terminal, and the earth (green/yellow) wire goes to the terminal labelled with the ground symbol. (Although, to be pedantic, I note that they should have used the mains earth symbol instead of the DC ground symbol… they are not the same thing!)


Here’s some random photo I’ve found from somebody on the Web again… note that the active and neutral are apparently transposed here. Don’t do this.


Personally, I think it’s a much better course of action, for increased security and reliability in the connection, to crimp a few 3.7mm fork terminals onto the wiring loom, like I have done here, and attach these to the power supply.



You can also put a rubber boot over the back of the IEC connector, if you want, to cover its terminals. These come in two different sizes, for male and female chassis-mount IEC sockets. However, if you’re mounting the IEC connector on an enclosed, covered chassis where it’s not accessible, I really don’t think it’s needed.


I also popped a couple of appropriately large fork terminals (the yellow ones, with a cable entry suited to this thick cable) on the cable I’m running for the DC side. Very thick cable is used here to minimize voltage drop at high currents. This can then be terminated onto the DC output terminals on the supply.


After everything here is done remember to flip down and close the screw cover, which stops screws and other debris from falling and hitting the exposed 240VAC screw terminals.


Now… let’s plug it in for a test. It works!
(If you’re not sure of what you’re doing you should obviously be very careful testing 240VAC systems open on the lab bench. If you’re in doubt, just finish installing everything into a covered, finished enclosure and then test it afterwards.)



Alternatively, you can use a chassis-mount IEC socket like this one, which incorporates a built-in IEC socket, fuseholder and switch in one integrated package. When using a module like this, you’ll need to run one active wire (either with spade terminals or directly soldered on) from the fuseholder terminal to one pole of the switch (the other side of the fuseholder is pre-connected to the active pin of the IEC socket) and a neutral wire from the neutral pin of the IEC socket to the other pole of the switch.

The earth wire to the SMPS just comes directly from the earth pin on the IEC connector, and the active and neutral wires going to the SMPS are connected to the active and neutral poles on the “switched side” of the switch. OK, so it’s a little clumsy to explain in words, but if you’re working with a device of this sort and you’re not sure, feel free to comment here or ask me.

Now you’re ready to probably consider mounting the IEC socket on a chassis so that the mains supply wiring is completely enclosed and protected… or maybe even using a 3D printer to print a plastic cover that mounts on the end of the power supply chassis, completely enclosing the wiring. We might look at this next time, but not right now.
Hope you find this useful!

About this entry