<p>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.</p>

<p>I'm planning to use them with NanoDLP on Raspberry + GRBL on Arduino.</p>

<p>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?</p>

<p>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.</p>

<p>Is there a way to do it?</p>

[{'answer_id': 4997, 'author': 'Franco Cicero', 'author_id': 9082, 'author_profile': 'https://3dprinting.stackexchange.com/users/9082', 'pm_score': -1, 'selected': False, 'text': "<p>I think you don't have to use the Arduino. There´s an option in NanoDLP to control the z-axis through the Raspberry GPIO.</p>\n"}, {'answer_id': 5021, 'author': 'Seen Green', 'author_id': 9115, 'author_profile': 'https://3dprinting.stackexchange.com/users/9115', 'pm_score': -1, 'selected': False, 'text': '<p>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.</p>\n\n<p>More info here: <a href="http://www.buildyourownsla.com/forum/viewtopic.php?t=3772" rel="nofollow noreferrer">http://www.buildyourownsla.com/forum/viewtopic.php?t=3772</a></p>\n\n<p>You should really control the LEDs using a mosfet, or even a solid state relay and not just keep them on all the time. The lights should ideally switch on and off for each layer.</p>\n'}, {'answer_id': 7173, 'author': 'towe', 'author_id': 13171, 'author_profile': 'https://3dprinting.stackexchange.com/users/13171', 'pm_score': 2, 'selected': False, 'text': '<p>I have no experience with either GRBL or DLP printers, but the</p>\n\n<pre><code>M7\nM8\nM9\n</code></pre>\n\n<p>coolant control codes should be able to be sent by NanoDLP to GRBL. Those seem to allow for direct digital output.\nApparently you can set the pin you want them to use in the <code>cpu_map.h</code> file, with the standard being Analog Pins 3 and 4 for the M8 and M7 commands respectively.</p>\n\n<pre><code>// Define flood and mist coolant enable output pins. \n#define COOLANT_FLOOD_DDR   DDRC \n#define COOLANT_FLOOD_PORT  PORTC \n#define COOLANT_FLOOD_BIT   3  // Uno Analog Pin 3 \n#define COOLANT_MIST_DDR   DDRC \n#define COOLANT_MIST_PORT  PORTC \n#define COOLANT_MIST_BIT   4  // Uno Analog Pin 4 \n</code></pre>\n\n<p>Hope this helps!\nSource: <a href="https://github.com/gnea/grbl" rel="nofollow noreferrer">https://github.com/gnea/grbl</a></p>\n'}]
['https://3dprinting.stackexchange.com/questions/4646', 'https://3dprinting.stackexchange.com', 'https://3dprinting.stackexchange.com/users/5317/']