May 15, 2019
Description
Based on Raspberry Pi 3B and Octoprint
Because my printer lives inside thermal box LCD and power supply moved to the wall, i decide add more control to my printer (for example turn off bright LED strip from phone app when go to sleep) and couple safety features to prevent printer be ON after print end.
It can separately control printer power supply, print bed light, LCD back-light and more.
Gap on LAN port fixed in stl and f3d files.
Most materials you may already have if you interest in DIY
I use Thyristor because relay can stuck and left power supply always ON
| Name | Pin | GPIO | API ID | Use |
|---|---|---|---|---|
| LED1 | 35 | 19 | Act LED (not in plugin) | |
| LED2 | 33 | 13 | 3 | Test LED |
| Key1 | 32 | 12 | Cancel Pulled down (R10K) | |
| Key2 | 36 | 16 | PSU ON Pulled down (R10K) | |
| Key3 | 29 | 5 | Heat Pulled down (R10K) | |
| Key4 | 31 | 6 | Light Pulled down (R10K) | |
| PSU | 7 | 4 | Printer thyristor | |
| Relay1 | 11 | 17 | 2 | Print bed LED light |
| Relay2 | 13 | 27 | 4 | --- |
| LCDBacklight | 15 | 22 | 1 | LCD Backlight Optocoupler |
Button 1 - Cancel current job
Button 2 - Turn ON Power supply
Button 3 - Heat tool to 240C (to change filament after printer start)
Button 4 - Switch print bed light (24v LED strip)
Nice video about plugins: The best Octoprint Plugins by Teaching Tech
LED1 used as SD ACT LED (green on Pi board), simple way to make this work:
ssh [email protected].*** (Octoprint server, user: pi, password: raspberry)
sudo -s (get root shell)
echo "# Use external LED as SD ACT LED" >> /boot/config.txt
echo "dtoverlay=pi3-act-led,gpio=19" >> /boot/config.txt
echo " " >> /boot/config.txt
reboot
Shell line to power ON PSU:
curl -s -H "Content-Type: application/json" -H "X-Api-Key: API_KEY_HERE" -X POST -d '{ "command":"turnPSUOn" }' http://127.0.0.1/api/plugin/psucontrol
URLs to control Enclosure Plugin from other device (i use Printoid app on my phone)
http://192.168.1.***/plugin/enclosure/setIO?status=**{STATUS}**&index_id=**{OUTPUT_ID}**&apikey=**{APIKEY}**
OUTPUT_ID is the automatic generated number id from octoprint-enclosure setting
STATUS is can be true to turn it on and false to turn the output off
To control LCD Backlight i move one resistor on display and put Optocoupler in line.
To prevent printer get power from Pi i just put strip of electrical tape inside USB plug of cable that connects to printer on + contact.
As size reference i used this model of Raspberry Pi 3B by Kevin Schneider
Fusion 360 source included.
####Update 2020-02-11:
Plugin "Cancel Objects" is not working properly (after cancel one object it mess up all print), i replace it with plugin "Exclude Region" it work nice.
Add pause to change filament script
####Update 2023-07-18:
Change PowerOn Key to pin 36 (GPIO 16) because now pin 40 GPIO 21 is used by PCM to provide a data output signal to an external audio device such as a DAC chip.
Change Cancel Key to pin 32 (GPIO 12) because now pin 38 GPIO 20 is used by PCM to input data from an I2S audio device, such as a microphone.
License:
Creative Commons - Attribution - Non-Commercial