USB Tardis

A Tardis coin bank was given an 8x8 tri-colour LED display and an external "Easy" button. The coin bank functions still work (the Doctor "speaks" when the doors are opened and the Tardis travels in time (sound effect) when the doors are closed) and it can still be powered by its batteries. On its own it has four displays: blinking "computer" lights, the game of life, a starfield simulator, and a cellular automaton. The "Easy" button toggles between the modes. When connected via USB it is USB powered and can be controlled via a command set. The USB Tardis uses an standard arduino and an 8x8 display from SparkFun. This was my first arduino project.

usb tardis

A collection of construction pictures is available in this flickr photoset.

Two early videos of the tardis in action can be seen on youtube:
(Return to Home Page)

Arduino Code

The arduino code lights each row of the 8x8 display individually, cycling quickly and relying on persistence of vision to make it look like the lights are "on" at the same time. With each pass the code checks for incoming USB commands. The commands use ascii values to allow testing via a serial program. The (Hex) values are two hex digits representing a byte. For example for the "Red" characters '5' & 'C' translate to 0x5C or 92. The command set is shown below.

DescriptionItem
1
Action
2
Data
3
Data
4 & 5
Data
6 & 7
Column Get'C''?''0' to '7'  
Column Set'C''S''0' to '7'Red (Hex)Grn (Hex)
Display Invert'D''I'   
Display Clear'D''C'   
Display Fly
(iterate)
'D''F'   
Display Life
(iterate)
'D''G'   
Display Rotate Up'D''R''U'  
Display Rotate Down'D''R''D'  
Display Rotate Left'D''R''L'  
Display Rotate Right'D''R''R'  
Display Shift Up'D''S''U'Red (Hex)Grn (Hex)
Display Shift Down'D''S''D'Red (Hex)Grn (Hex)
Display Shift Left'D''S''L'Red (Hex)Grn (Hex)
Display Shift Right'D''S''R'Red (Hex)Grn (Hex)
Row Get'R''?''0' to '7'  
Row Set'R''S''0' to '7'Red (Hex)Grn (Hex)
Tardis Talk'T''S'   
Tardis Launch'T''L'   
Tardis Autopilot'T''A'   
Tardis Manual'T''M'   
Tardis Computer'T''T'   
Tardis Fly'T''F'   
Tardis Game Life'T''G'   
Tardis CA'T''C'   

A pair of serial latches, together with a 3x8 multiplexor are used to drive the leds. (While prototyping a 4x16 multiplexor was used. One bank of eight outputs simply meant "all off".) Each row has 8 green leds and 8 red leds (producing black, green, red and orange.). The sixteen lines are selected by loading the 2 8-bit latches and selecting the column using the 3x8 multiplexor.

Arduino Pinout:

DataDirectionUse
0-1In/OutSerial
2InDoor Switch
3InExternal Switch
(Easy Button)
4OutShifters Rck
5OutShifters SRck
6OutShifters Data
7OutRow 0
8OutRow 1
9 (Unused)
10OutSound
11OutExternal Control
12OutRow 2
13OutRow 3

While developing the code and adding new capabilitites I was often at the limit of the Arduino memory. I repeatedly improved the code to save a few bytes here and there as needed. Now that I have revisited this project I don't understand why the memory was so small, I assume I had the wrong type of arduino selected in the editor. (It was my first arduino project after all.) I had lost track of this code and have restored it from a backup. It may not be the finished version.

I believe there is an arduino library for driving 8x8 displays. I wasn't aware of it when I wrote the program and don't know if it handles red/green displays.

Ardunio Code: available here.

Windows Code

I wrote a few libraries to scroll messages in various fonts on the Tardis. Hopefully I'll get around to posting the code.

Sources


This material is Copyright © 2008 Craig Buchanan. All rights reserved. This page may be freely linked to.
Please send comments or questions to mailto: buchananc@acm.org.