The Time of Your
Life
technical notes
In this section I'll discuss the design and fabrication of The Time of Your Life.
If you haven't been there yet, check out the main
description page for this piece. Here I'll share with you some of what I've
learned, show you the schematic and code listing, and talk a bit about a new thought I've
had about long-term machines.
Overview
The Time of Your Life is a conceptual appliance. It performs a
specific (albeit elusive) function for its owner, the prediction of their demise based on
actuarial data. The goal was to construct a machine which contains a real time clock
with battery backup and a target date specific to the piece's owner. The piece would
compare the two dates and, using digitized speech, concatenate a message about the owner's
remaining time. A key is used to insure that the piece speaks only to its
owner. There is an LED display which shows the passing of seconds in binary.
The piece gives its prediction in months, as the doctor in the movies
would when speaking to a terminally ill patient. Technically, this also simplified
my programming task.
It contains a Microchip PIC16C73A
microcontroller, a Dallas Semiconductor DS1302 real
time clock, an Information Storage Devices ISD2560 sound
storage chip and a Hewlett-Packard HDSP2113 LED display.
In the following discussion, you may want to refer to these main system
elements:
The speech system
The Time of Your Life is a speech concatenation system, which means that
it gets a number from the real time clock, breaks it down into English language units,
looks up the addresses of the stored sounds in a table, and plays them one after the other
to create a spoken message.
The piece might say "You
have"..."three"..."hundred"..."sixty"..."six"..."months"..."to
live."
Like almost all of my sound pieces, this sculpture uses a
ChipCorder part by Information Storage Devices. This piece uses the ISD2560, which
can store up to sixty seconds of fairly good quality sound, which is addressable in 0.1
sec increments. It uses a parallel 10 bit address, and I chose to forego resolution
and just use the high eight bits for simplicity. This allowed me to save speech
addresses as bytes and just send them straight to the port.
I recorded all the numbers I might need in from zero to nineteen, and the
decades twenty to ninety, and the word hundred, and the other various phrases I might use,
all in a single long message on the sound chip. Then by trial and error I found the
start points and durations of each sound and saved them in an array in my program.
Normally I would record each sound separately, but in this case the single recording
technique works pretty well. It allows me to carefully control the similarity
between the words, both in volume and inflection. Otherwise things can sound pretty
strange when you combine recordings made at different times.
Timekeeping
The DS1302 real time clock is a fine little part. For this type of
simple counting piece I would prefer to use a binary counter such as their DS1602, but my
C compiler for the PIC doesn't support 32 bit math, so I just used a normal clock for
simplicity. Still, I use it more or less like a counter, in that I don't program in
an actual date, but start it at some arbitrary value which has no absolute relationship to
calender time, only one relative to another stored value, the target value. The
Dallas parts also contain scratch RAM, which I use to store the target date. The
backup battery maintains this RAM, so it is nonvolatile for the life of the battery.
I only read the years and months registers, and calculate from them the
current month count. I then compare this to the month count stored in the NVRAM to
generate a prediction. The current count can be greater or less than the target
count, with the system reporting either how long the owner has left or how many months
they've cheated death by.
Display
In general, I wouldn't recommend the HDSP displays from
Hewlett-Packard. I use them because they're tiny, they look nice, and I got a whole
bunch of them once on the surplus market. But they're hard to use, both the wiring
and programming unneccessarily complex. They take too much code and too many I/O
lines. So unless you need the colcors and size of LED displays, you are much better
off using the vacuum-flourescents by Noritake where you need a glowing display. They
are drop-in replacements for standard LCD character modules; this means that they only
take 7 I/O lines, and can be controlled using a driver provided by Custom Computer Services with their C compiler.
Having said that, I put a lot of work into routines for this display, and
they do have some unique qualities. So if you want to control one in C with a PIC,
check out my driver hdsp2113.c.
Long-term operation
One of the really difficult problems with long-term
projects is the battery. While solid state electronics have gotten so reliable that
it's easy to expect 100 years from a well designed system, battery technology just can't
keep up. The DS1302 draws less than a microamp in sleep, and a contemporary lithium
cell has less than a microamp of leakage current. So I may be able to theoretically
expect almost 100 years on a huge 1AH lithium cell. But I doubt it. Battery
discharge curves for currents that low and over that long a period are impossible to find.
So, it seems best to expect the battery to die, and the piece to need
repair. In the past, I have expected that I would program a new chip with the
updated calender info, and replace the battery. But lately I've been thinking:
what about 20 years from now? Will there be PICs? Will there be PCs?
Will there be PIC programmers? I doubt it.
So with this piece I have instituted a new strategy, that is to try to
make a system which is self-contained, that is, minimizes dependence on obsoletable
technology. Beyond the problem of part failure, which could be offset by hiding
spares of each element within a sculpture, I feel I need to make these systems as
technology independent as possible.
A hidden maintenance interface
This piece integrates a lot of extra code to implement a hidden user
interface, which allows me to reprogram the piece using buttons inside the sculpture, many
years in the future when the battery dies. And although battery technology will
change, that's something that can be retrofitted easily, as is the voltage regulator and
power supply. So all that remains are the key components, which as I mentioned
should be backed up with spares which travel with the piece.
The set routine is a classic two-button scheme, like in
wristwatches. A SET button moves the user through the steps, and an INCREMENT button
changes the values. The routine uses the display for feedback. This system
works very well, and can be adapted to a variety of applications needing basic
input. Feel free to adapt it to your projects!
One example of how else the simple two-button input system might be used
is my piece Portrait, which needs to be told when to call and what number to call; it
accepts a phone number and date and time info. As soon as I post that code I'll
stick a link here.
|