There are several options to turn your printer off with a relais to cut of the power supply after a print is finished. For all solutions you need to do a re-cabeling of your printer. I was searching for a solution to turn my printer off after a print just with some minor cabeling and easy to remove.
This solution is only working in case you already have a home automation system. I am using ioBroker, but FHEM, openHAB, HASS and whatever should work as well.
What is needed:
- Wifi power switch connected to home automation system (in my case Gosung SP1 flashed with Tasmota)
- ESP8266 (I used convenient Wemos D1 mini)
- 2 resistors for a voltage devider)
- small wire, connector, PCB to layout the circuit
- modified Marlin version
I used a Wemos D1 mini, flashed it with Tasmota and powered the Wemos with the 5V of my MKS Gen L (Ramps works just also fine). I then connected Pin 4 of the Servo1 Port of the MKS Gen L to the input D4 on Wemos. But here you need to watch out as the digital Pins of MKS Gen L or Ramps boards are also giving 5V and the ESP/Wemos most probably are not safe for 5V digital input. Therefore I connected the pin with a voltage devider to make ~3,3V out of the 5V. You can use 1k ohms plus 2,2 k ohms. I did not have the correct values at home so i used 6,5 k ohms and 12 k ohms, which also works find to get 3,2V out.
I printed a nice enclosure for my Wemos circuit, made a connection cable and connected it to MKS Gen L on the D4 port together with VCC and GND.
Marlin has to be modified to us the PS_on Pin as Pin 4. So after a print in your slicer you have do modify the end script and as last command give out "M81" to close the printer.
PS_on Pin will be setup in pin_ramps.h
In my home automation system ioBroker I just created a small script that in case the state of the switch from Wemos D1 changed to power off, then the wifi switch will switch off the complete printer with a time delay of 6 minutes to keep the printer cool down with the running fans in this 6 minutes.
For any question feel free to comment.