Thursday, February 27, 2014

Clock for my Vision Impaired, Aging Mom

My 82 year old mother can't see very well and regularly forgets what day it is. I looked around for a clock to help her keep track of the day of week but decided in the end to build my own using components from tindie.com.




You can build one of these yourself. Here's how I built the prototype...

LED Matrix from FriedCircuits

First up the 8x8 LED Matrices. I bought three LED Matrix Links from FriedCircuits on Tindie.  The product is a Matrix plus backpack using an AMS AS1107 (MAX7219 compatible) that you can easily daisy chain together. These LED drivers communicate with SPI and there is an Arduino library to drive them (or you could roll your own driver).

LED Matrix Master, left, and three LED Matrix Links from FriedCircuits

You can also buy an LED Matrix Master that plugs in conveniently to the display chain to drive it with an ATmega328P. For now I'm using a bona-fide Arduino Uno but I'll probably hack something together, maybe use one of my ATtiny breakout boards.

I calculated that I could generate 5-column numbers plus a narrow 1 for hours 10-12, and fit it all into 3 8x8 matrices (24 columns) including the blinking colon. The days of week could be abbreviated to three characters, each 7 columns wide.

The boards are nicely built with quality soldering, clever layout, and a great chip to work with. These appear to be OSHPark boards with all the quality you'd expect.

RTC from Jack Christensen

To keep track of time, even with the power off, I selected Jack Christensen's Real Time Clock module based on the MCP79412 chip. It's got a large coin-cell battery backup and all the pins broken out. It uses I2C to communicate. It takes a supply voltage from 1.8-5.5V. Quite convenient.

Jack Christensen's MCP79412 RTC breakout
The quality of the board and its assembly is outstanding. Beautiful, shiny, well-wetted solder joints, nice layout, crisp soldermask. I'm not sure who makes the boards but I'll have to find out because they're quite nice.

Microcontroller

For now I'm using an Arduino Uno. I connected the devices as follows:

  • RTC SDA to Arduino A4
  • RTC SCL to Arduino A5
  • Matrix LOAD to D10
  • Matrix DI to D11
  • Matrix CLK to D13

Software

LedControl is the Arduino library you need to control the matrices. I created an array of data for the fonts, a routine to draw a particular character, a routine to draw the hours and minutes and (optionally) the colon, and another routine to draw the day of week.

Jack wrote an MCP79412 library for his module, exposing all sorts of features, and providing examples. I used this library to read the time, then call the other routines to write out the time (blinking the colon) or, if seconds fall between 20 and 30, write out the day of week.

Take a look at the code in my Software Repository

Next Steps

To date the project took maybe 2 hours to get working. This just goes to show you what can be accomplished quickly thanks to the open source movement.

I took it over to her apartment tonight and she was able to read the time and day right away. Good.

Next step will be to select a microcontroller, finish the code, then encase the project with a nice box with tinted acrylic front panel. I'll add a power supply (battery? wall wart?) and let my mom try it out.

Ideally I'd like to have a simple interface for setting the time or, even better, use of NTP over WiFi. We'll see.

Next: Completing the Clock

3 comments:

  1. I'd think getting time over GPS would be easier and cheaper than NTP over WiFi.

    ReplyDelete
    Replies
    1. Possibly. Mom's in an apartment building, so I'm not sure the GPS fix would be very good. Worth a shot, though, thanks for the thought.

      Delete
  2. Nice project! Glad you liked the RTC, thanks for the props. Boards are from Seeed or iTead.

    ReplyDelete

Note: Only a member of this blog may post a comment.