|Attaching a LCD display and Rotary Encoder to a RAMPS Controlled RepRap Printer|
I have been more than a little quiet on the website, mostly because of the birth of my son and the busy busy lifestyle that goes alongside such an event. However that does not mean that my soldering iron has been allowed to go rusty. For the last few months I have been busy building a RepRap 3D printer. This is a popular project these days and one that has been rewarding and challenging to me.
The printer that I opted to build was the Prusa Mendel, named as such in recognition of the designers. Building the printer is a story for another article, but in this I want to show you how to add a LCD/Rotary Encoder based control panel to the printer.
Now adding front panels to 3D printers is not new. In fact the UltiMaker owners have had this option for a while using the Marlin software. Other 3D printers have got front end controls as well. I wanted the same for my humble RepRap but options were a little thin on the ground. By this time I had already found that i could get very good results using the Marlin firmware with the popular RAMPS 1.3 electronics (An Arduino Mega based solution) and I didn’t want to change firmware, especially as Marlin was already working with LCD based control panels on the Ultimaker electronics.
For a while i was satisfied using just a SD card and software on my netbook to print, but the thought of a standalone 3D printer (no PC required) was tempting me. Eventually enough was enough and I hacked together a front panel and wired it to my printer.
Getting this to work in a satisfactory manner took a couple of goes and some tweaking of the Marlin firmware. But because of Marlins open sourced nature, this was not only easy to do, but also gave me an opportunity in my own small way to contribute to the evolution of the Marlin Firmware (and i do mean a humble contribution). The code that I added has now been merged into the Marlin firmware and can be downloaded from GitHub here.
If you have read this far, you are probably interested in how to wire up a panel, so here we go.
On the right is a wiring diagram which represents the connections to the RAMPS AUX-4 Port. There are three components attached, a HD44780 based display (20*4 is best), a cheap ,mechanical rotary encoder and optionally a piezo buzzer capable of operating from a 5v signal. The buzzer is very much optional as the click action of the rotary encoder provides sufficient feedback for normal operation.
The Rotary encoder is one of the cheapest ALPS clones that you can acquire from e-bay. These are 20 step mechanical encoders with a push to close selector switch. It is not a high quality item, but for this kind of duty is perfect for our needs.
On one side is three pins (the middle being ground) which allow the Arduino processor to recognise the twist of the encoder knob. On the other side are two pins which are attached internally to the momentary contact switch.
The wiring is pretty simple in electronics terms and a lot can be done point to point or in my case I used some strip board.
The front panel is one that I made up for myself on my printer. I will post the design files on Thingiverse and link to them in time.
One problem that i did experience is that the UltiMaker panel that I was trying to emulate used an SD card that was capable of detecting if a card was inserted or not. On detection Marlin reinitialises the SD card, allowing you to see the files. If you are using the SD RAMPS SD card or one of the cheap SD card modules available on E-bay this feature may not exist. I redesigned the front end menus in Marlin so that if under the pins.h file there is no pin assigned to detecting the SD card then using the refresh command would reinitialise the SD card.
Printing standalone using a front panel offers many advantages over using an attached computer, not least being that you can use your PC somewhere else in the house. The main advantage for me though is not worrying about my PC’s power management cutting in halfway through a long print.
This article is a bit of a work in progress. i will add to it as I refine things further. I know a few 3D printer owners are interested in this feature, so I thought I would share first and tidy up later! Thank you for your patience.