Thursday, January 30, 2014

Vacuum Fluorescent Display Alarm Clock

I have been working on this fun little project for the last couple of days. I ordered this VFD display from Noritake as a free sample. I am quite grateful for their generosity and I decided to put this display to good use.

I have written a driver in C# that implements a partial selection of the commands available from this display. The driver is object-oriented with property accessors used to set configuration parameters of the display.

Weather Data, Emails and a Loader Animation :]
I put all of this together into a sample application for a smart alarm clock that I would like to build eventually. The sample application gets my unread e-mail from Gmail and weather data from Open Weather Map. I am also attacking the 16 custom characters that reside in ram to display a few simple animations.

The Hardware

The hardware is quite simple for this article. I have a USB to RS232 converter. This display accepts RS232C levels so you cannot use the UART of a microcontroller directly without using a transistor to invert the signal.

Hardware Overview 
The display itself is the CU24063-Y100 model from Noritake. I don't know a whole lot about the theory of operation behind these displays, but it is a vacuum sealed type device. It has a "getter" on the front glass to catch any impurities during the sealing process. It also contains a heater that is visible during very low-light conditions.

Display Front
This display uses a microcontroller to implement the command set. It is from the Renesas R8C lineup, a very simple and interesting processor. I will likely order some this summer to experiment with. These processors implement numerous security features including read/write protected flash pages and a 2^56 complexity key for reprogramming. Quite impressive if you ask me. Given a baud rate of 500000bps, it would take a few hundred years to brute force these devices. Not to mention the fact that you need to reset the chip after each attempt.

Thankfully, Noritake left a nice hole in their protocol that let me read out the firmware contents. This is a story for another blog post (maybe :]).

Display Back

The Driver

The first thing I did was develop a subset of the commands into a clean object-oriented driver. I created a GitHub repo to share the code with anyone who wishes to drive this display. It is tested on Mono, but I can't see any reason why this wouldn't work on Microsoft's implementation. Submit an issue on GitHub if you encounter any issues and I can fire up my Windows virtual machine and debug it.

I will give you a quick taste of the code here but you can see the rest on GitHub. Here is the constructor that initializes a serial port and configures it for the default baud rate of the device. Note the optional parameter that would allow you to override it.
/// <summary>
/// Initializes a new instance of the
/// <see cref="TheResistorNetwork.VfdDriver.VdfDisplay"> class.
/// </summary>
/// <param name="serialPort" />Serial port.
/// <param name="baudRate" />Baud rate.
public VdfDisplay (string serialPort, int baudRate = 38400)
 this.serialPort = new SerialPort ();
 this.serialPort.PortName = serialPort;
 this.serialPort.BaudRate = baudRate;
 this.serialPort.StopBits = StopBits.One;
 this.serialPort.Parity = Parity.None;
 this.serialPort.Handshake = Handshake.None;
 this.serialPort.Open ();

 displayMode = VfdDisplayMode.Flickerless;
 brightness = VfdBrightness.Percent200;
 blinkMode = VfdBlinkMode.Off;
 cursorMode = VfdCursorMode.Underline;
 customCharacterMode = VfdCustomCharacterMode.Disabled;
This driver is for the 24x6 character display. I only have the one display from this company so I didn't bother abstracting it as an IVfdDisplay or anything like that.

I have modelled the cursor mode using an enum that extends byte.
public enum VfdCursorMode : byte
 Underline = 0x13,
 Off = 0x14,
 Block = 0x15,
 UnderlineBlink = 0x16
This allows me to cast it directly to a byte and send it to the device during a property assignment.
/// <summary>
/// Gets or sets the cursor mode.
/// </summary>
/// <value>The cursor mode.</value>
public VfdCursorMode CursorMode
 get {
  return cursorMode;

 set {
  cursorMode = value;

  var cmd = new byte[] { (byte)cursorMode };
  serialPort.Write(cmd, 0, cmd.Length);

  Thread.Sleep (1);
This should be enough to give you an idea of what is going on in this driver. Feel free to fork the repo on GitHub if you wish to implement the rest of the commands. I will be more than willing to review your code and merge it in!

The Sample Application

I consumed my driver in a sample application that fetches e-mails, weather data, date/time and animations. This code is far from pretty, but it works. Here is a link to the GitHub repo for you to peek at. There are probably hundreds of ways that I could have done this better.

As an example, I could have created a TextScroller class that scrolls text at any location on the screen with a configurable width. At the moment, it is a mess of hard-coded constants.

Spinning Globe Animation with no Unread Email
It takes a few moments to initialize as it downloads contents from Open Weather API and Gmail.

Spinning Envelope with Unread Email
So there you have it! My VFD driver and sample application. Thanks for reading!


  1. Hey, I was trying to find an email to contact you at, but couldn't. I checked your google profile also, and for some reason it wouldn't let me send you an email. I was wondering if I could ask you a few questions because I saw this project you posted and it looks pretty exciting. My email is, if you wanted to email.

  2. Oxygen is one of the most abundant elements found in the Earth's crust. It is also the 3rd most commonly occurring element in the universe. The non-metallic gas is said to constitute more than 65% of the human body, three quarters of sea water and around half of dry soil. These points make it clear how essential the oxygen is to sustaining life on the planet Earth. Thin Film Deposition

  3. Proper installation of expansion joints allows you to manage where any movement in the system occurs, preventing damage or movement to the rest of the system by forcing it to occur at the join. Vacuum Flanges

  4. Once more, as referenced above, wtop vacuum
    hen making this examination, attempt to get the amp rating of the engine just rather than the whole machine.

  5. Therefore, it is best to either compare motor input power in watts of both machines or if you have to compare a machine rated in watts with one rated in amps, try to get the amperage rating of the motor only instead of the entire vacuum cleaner. You can then convert this to watts and have a meaningful comparison. best vacuum cleaner for hard

  6. You are offered the comfort of achieving various undertakings without bargaining your home's cleanliness. robot vacuums

  7. I think this is an informative post and it is very beneficial and knowledgeable. Therefore, I would like to thank you for the endeavors that you have made in writing this article. All the content is absolutely well-researched. Thanks... Sydney Home Alarms

  8. All vacuum cleaners operate based on air flowing from the opening at the cleaning head or tool, through the vacuum cleaner and the bag and/or filter system and then out the exhaust port. car vacuum

  9. This is my first time i visit here. I found so many interesting stuff in your blog especially its discussion. From the tons of comments on your articles, I guess I am not the only one having all the enjoyment here keep up the good work best vacuum for pet hair

  10. Very interesting blog. Alot of blogs I see these days don't really provide anything that I'm interested in, but I'm most definately interested in this one. Just thought that I would post and let you know.

  11. I have to search sites with relevant information on given topic and provide them to teacher our opinion and the article. best cordless vacuum for hardwood floors

  12. Here is the place point by point and very much explored vacuum cleaner surveys will assist you with settling on the last decision of picking the best model for your upright vacuum for stairs

  13. Thanks for the blog loaded with so many information. Stopping by your blog helped me to get what I was looking for. vacuum storage bags