# Managing LEDs with NanoDLP

I'm building my own DLP printer with UV LEDs. I use a 20A relay to power them on, since they require high power and can't be directly driven by arduino or Raspberry.

I'm planning to use them with NanoDLP on Raspberry + GRBL on Arduino.

Is it possible to make NanoDLP tell GRBL to power on (send digital 1/+5V) the relay when the print starts and power it off (send digital 0/GND) when the print ends?

The other way would be to just install an on/off switch and do it manually, but I feel this step should be automated somehow.

Is there a way to do it?

• why not you use commands on and off, for example: extruder, heatbed, fan etc. – Fernando Baltazar Sep 29 '17 at 17:01
• @FernandoBaltazar AFAIK GRBL is a CNC host software, it doesn't have extruder, nor heatbed, nor fan I suppose. – BackSlash Sep 29 '17 at 17:05
• So, this have an spindle control, Cooler, and so on. – Fernando Baltazar Sep 29 '17 at 17:07

I have no experience with either GRBL or DLP printers, but the

M7
M8
M9


coolant control codes should be able to be sent by NanoDLP to GRBL. Those seem to allow for direct digital output. Apparently you can set the pin you want them to use in the cpu_map.h file, with the standard being Analog Pins 3 and 4 for the M8 and M7 commands respectively.

// Define flood and mist coolant enable output pins.
#define COOLANT_FLOOD_DDR   DDRC
#define COOLANT_FLOOD_PORT  PORTC
#define COOLANT_FLOOD_BIT   3  // Uno Analog Pin 3
#define COOLANT_MIST_DDR   DDRC
#define COOLANT_MIST_PORT  PORTC
#define COOLANT_MIST_BIT   4  // Uno Analog Pin 4


Hope this helps! Source: https://github.com/gnea/grbl

Franco Cicero is completely correct there is an option to control your printer by using the GPIO of the Raspi. To do this you still need a stepper driver motor or some interface between the GPIO and the steppers/LED/etc.