Ramps 1.4 Marlin Digital Outputs

I would like to be able to control multiple relays, perhaps 3 or 4 to turn on and off different devices I have within my machine (such as LEDs, lamps, DC motors, etc.) The relays only require a 5V logic HIGH or LOW. Are there any open pins that I can pull from and toggle on and off with GCODE commands?

I have an MPCNC and spindle setup. Currently, to toggle the relay for the spindle I use M106 to toggle the D9 terminal on the Ramps board. I cannot seem to understand how to access any other switchable pins.

Any help would be appreciated.

You don’t need pwm, so almost any pins can be used. If you have it enabled, M42 can already set most pins. Things like the extra endstops are good. If you aren’t using all drivers, you can use the step enable, dir pins from the extra socket. You will need to look at the schematic to find which pin number corresponds to which pin on the ramps.

1 Like

Okay I see. Do the pin numbers that I write to correspond to the MEGA board pins? So if I want to utilize the Y max endstop pin as an aux output, I would use that as pin 15, correct? So i would write the GCODE as M42 P15.

I’m pretty sure that is right. It would only take a minute with a multimeter to confirm that.

1 Like

You may have already seen it, but I find this pinout diagram a good source for finding the mapping for Ramps 1.4 pins.

1 Like