Final Project – Menu System!

Over the winter break I didn’t do any work on my third year project, though I told myself I should. So, when the semester began, I was at the same stage as before the break:

  • Real-Time Clock functional
  • Relay triggering functional
  • Changeable target temperature with buttons
  • Status display on LCD

A menu system is completely necessary for a thermostat of this complexity; options to change backlight colour, configure the time, modify schedule, and others, can only be practically configured through a menu.

This was the result of an hour or two of work:

Look past the break to also see a video demo of the menu interface!

It is kind of empty right now, since it is still in development, but the system is quite simple:

  1. Hit the centre button to enter or exit the menu
  2. Navigate up and down the options at that menu level: the currently selection option has a “+” before it, and the others have a “-“.
  3. Hit the right button to enter the selected sub-menu. Hit the left button to go back a level.

The first menu item I configured was the LED menu, which allows you to change the colour of the backlight.

By default, it is configured for “white”, which is a combination of red, green, and blue light. It looks more blue than white, but it is as close as possible.

The first version of the menu (not pictured) only included white, red, green, and blue, which are the simplest to implement. As soon as this was functional, however, I immediately expanded the list to include all combinations of these colours. This resulted in a total of 7 backlight options.

In addition to creating this menu system, and on the advice of my friend Matt Durr, I added a boot screen logo. It appears for a little under two second.

As you can gather in the above image, I have a tentative name for the project, “ConnectedControl”. The name draws attention to the wireless connection, and the additional control available by having computer connectivity.

The LCD display being used is the ST7565 Graphical Negative LCD from Adafruit. She includes some libraries to use with this display, which I found included a lot of unnecessary code and needed some work to clean up/optimize for my project. Also included with these libraries was the bmp2glcd utility, a command-line tool which will convert a bitmap image file into an array for use with a graphical LCD in an embedded design.

bmp2glcd

Here is an important comment about bmp2glcd, when used with this LCD display. Unfortunately, it isn’t a convert-copy-paste operation. There are two steps you need to do in order to generate a useful image on the LCD.

  1. Flip the image vertically (over the horizontal axis) before converting it with the utility. Otherwise, it will be upside down when converted.
  2. The array is divided into 8 blocks. These are in the wrong order (8, 7, 6… rather than 1, 2, 3…). You need to copy the last block, paste is at the beginning, and continue until all blocks have been reorganized.

Final Remarks

Plenty of work remains until the firmware is complete. At this point, more menu items need to be added, the ability the change time being my current task.

Other tasks:

  1. Make idle screen more attractive
  2. Include the option to switch from heating to cooling
  3. Create the scheduler system (perhaps the most involved task)
  4. Generate a system that can determine the day of the week based on the day/month/year
  5. Also allow it to determine whether it is a leap year or not
  6. Implement a temperature override function

I’m pleased with my progress so far, however, and every success keeps me motivated to finish this project!

Video Demo

Tags: , , , , , , ,

Tuesday, January 24th, 2012 electronics, final project, projects, school, software

2 Comments to Final Project – Menu System!

  • anona mouse says:

    it’s starting to look good! nice work!

  • amol says:

    hi.. i am using the same lcd as u are, but with lpc2138 … would you mind sharing your lcd library files with me, so that i can modify it for lpc2138… i found that ladyada library a bit wierdo.. thats why i am asking for urs… please.. mail me on my mail id..

  • Leave a Reply