RepRap 3D Printer - Prusa i3 - Build Log: Part 4

Wiring and Installation of Electronics

Now that all the hardware is essentially in place, we can wire everything up. The wiring is relatively simple. I completed my wiring and made sure everything worked, then went back and made it look [more] pretty with braided sleeves and heat shrink.

Start by attaching the Arduino Mega 2560 to the frame. I used four M3x25mm bolts with nuts as shown. The nuts lock the Arduino onto the bolts, but aren't tight enough to stop the bolts from rotating.
M3x25mm bolts in Arduino Mega 2560.
The bolts screw into the pre-drilled holes in the frame (which I then tapped with an M3 thread).
Arduino bolted to frame.
Next prepare your RAMPS board. My board came pre soldered and fully assembled, but some boards require assembly. There are tons of great guides on how to assemble a RAMPS board (like this one, or this one). My board did require the stepper driver jumpers to be installed. The normal setup for Pololu A4988 driver is 1/16 microstepping and this requires three jumpers to be installed under each driver.
RAMPS 1.4 board with stepper driver jumpers (labeled 1,2 & 3) installed.
Next the stepper drivers can be installed. Note, the orientation - don't get them reversed!

I have five drivers, so that I can have dual extruders if I wish at a later stage. If you only have four drives, don't install the E1 driver (top right as shown).
A4988 drivers installed in RAMPS board.
Now is the time to install the heat sinks on the stepper drivers. I, however, don't currently have any thermal adhesive, so I will install my heat sinks at a later stage.

Now plug the RAMPS board into the Arduino. It will only fit one way.
RAMPS plugged into the Arduino.
Now prepare your LCD screen. If you don't have one, no problems, just skip this step. My LCD is the RepRapDiscount Smart Controller (which is actually awesome). Plug the ribbon cables into the LCD and then into the adapter. Plug the adapter into the RAMPS as shown.

LCD screen with ribbon cables and adapter.
Adapter  plugged into RAMPS.
The wiring for the RAMPS is quite simple, and is outlined as shown below.
RAMPS wiring schematic. Derivative of work by BotBuilder Schematic. Liscence CC BY SA.
Start by plugging in the Stepper Motors as shown in the schematic. The orientation of the 4-pin connector doesn't matter, and if you get it the wrong way, the motor will simply go backwards. Once you get the motors running, you can then either reverse the connection, or invert the motor in the firmware.

To keep track of which motor is which, I used same tape to mark the wires.
Stepper motors plugged into RAMPS board.
Next plug in the Thermistors. The Extruder Thermistor goes in the T0 position and the Heat Bed Thermistor goes in the T1 position. The orientation of the Thermistors don't matter - they're in effect resistors, and current can flow through them in either direction.
Heat Bed and Extruder Thermistors plugged into RAMPS.
Now plug in the End Stops. If you have Mechanical Endstops v1.2 like me then THE ORIENTATION IS VERY IMPORTANT. There have been lots of reports of smoking Arduinos due to incorrectly wired endstops.

RAMPS 1.4 pin layout for endstops.
Mechanical Endstop v1.2 pin layout. GNU-GPL v3
As you can see the Mechanical Endstop v1.2 has four pins, while the RAMPS 1.4 has three. To overcome this I soldered a four pin cable to a three pin cable out of my wiring kit. Then I removed one of the unnecessary Ground cables from the four pin set. Make sure the cables will connect VCC-VCC, Ground - Ground, and Signal - Signal.
My Endstop cable. Three pin to Four pin.
Because my Endstops were positioned at the axis minimums, I used the minimum pins for each axis on the RAMPS.
Endstops plugged into RAMPS.
Now wire in the Heat Bed and Extruder Power Resistor into D8 and D10 respectively. Since these are resistors, the direction of current flow doesn't matter - they can be wired in either direction.
Heat Bed and Extruder Power Resistor wired into RAMPS.

Power Supply Wiring

I used an old ATX power supply which I salvaged from my local Hackspace. The power supply must be able to provide 5A at 12v for the steppers and Arduino, and 11A at 12v for the Heated Bed. The supply I salvaged was rated for 18A at 12v.
My power supply was rated for 18A at 12v.
The wiring is quite simple. The 12v lines are always yellow, these are the ones you want. See pinout diagram.
ATX pinout. By ZachSmith, GNU FDL license. 
The easiest way to get the 12v lines is to use the 4 pin Molex connector. Some power supplies have two, so you can use both of them. My power supply only had one 4-pin Molex, so I used some 12v lines from the peripheral connectors.

In general you need at least two 12v cables for each power supply channel on the RAMPS. i.e. the 5A channel requires 2 wires and the 11A channel requires at least two wires.

Cut off the appropriate connectors and strip the wires. Safe any unused wires, by insulating the cut ends with heat shrink or electrical tape. Then fix the wires into place, taking care not to expose and bare wiring. If it short circuits, your gana have a bad day.

Connectors removed and 12v and ground wires stripped.
Wires in RAMPS board. Note wires are doubled up.
Now to get the power supply working, you need to tell the PS_on signal to power on. Install a short piece of wire, or paper clip, or whatever really between to PS_on wire (the green wire on the Main power connector) and a Ground wire (any black wire).
PS_on wired to ground.
Some power supplies aren't happy unless there is a load on the 5v rail. If your power supply wont turn on, or unexpectedly turns off, try adding a load.