Raspberry Pi 4B LinuxCNC: Main Power Distribution (Wiring)
By “main power,” I mean the wiring from the AC inlet to the three power supply units used in the LinuxCNC system I am building. In this post, I list the relevant components and share the wiring pictures.
🐧 Index of the Complete Series.
![]() |
---|
Raspberry Pi 4B LinuxCNC: Main Power Distribution (Wiring) |
I am just an ordinary computer programmer and not trained in any of the electronic engineering disciplines. This LinuxCNC project is a learning process for me. This post is not meant to be a tutorial or instructional guide; it is my own documentation so I will not forget what I have learned.
I am not to be held responsible for any damages or injuries resulting from using the information presented in this post.
This post begins with this LinuxCNC forum thread, where I was seeking help on the wiring. The final result presented here is based on suggestions from Mr. tommylight, Mr. RodW, and Mr. unknow (Rob). I am also fortunate to have a friend who is a professional electrical engineer, who has been very kind in helping me whenever I had questions. ChatGPT and Copilot have also been essential to my learning. All errors and mistakes are, of course, mine.
💡 As you can see from the forum thread, I was completely clueless at the start. I studied a lot in order to complete this wiring. This is not a tutorial, so please do not treat it as one — I am simply documenting my progress for my future self.
❶ The Three Power Supply Units (PSU)
⓵ MEAN WELL MDR-10-5 — This PSU powers the 7I96S STEP/IO Step & dir plus I/O card, which we discussed in this post. I bought this one locally.
⓶ MEAN WELL MDR-100-24 — This PSU powers a 24VDC contactor, as documented in this post, as well as the proximity switches, which I have not covered yet. I ordered this PSU online, shipped from a warehouse in Texas, U.S.A.
⓷ MEAN WELL UHP-750-36 — This PSU powers the four CL57T Closed-Loop Stepper Drivers, and therefore the four Nema 23 Stepper Motors. We previously discussed the stepper drivers and motors in this post. I also ordered this PSU online, again shipped from a warehouse in Texas, U.S.A.
At this stage, I still have only one driver and one motor; I have not purchased the other three yet. Let’s discuss why this PSU is suitable.
UHP-750-36
specifications:
- Output Voltage (Channel 1): 36 VDC
- Output Power: 752.4 W
- Input Voltage: 90–264 VAC, 127–370 VDC
- Output Current (Channel 1): 20.9 A
The Nema 23
stepper motors require 24–48 VDC. I am in Australia, where the
nominal AC voltage is
230–240 VAC. Therefore, the PSU input voltage
and
output voltage
are appropriate. According to this Stepper Online article:
How to choose a power supply for my stepper motor?, the
maximum power draw (P) in watts to run all four Nema 23
stepper motors at full current and under full load at the same time is:
P = n × I × V × 1.2
where:
- n: the total number of stepper motors, here 4.
- I: the maximum current drawn by each motor, 4.2 A.
- V: the voltage required by each motor, 36 VDC.
- 1.2: the “kindness factor” — a 20% safety margin.
Therefore: P = 4 × 4.2 × 36 × 1.2 = 725.76 W
.
The total current draw at full load would be: 4 × 4.2 A = 16.8 A
.
Both the PSU output power
and output current
are
appropriate. In practice, all motors running at full current and under full
load simultaneously is rare.
In the aforementioned LinuxCNC forum thread, Mr. RodW recommended this 240V AC EMI Filter, which I was able to get from a local Jaycar store.
After a rather long learning process, I arrived at this first working wiring:
![]() |
---|
First Wiring Attempt |
I tested this wiring with the LinuxCNC PnCconf wizard, and the stepper motor responded to software commands. I then asked my friend to review it, and he suggested a better version:
![]() |
---|
Recommended Wiring Version |
💡 High-wattage PSUs such as the MEAN WELL UHP-750-36 can generate electromagnetic interference (EMI) or radio frequency interference (RFI), which may affect other components — especially in a CNC system. An external EMI filter helps reduce this side effect. This is why only the UHP-750-36 has an external filter, while the smaller MEAN WELL MDR-10-5 and MEAN WELL MDR-100-24 are used without one. All three PSUs also include internal EMI filtering, according to their block diagrams.
❸ The Emergency Stop Button, the Main Switch, and Their Cable Glands
⓵ I had never actually seen an emergency stop button by itself before. After some research, I decided on this eBay model: Push Buttons Switch 1NO + 1NC e-stop Push Button AU Emergency Stop Shut Off — it provides one Normally Open (NO) and one Normally Closed (NC) contact.
It is inexpensive, and the quality reflects the price. However, it is still usable. The terminals are not labelled NC or NO, but my friend helped me identify which pair was which.
This Instructables article:
Emergency Stop Button explains
wiring using the NC contact. I followed those instructions successfully and tested
the setup using a 240 VAC microwave fan. Unfortunately, I held the wires with
alligator clips, and vibration from the fan caused a short circuit. This blew the
main fuse and disabled about half of the outlets in my house. Luckily, with some
guidance over the phone, I was able to reset the fuse and restore power.
Lesson learned: never rely on loose clip connections for mains wiring.
This e-stop button came with a single cable gland. Since I also needed to secure the output cable, I added this 11–14 mm MG20 Black IP68 Nylon Cable Gland. It turned out visibly larger than the supplied one.
⓶ For the main switch, I chose this model:
Schneider Electric Easy 56 Switch — 1P, 10A, 250V, EY56SW110.
Although the website listed the dimensions, I overlooked them and only realised
on arrival that it is much larger than the e-stop. That said, it is very sturdy
and well built. The lower half of the casing has one large threaded opening on one
side and two smaller ones on the other, all sealed with caps. These are intended
for the incoming and outgoing cables.
To secure the cables, I purchased one POWER SOURCE PGLAND-M32 Plastic PA66 Cable Gland (18–25 mm, IP68) and two POWER SOURCE PGLAND-M25 Plastic PA66 Cable Glands (12.5–18 mm, IP68) — even though I only needed one. Aesthetically, using one large and one small gland made the switch look unbalanced and somewhat awkward.
💡 None of these glands could properly grip the standard cables I used. Even when fully tightened, the fit was too loose. As a workaround, I shimmed the cables with short lengths of cut water hose. While effective, this is not ideal.
❹ Miniature Circuit Breakers (MCB) for the PSUs
From what I have learned, choosing MCBs for power supplies involves two main requirements. First, the nominal current rating must be correct. Second, the tripping curve must suit the PSU’s inrush current at the input AC voltage.
For calculating the nominal current, I found the following references helpful:
-
Calculating Power
Supply AC Input Current — explains how to calculate the theoretical AC input
current for a PSU:
- Breaker Size Calculator and How to calculate the capacity of a circuit breaker — both emphasise applying a 25% safety margin when selecting the nominal current rating of an MCB.
For the tripping curve, this article provides a clear overview:
⓵ MCB for MEAN WELL UHP-750-36 — The datasheet specifies:
- RATED POWER: 752.4W
- VOLTAGE RANGE: 90 ~ 264VAC 127 ~ 370VDC
- POWER FACTOR (Typ.): PF≥0.95/230VAC PF≥0.98/115VAC at full load
- EFFICIENCY (Typ.): 95%
- AC CURRENT (Typ.): 7.5A/115VAC 3.8A/230VAC
- INRUSH CURRENT (Typ.): Cold start 20A @ 115VAC; 40A @ 230VAC
Therefore:
The datasheet states 3.8A at 230VAC, this is steady-state current draw.
The theoretical AC input current calculated above matches well with this value.
3.8A is the value we should use to calculate the MCB’s nominal current:
3.8 × 1.25 = 4.75A
.
The MCB for the UHP-750-36
PSU should have the following characteristics:
● A 5A or 6A MCB would be most appropriate. Both are above the continuous draw but still tight enough to protect in the event of an overload or fault. 6A offers slightly better tolerance, especially with minor surges or long cable runs. 5A offers a stricter cutoff, but may trip if the PSU is run at full continuous load.
● Type C trip curve tolerates inrushes up to 30A–60A, which safely covers the 40A inrush.
● Voltage should be 230VAC-240VAC to match the Australian standard.
✔️ I selected this RCBO: Clipsal MAX9 RCBO 1PN C 6A 30mA A SLIM - MX9R3106. An RCBO includes a MCB. For detail explanation, refer to What is the Difference between MCB, MCCB, RCB, RCD, RCCB, and RCBO? From a wiring perspective, RCBOs take both the Live and the Neutral wires.
⓶ MCB for MEAN WELL MDR-10-5 — The datasheet specifies:
- RATED POWER: 10W
- VOLTAGE RANGE: 85 ~ 264VAC 120 ~ 370VDC
- POWER FACTOR (Typ.): Not specified
- EFFICIENCY (Typ.): 77%
- AC CURRENT (Typ.): 0.33A/115VAC 0.21A/230VAC
- INRUSH CURRENT (Typ.): COLD START 35A/115VAC 70A/230VAC
The Power Factor
is not given, Theoretical Average Input Current
can not be calculated, but we do not need it anyhow, since the steady-state current
draw is available: 0.21A at 230VAC.
The MCB for the MDR-10-5
PSU should have the following characteristics:
● A 1A or 2A MCB is sufficient. 2A provides more margin and is more tolerant of transient events. Due to the high inrush current (70A), nuisance tripping is possible even with a type C device. If that occurs, a larger MCB (for example, 6A) can be used, since the PSU itself has internal protection against overloads and short circuits.
● Type C trip curve would absorb inrush current of 70A without nuisance tripping.
● Voltage should be 230VAC-240VAC to match the Australian standard.
✔️ I selected this MCB: Clipsal MAX9 MCB 1P C 2A 6000A - MX9MC102. MCBs take only the Live wire.
⓷ MCB for MEAN WELL MDR-100-24 — The datasheet specifies:
- RATED POWER: 96W
- VOLTAGE RANGE: 85 ~ 264VAC 120 ~ 370VDC
- POWER FACTOR (Typ.): PF≥0.95/230VAC PF≥0.98/115VAC at full load
- EFFICIENCY (Typ.): 86%
- AC CURRENT (Typ.): 1.3A/115VAC 0.8A/230VAC
- INRUSH CURRENT (Typ.): COLD START 30A/115VAC 60A/230VAC
✔️ I selected the same MCB as per MDR-10-5 above. As with the MDR-10-5, the inrush current (60A) is much higher than the steady-state current (0.8A), so a larger MCB may be required in practice if nuisance tripping occurs.
According to the datasheets for the MEAN WELL MDR-10-5 and MEAN WELL MDR-100-24:
Can be installed on “DIN rail TS-35/7.5 or 15
I bought the MDR-10-5
PSU from a local supplier, but they did not stock
DIN rail in the required specification. Other local suppliers had it available,
but only in 2-metre lengths—far more than I needed—and at a higher cost. Instead,
I settled on a cheaper aluminium version:
TEHAUX 3pcs DIN Rail Slotted, 12 inch Aluminum DIN Rail Mounting Electrical.
Back on 13 April 2025, it was priced at AUD 23.89. While it does not feel as sturdy as
the steel version, it should be perfectly adequate for the job.
❻ DIN Rail Terminals, DIN Rail Fuse Holder and the Main Fuse
In the same LinuxCNC forum thread, Mr. RodW recommended using DIN rail terminals. I was able to source them locally: I could check them both online and in-store, which I prefer. Here’s what I purchased:
- 4 × 35A 4mm Red DIN Rail Terminal — for the Live wires. Each terminal has two connection points, so these four blocks together can accommodate 8 live wires.
- 4 × 35A 4mm Blue DIN Rail Terminal — for the Neutral wires. Same as above, but in blue.
- 2 × 4-Way Insertion Bridge for 4mm DIN Rail Terminals — used to join each group of 4 terminals together. This leaves each group with 4 spare connection points.
- 6 × 35A 4mm Green/Yellow DIN Rail Terminal — for the Earth wires. Unlike the live/neutral blocks, these have metal clamps at the base, so the DIN rail itself acts as a natural conductor, connecting them all together as a common ground. Each terminal has two connection points, so technically I only needed three. I bought six because the salesperson didn’t know about this feature, and I didn’t bother returning the extras.
- 1 × End Cap for DIN Rail Terminals — covers the last red or blue terminal block. Not strictly necessary if an Earth block follows, but I installed one anyway.
-
1 ×
35A 4mm Grey Fused DIN Rail Terminal (P2423) —
a fuse holder for
M205
fuses. (M205 refers to 20 mm length × 5 mm diameter.) - 1 × End Cap to suit P2423 — covers the exposed side of the above fuse holder. A fuse can still be inserted with the cap on: simply lift the lever to pull out the carriage, insert the fuse, and push the lever back down. Very easy to use.
- 5 × 6.3A 5×20 (M205) 250V Fuse — the store did not stock 6A M205 fuses. These are also fast-blow, while I should really be using slow-blow (time-delay) fuses.
💡 Why a 6A Fuse?
As described previously, the typical AC input currents for each PSU are:
- MDR-10-5: 0.21 A
- MDR-100-24: 0.8 A
- UHP-750-36: 3.8 A
Together, that adds up to 4.81 A. Adding a 25% safety margin brings it to about 6.01 A.
The image below shows my first working attempt at wiring everything together:
![]() |
---|
First Working Attempt |
By working, I mean that I tested this wiring using the Linux PnCconf, and the stepper motor responded to software commands. I also asked a friend to review the setup, and he recommended adding a main fuse as described here. The revised wiring is shown below:
![]() |
---|
An Improved Version |
In fact, this was the wiring in place when I tested the contactor as described in the last post: Raspberry Pi 4B LinuxCNC: Wiring the Mesa 7I96S Card and a Contactor to Control a Grinder/Router via the LinuxCNC Application.
❽ Adding Secondary Switches to Control Each PSU Independently
The RCBO and MCBs previously discussed each have an on/off switch, which could be used to control their respective PSUs. However, that’s not their intended purpose. I’d prefer to install dedicated switches for this function. While not strictly necessary, it would be a nice addition. I haven’t purchased the switches yet, and the wiring remains unchanged from the last image above.
This is the switch I have in mind: DPST 16A IP65 Weatherproof Rocker Switch. It’s available at a nearby store, which saves on delivery fees, and the pricing is quite reasonable. I’ve revised the previous wiring picture into four smaller, focused images.
💥 For the switch above, I’m not yet certain which terminals correspond to Live and which to Neutral. In the following images, please treat the switch connections as illustrative only—not technically precise.
![]() |
---|
From AC Inlet to DIN Rail Terminal Blocks |
The image above shows the connection from the AC inlet to the DIN rail terminal blocks, with an inset illustrating the wiring between the emergency stop and the main switch.
![]() |
---|
Wiring of the MEAN WELL UHP-750-36 PSU |
![]() |
---|
Wiring of the MEAN WELL MDR-100-24 PSU |
![]() |
---|
Wiring of the MEAN WELL MDR-10-5 PSU. |
❾ It has taken me several months—though not full-time—to learn and assemble this wiring setup. I’m not yet certain how well it performs in a real-world scenario, but so far, it behaves as expected. I’ll post updates whenever there’s something meaningful to document.
Although the title of this post is “Raspberry Pi 4B LinuxCNC: Main Power Distribution (Wiring),” it should be clear that the wiring described here isn’t specific to the Raspberry Pi 4B. This same setup can be used with any computer running LinuxCNC.
If you’ve taken the time to read this post—thank you. I hope it was worth your time. Stay safe out there.
✿✿✿
Feature image source:
- https://www.instructables.com/Easy-Raspberry-Pi-Based-ScreensaverSlideshow-for-E/
- https://store.mesanet.com/index.php?route=product/product&product_id=374
- https://forum.linuxcnc.org/show-your-stuff/32672-linuxcnc-logo?start=20#gallery-6