How to add a Display

This guide details how to add a display that has a 4 7-segment digits a mode changer to make it possible to cycle through the various values to be displayed and a frequency indicator that shows when the grid is under or above 50Hz.

The 4 7-segment digits are driven by a MAX7221 driver chip and the mode changer by a shift register as not to take up too many arduino digital pins although it still takes up 6. The value displayed is controlled by rotating a potentiometer.

There are already excellent guides on building the 7 segment display and the shift register for the mode changer so I won't repeat them. I will just add some pictures of the circuits I built as a layout suggestion and the adapted Arduino code which is detailed below.

Here are the guides for the 7-segment display and shift register both in the Arduino playground:

7-segment display

Controlling a Led matrix or 7-segment displays with the MAX7219 or the MAX7221 - This is the main page that links to the two pages below.

The MAX7219 and MAX7221 Led drivers - details the 7- segment display hardware, including circuit diagrams and discussion of various factors that need to be taken in to account.

LedControl Library by Eberhard Fahle - details the Arduino library required to drive the display, including download.

Mode chooser

Serial to Parallel Shifting-Out with a 74HC595 - Started by Carlyn Maw and Tom Igoe Nov, 06. Details how to build the shift register circuit that allows us to have effectively 8 digital output pins while only using 3. Ive used 6 of the outputs for the mode chooser and 2 for the frequency indicator.

Layout suggestions

Here are a selection of pictures of the boards I built, just in case they are useful when trying to work out how to place all the components. Let me know if there's any detail that isn't so clear. More pics can be found here.

Left: Whole display, including the 7segment bit, mode chooser, frequency indicator, potentiometer and socket. Right: Whole display with the 7 segments removed.

Back of the 7 segment display and mode chooser:

Pictures of installation on wall. Communication's wire goes through a hole in the wall to the main unit.

Part List

Here's the full list of the component for the whole house energy monitor, the measurement board components are the fifth block.

Download OpenOffice: partlist28Jan.ods

Download Exel: partlist28Jan.xls

Arduino software:

The arduino sketch here works with the display and an arduino independently of any of the other energy monitor hardware and code. The intention is to make it easier to see whats happening and to make it easier to use the code in other projects. For the full code with the datalogger, measurement, display etc see the home energy monitor documentation page.

The main addition to the example code by Eberhard Fahle is the addition of code to make the decimal point work. The position of the decimal point depends on the number of significant figures.

Software steps:

  1. Download the sketch here: SAdisplay.tar.gz
  2. Compile and upload the Arduino sketch to the Arduino. For a guide on compiling and uploading the sketch to the Arduino have a look here.
  3. You should now see the display light up and be able to select through the values set in the sketch with the mode chooser.