Introduction: Converting 12v/24v Power Supply to Remote (G-code) Switching
This Instructable shows you how to remotely switch your 12v or 24v power supply, using G-Code or by adding buttons in Pronterface. The process voids the warranty on the power supply, but they are only around $25 so not the end of the world if it dies, right?
This projects should cost less than $5.00!
A necessary word of caution: During this conversion, you will be modifying the power supply by relocating the line-side fuse, which requires some confidence in soldering and common sense. If you follow the instructions carefully, the process is easy and only takes around a half-hour.
You will need the following parts and tools:
- Soldering iron
- #2 Phillips screwdriver
- 1/8" flat screwdriver
- Heat gun or lighter
- 3/16" heat shrink tubing
- 18ga. stranded wire
- 3- or 4-conductor 24ga cable (I used a stranded telephone wire)
- 1/4" thick self-adhesive rubber feet (purchased mine at Lowe's)
- Dupont connectors: two female 1x1 and three female 1x2
- 5v relay module (search eBay for "Arduino relay module")
Before you begin, get all these things together and unplug the power supply from the wall.
As with any project, you must exercise care and diligence. I cannot be responsible for any damage or failure due to these instructions. I have performed this modification and have had zero problems.
Step 1: Open the Power Supply and Remove the Circuit Board
Disconnect the power supply from the wall outlet. (...just in case you didn't already!!)
- Disconnect the power cord wiring and the 12v (or 24v) wiring from the power supply terminals. Keep track of where they go so you can put them back later!
- Remove the six Phillips screws along the lid of the power supply. Do not remove the screws from the fan.
- Remove the cover and unplug the fan from the board. (You will need to cut the "inspected" label)
- Remove the center screw from each of the two heat sinks, holding the bracket so it will not turn or fall onto the board.
- Remove the two remaining screws from each heat sink and life the aluminum out of the chassis, making sure not to detach the rubber insulator. (Careful not to touch the heat sink compound or it will get all over the place!)
- Remove the five Phillips screws from the circuit board. (one on each corner and one in the middle)
- Remove the circuit board from the chassis.
The fuse is located right beside the L terminal, where the AC hot wire goes (see photo)
Step 2: Remove the Fuse
Now we'll remove the fuse. Be careful not to damage it as it will be needed later!
- Flip the board over and locate the two leads that are attached to the fuse and heat them to allow removal of the fuse. Either desolder them with solder wick or a vacuum tool, or melt one end at a time while lifting the fuse away from the other side of the board. DO NOT use your fingers or you will get burned!!
- Strip and tin each end of a short length (6-8 inches) of 18ga stranded wire. (I used left-over wiring from my hot end heater!)
- Solder the ends of the wire into the two holes where the fuse was removed.
Step 3: Put the Fuse Back in the Circuit
- Cut the wire approximately 1-1/2" from the circuit board on the side that is near the screw terminals.
- Strip and tin the ends of the wire where you just cut it.
- Solder the ends to the fuse as shown, making sure NOT to hold the fuse with your fingers while soldering it.
- Cut the wire in the middle, so that each end is the same distance from the circuit board.
- Slide two piece of 3/16" heat shrink tubing on the fused wire to insulate the fuse as shown. Apply heat to shrink the tubing.
Step 4: Prepare the Wire for Connection to the Relay
- Route the two wires away from the screw terminals, cutting them both even with the black component marked BD1 on the board, as pictured.
- Strip and tin the ends of the wires.
Not that I used another small piece of heat shrink tubing to keep the wires together. This is not necessary, but keeps the wiring tidy.
Step 5: Prepare and Connect the Relay
- Apply two self-adhesive rubber feet to the bottom of the relay module, to serve as a spacer and to keep the solder side of the module from shorting against anything.
- Locate the relay module on top of the black component (BD1) and the neighboring capacitor (C10).
- Connect the two wires to the COMMON and NORMALLY-OPEN terminals on the relay module.
- Prepare the relay control wiring by installing female Dupont connectors as pictured. If you are using a single-relay module, you will only use three wires. Make sure to cut the unused wire out of the cable, or fold it back onto the cable and insulate it.
- Connect the relay control wiring to the pin header on the relay. I bent the pin header over some to ensure that the wiring would not be pinched by the chassis cover. (pictured on the next step)
Note here that I used a relay module with two relays. This is because I didn't have a single-relay module on hand. I simply left the second relay screw terminals vacant. I'll either use it later or replace this module with a single-relay module at some point.
- A single-relay module requires three wires: 5v, GND and signal
- A two-relay module (as pictured) uses four wires: 5v, GND, signal 1 and signal 2.
Also, I made a point to connect the fused wire to the normally-open terminal and the non-fused wire to the common terminal. This is a small safety measure that prevents the normally-closed terminal from being powered when the relay is not energized. You can connect the wires either way, as long as you use common and normally-open.
Step 6: Reinstall the Circuit Board
- Place the circuit board back into the chassis, making sure that none of the new wiring is pinched or routed beneath the board.
- Place the two aluminum blocks back between the components and the chassis, making sure that the rubber insulators are touching the components, NOT the chassis. Reinstall the four Phillips head screws to secure the heat sinks.
- Hold the heat sink brackets and loosely reinstall the two long screws. Do not tighten them yet.
- Reinstall the five Phillips screws in the circuit board (one in each corner and one in the middle)
- Tighten the two heat sink bracket screws.
- Route the control wiring out of the chassis, exiting near the power LED and voltage adjustment pot.
- Plug the fan back in and reinstall the cover.
The cover will fit tight over the relay module due to the rubber feet serving as spacers.
Step 7: Connect the Wiring
- Reconnect the power cord wiring and the 12v (or 24v) output wiring to the power supply.
- Cut the control wiring long enough to reach the Ramps board. I secured my wiring to the 12v wiring thar goes from the power supply to the ramps board.
- Install Dupont connectors to the other end of the control wiring as shown. (Again, I used a two-relay module so I had four wires. If using a single-relay module, you will only have three due to not having the fourth one connected to the module.)
- Connect the power terminals (mine are 5v=red and GND=black) to the servo power and ground terminals as shown. (make sure your polarity is correct or the module will not work)
- Connect the control wire (mine is green) to the PS-ON pin, right beside the reset button.
That's it! The wiring is complete. Now to test your work...
Step 8: Test Your Work
Now the moment of truth.
If you followed the instructions, insulated the fuse properly, and installed the heat sink insulators correctly you may now plug the power cord into the wall outlet or power strip. Don't worry if the power supply doesn't come on - it is not supposed to.
Re-confirm that everything is connected and connect to your printer in your host application (Pronterface, Repetier, etc.) so you can pass G-Code commands to it. If the power supply comes on when you open your application, that's okay.
- At the G-Code prompt, type M80
This turns on the relay module, resulting in a click and the power supply should come on. (...it may already be on)
- Type M81
This turns off the relay module, resulting in another click and the power supply should go off.
If there is a problem, recheck your wiring and confirm whether the relay module is clicking when passing the M80/M81 commands.
I added buttons in Pronterface to evoke the commands, as pictured.
Googliola made it!