Welcome! Log In Create A New Profile


DIY miniature OLED controller with SPI interface.

Posted by Blackplasma 
DIY miniature OLED controller with SPI interface.
August 04, 2019 12:56PM
Hi Guys,

I was originally inspired by Enifs post about a DIY OLED controller working off I2C.

I have an Ender3 running off a MKS GEN L motherboard with the TFT32 touch screen interface but i liked the original controller and wanted to bring it back but as a much smaller OLED version. Enifs post was almost perfect, i dont want the SD card reader or a beeper, just the encoder and a screen but the issue is that there are no I2C pin headers on the GEN L so i needed to find another solution.
MKS offer an OLED controller but it has an SD card reader, is a little more bulky than i had wanted and i was having issues finding where to buy it from so i started looking in to this as a DIY build project.

Parts list.


Printed enclosure.

6 M3 bolts
6 M3 threaded inserts
10 pin EXT1 cable

Assemble the wiring loom as follows.

My encoder had 3 resistors soldered on to the rear, bridging between the CLK pin and the rotation direction pins. I removed the top and bottom one to resolve the unusual encoder behaviour.
Perhaps there is a better encoder to use out there but i wanted one pre-mounted to a board and i got it working without too much issue.

Define MKS_12864OLED as your controller

*Pins_RAMPS.h (may vary for your board)
#define LCD_PINS_DC 25 // Set as output on init
#define LCD_PINS_RS 27 // Pull low for 1s to init
// DOGM SPI LCD Support
#define DOGLCD_CS 16
#define DOGLCD_MOSI 17
#define DOGLCD_SCK 23
#define LCD_PINS_RS 16
#define LCD_PINS_ENABLE 17
#define LCD_PINS_D4 23
#define LCD_PINS_D5 25
#define LCD_PINS_D6 27

#define LCD_PINS_D7 29 CHANGE TO 33

#define BEEPER_PIN 37 CHANGE TO 31

#define BTN_EN1 17
#define BTN_EN2 23
#define BTN_EN1 31 CHANGE TO 37
#define BTN_EN2 33 CHANGE TO 29

#define BTN_ENC 35
#define SD_DETECT_PIN 49
#define KILL_PIN 41

Edited 1 time(s). Last edit at 08/04/2019 01:01PM by Blackplasma.
Re: DIY miniature OLED controller with SPI interface.
August 07, 2019 03:51PM
Looks good... I am building a smaller printer so thought why not use a tiny screen... After some google... I found this post and Enifs posts using a tiny OLED screen. Perfect!! Curious if you plan on posting a link to Thingiverse or your STL files for printing? I'd like to take a closer look at your design if you planned on sharing, if not, that's cool too.
Re: DIY miniature OLED controller with SPI interface.
August 14, 2019 06:49PM
Nice work. I like to see useful projects like this.


Kits: Folgertech Kossel 2020 upgraded E3Dv6, Anet A8 upgraded E3Dv6, Tevo Tarantula enhanced parts and dual-head, TronXY X5SA Pro(E3DHemera).
Scratch: Large bed Cartesian, exchangeable heads, Linear slide Delta, Maker-Beam XL Micro Delta, 220x220CoreXY.
Re: DIY miniature OLED controller with SPI interface.
February 12, 2021 02:45AM
I have a stock Ender 3 with the 4.2.2 board, and wanted to make this work. I figured out the pin layout of the lcd cable after a lot of fiddling, and was able to make the display work with Klipper firmware's software SPI. I'll try and get it to work with Marlin, but I don't have high hopes there.

Thank you for the inspiration.
open | download - Untitled Diagram.png (4 KB)
Sorry, only registered users may post in this forum.

Click here to login