├── Arduino VFD.fzz ├── Arduino VFD_bb.jpg ├── Epson-DMD110 └── Epson-DMD110.ino ├── EpsonCmdSet.pdf ├── MAX3232-TTL-To-RS232-Serial-Communication-Converter-Module-Jumper-Cable-02.jpg ├── README.md ├── RJ45 Breakout_bb.png ├── RJ45 Breakout_bb.svg ├── UA0-DM-D110_TechRef.pdf └── epson-dm-d110.png /Arduino VFD.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/playfultechnology/arduino-VFD-RS232/b7fcde58430896d9e78f4914d5e60c9d3969caa8/Arduino VFD.fzz -------------------------------------------------------------------------------- /Arduino VFD_bb.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/playfultechnology/arduino-VFD-RS232/b7fcde58430896d9e78f4914d5e60c9d3969caa8/Arduino VFD_bb.jpg -------------------------------------------------------------------------------- /Epson-DMD110/Epson-DMD110.ino: -------------------------------------------------------------------------------- 1 | /** 2 | * Code to control an Epson DM-D110 Vacuum Fluorescent Display (VFD), 3 | * as often used as till displays and other Point-Of-Sale devices. 4 | * 5 | * This is a 12V, 20 character x 2 line display, that uses the RS232 serial interface 6 | * Datasheet can be found at https://files.support.epson.com/pdf/pos/bulk/d110u_e_3.pdf 7 | * 8 | * Sending data over RS-232 interface is somewhat similar to Serial connection used by 9 | * Arduino, but has inverted logic, and biased to voltages between -5 and -15V (Logic "1", or "Mark") 10 | * and between +5V and +15V (Logic "0", or "Space"). 11 | * Thus, some additional hardware is required to convert the serial output from the Arduino GPIO pins 12 | * One example is shown here: https://sites.google.com/site/whitej/arduinoextras 13 | * However, a much simpler solution is to use an RS232-TTl convertor based on the MAX3232 chip, such as 14 | * https://www.ebay.co.uk/itm/264813352756 15 | * 16 | * The pinout of the D110 is exposed via an RJ45 connector, with pinout as follows: 17 | * 1 FG - Frame ground 18 | * 2 TXD - Output 19 | * 3 RXD - Input Receives data from the computer. 20 | * 4 DSR - Input Indicates whether the computer/TM printer is ready to receive data (SPACE = Ready, MARK = Not Ready) 21 | * 5 RTS - Output This indicates whether the display is ready to receive data. *2 22 | * 6 SG - Signal GND 23 | * 7 PS - Power supply terminal 24 | * 8 PG - Return wire for power 25 | * 26 | * Pin1, 6 and 8 should be connected to GND, Pin7 to +12V, and Pin 3 to the output from the MAX3232. 27 | * 28 | * */ 29 | 30 | // INCLUDES 31 | // https://www.pjrc.com/teensy/td_libs_AltSoftSerial.html 32 | #include 33 | 34 | // GLOBALS 35 | // AltSoftSerial constructor takes no parameters, and always uses these pins: 36 | // Board Transmit Receive PWM Unusable 37 | // ----- -------- ------- ------------ 38 | // Teensy 3.0 & 3.1 21 20 22 39 | // Teensy 2.0 9 10 (none) 40 | // Teensy++ 2.0 25 4 26, 27 41 | // Arduino Uno 9 8 10 42 | // Arduino Leonardo 5 13 (none) 43 | // Arduino Mega 46 48 44, 45 44 | // Wiring-S 5 6 4 45 | // Sanguino 13 14 12 46 | AltSoftSerial altSerial; 47 | 48 | // HELPER FUNCTIONS 49 | // These are ESC/POS commands as defined in https://github.com/playfultechnology/arduino-VFD-RS232/blob/main/EpsonCmdSet.pdf 50 | /* 51 | * Moves cursor to specified position 52 | * Note that values are 1-indexed, not 0-indexed, so first character of bottom row is (1,2) 53 | */ 54 | void SetCursor(byte column, byte row){ 55 | altSerial.write(0x1F); 56 | altSerial.write(0x24); 57 | altSerial.write(column); 58 | altSerial.write(row); 59 | } 60 | 61 | void Initialise(){ 62 | altSerial.write(0x1B); 63 | altSerial.write(0x40); 64 | } 65 | 66 | void Clear(){ 67 | altSerial.write(0x0C); 68 | } 69 | 70 | void ClearCursorLine(){ 71 | altSerial.write(0x18); 72 | } 73 | 74 | void CursorOn() { 75 | altSerial.write(0x1F); 76 | altSerial.write(0x43); 77 | altSerial.write(0x01); 78 | } 79 | 80 | void CursorOff() { 81 | altSerial.write(0x1F); 82 | altSerial.write(0x43); 83 | altSerial.write((byte)0x00); 84 | } 85 | 86 | void CursorHome() { 87 | altSerial.write(0x0B); 88 | } 89 | 90 | void SelfTest() { 91 | altSerial.write(0x1F); 92 | altSerial.write(0x40); 93 | } 94 | 95 | void DisplayTime(){ 96 | // From p.36 of http://support.j2rs.com/Documents/OldDocs/VFD%20Pole%20Display.pdf 97 | altSerial.write(0x1F); 98 | altSerial.write(0x55); 99 | } 100 | 101 | void setup() { 102 | // Serial connection to PC 103 | Serial.begin(9600); 104 | Serial.println(__FILE__ __DATE__); 105 | 106 | // Initialise pins used for connection to VFD (via Max3232) 107 | pinMode(8, INPUT); // Rx (not used) 108 | pinMode(9, OUTPUT); // Tx 109 | 110 | // Start the software serial emulation on the pins above 111 | // Make sure to use the baud rate set using the dip switches on the display (normally 9600 default) 112 | altSerial.begin(9600); 113 | 114 | // Initialise the display 115 | Initialise(); 116 | // Clear screen 117 | Clear(); 118 | // Move the cursor to home position 119 | CursorHome(); 120 | // Write some text 121 | altSerial.write(" I used to be a "); 122 | SetCursor(1,2); 123 | altSerial.write(" cash register"); 124 | // Turn off the underline cursor 125 | CursorOff(); 126 | } 127 | 128 | void loop() { 129 | // Pass through any data typed via the serial monitor 130 | if(Serial.available() > 0) { 131 | byte c = Serial.read(); 132 | if(c == 0x0A || c == 0x0D) { // 0x0A = \n (newline), 0x0D = \r (Carriage Return) 133 | CursorHome(); 134 | } 135 | else { 136 | altSerial.write(c); 137 | } 138 | } 139 | } 140 | -------------------------------------------------------------------------------- /EpsonCmdSet.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/playfultechnology/arduino-VFD-RS232/b7fcde58430896d9e78f4914d5e60c9d3969caa8/EpsonCmdSet.pdf -------------------------------------------------------------------------------- /MAX3232-TTL-To-RS232-Serial-Communication-Converter-Module-Jumper-Cable-02.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/playfultechnology/arduino-VFD-RS232/b7fcde58430896d9e78f4914d5e60c9d3969caa8/MAX3232-TTL-To-RS232-Serial-Communication-Converter-Module-Jumper-Cable-02.jpg -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # arduino-VFD-RS232 2 | Interfacing a Vacuum Fluorescent Diplay (VFD) with RS-232 interface and ESC/POS command set to Arduino 3 | 4 | I acquired an Epson DM-D110 VFD display, sold for use as a till display. https://www.epson.eu/products/sd/pos-display/epson-dm-d110-series 5 | It's a 12V device that uses a simple serial interface to display text and numbers, except rather than being based on the 0V-5V TTL serial signals that most modern microprocessors use, it uses that older RS232 serial interface standard, which uses voltages between +15V - -15V. 6 | Therefore, I'm using a MAX232 chip to convert from TTL to RS232, and a separate 12V DC supply. 7 | ![](https://raw.githubusercontent.com/playfultechnology/arduino-VFD/main/Arduino%20VFD_bb.jpg) 8 | 9 | The ![Technical Reference Document](https://github.com/playfultechnology/arduino-VFD-RS232/blob/main/UA0-DM-D110_TechRef.pdf) is surprisingly clear and well laid-out, and explains the full pinout in more detail (including optional connection through to thermal receipt printers etc.), though I'll be using just the minimum pins required to use the display to show text output from the Arduino, which requires GND (Pin 8), +12V (Pin 7), and the Tx output from the MAX232 connected to the Rx input of the display (Pin 3). The RS-232 standard also defines lines that indicate whether the receiving device is ready etc., but I won't be using them. 10 | 11 | To send characters to the display, you simply issue a print() command via the AltSoftSerial library, with the char string you want to print. To send other commands, such as moving the cursor, making the display blink, altering the brightness etc., you send the bytes corresdponding to the desired ESC/POS command as defined in the ![ESC/POS CmdSet document](https://github.com/playfultechnology/arduino-VFD-RS232/blob/main/EpsonCmdSet.pdf). 12 | 13 | In either case, this causes the AltSoftSerial to generate a (0-5V) TTL serial output on Pin 9, which the Max232 chip then inverts and adjusts to the -15V - +15V range and delivers to the Rx pin of the display. 14 | -------------------------------------------------------------------------------- /RJ45 Breakout_bb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/playfultechnology/arduino-VFD-RS232/b7fcde58430896d9e78f4914d5e60c9d3969caa8/RJ45 Breakout_bb.png -------------------------------------------------------------------------------- /RJ45 Breakout_bb.svg: -------------------------------------------------------------------------------- 1 | 2 | 19 | 21 | 22 | 24 | image/svg+xml 25 | 27 | 28 | 29 | 30 | 31 | 33 | 57 | 61 | 63 | 65 | 68 | 70 | 72 | 79 | 81 | 84 | 86 | 90 | 94 | 98 | 102 | 106 | 109 | 112 | 115 | 118 | 121 | 124 | 127 | 130 | 133 | 137 | 141 | 144 | 147 | 150 | 154 | 158 | 162 | 166 | 170 | 174 | 178 | 182 | 186 | 190 | 194 | 198 | 202 | 206 | 210 | 214 | 218 | 222 | 226 | 230 | 234 | 238 | 242 | 246 | 250 | 254 | 258 | 262 | 266 | 270 | 274 | 278 | 282 | 286 | 290 | 294 | 298 | 302 | 306 | 310 | 314 | 318 | 322 | 326 | 330 | 334 | 338 | 342 | 346 | 350 | 354 | 358 | 362 | 366 | 370 | 374 | 375 | 376 | 377 | 379 | 383 | 387 | 391 | 395 | 402 | 409 | 416 | 423 | 430 | 437 | 444 | 451 | 455 | 456 | 465 | 474 | 480 | 486 | 492 | 498 | 507 | 516 | 525 | 534 | 536 | 538 | 545 | 552 | 553 | 557 | 561 | 562 | 564 | 566 | 573 | 580 | 581 | 585 | 589 | 590 | 591 | 592 | 593 | 594 | 595 | 596 | 597 | -------------------------------------------------------------------------------- /UA0-DM-D110_TechRef.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/playfultechnology/arduino-VFD-RS232/b7fcde58430896d9e78f4914d5e60c9d3969caa8/UA0-DM-D110_TechRef.pdf -------------------------------------------------------------------------------- /epson-dm-d110.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/playfultechnology/arduino-VFD-RS232/b7fcde58430896d9e78f4914d5e60c9d3969caa8/epson-dm-d110.png --------------------------------------------------------------------------------