This is comedy week at YouTube, and in keeping with the theme, my “Shy Dildo” video has been flagged with a copyright notice by EMI. Apparently EMI thinks that the buzzing of the ‘personal massager’ is an infringement of “Spitfire (Nightbreed Mix)”.
Actually, my little motor friend sounds better than the piece by the group Prodigy.
Media Circus is an electronic, internet-enabled scrolling marquee that displays amusing news headlines. Media Circus uses @generalxcentric’s daily tweets, which are cutups of contemporary news headlines from the CBC and the Toronto Globe and Mail.
Average Clock is six clocks running independently, slowly diverging, while a microcontroller tries to make sense of it all.
The quartz crystals that regulate most household clocks oscillate at 32,768 cycles per second. This frequency is used because it is equal to 2^15 cycles per second, and hence can be divided easily by computers using base 2 math. In practice, however, inexpensive crystals never run exactly at 32,768 cps. The discrepancy shows up over days or weeks and we have to adjust the time—from time to time. Crystals are also affected by temperature, aging, shock and even radiation.
Average Clock was developed on the premise that consumer-grade timekeeping crystals diverge in accuracy equally above and below the target frequency. Given enough inaccurate clocks, if they are inaccurate equally, the average time will be correct.
This appliance depends on failure for its accuracy… That’s the theory, anyway.
The six clocks are Maxim DS1307 real-time clock chips. They require a minimum of additional support circuitry: VCC and Ground, a 32 kHz crystal, a couple of 4.7k resistors (which are not required because we’re using pullup resistors in the controller) and a 3v backup battery. The chip communicates with an ATMEGA328 using the I2C protocol, using just two wires: SDA (serial data input/output) and SCL (serial clock). These lines are connected to the controller on Analog pins 4 and 5.
The I2C protocol has a wide address space, which basically means that you can—in principle—hang a hundred different I2C slave devices off of just two wires, and as long as you know the address of each device you can read or write to it. Most I2C devices, such as memory, LCD displays and bus controllers are individually addressable, but since Maxim figured that only someone truly demented would want to have more than one clock in a device, they designed the address of the chip to be the same for each chip.
This drawback is solved with external hardware, using two 4051 CMOS multiplexer/demulitplexer chips. The 4051 allows us to direct our attention to one of up to eight—though we only need six—of the clocks. We need two 4051’s: one for the SDA line and another for the SCK line.
Time for each individual clock is shown using small red seven-segment 4-digit LED displays. Three MAX7219 LED driver chips display the six times and a third 7219 displays the average time using a larger amber 4-digit display.
The circuitry is modular: three display modules on a home-made two-sided printed circuit board are connected to a hand-wired main microcontroller interface that holds the clocks, batteries and microcontroller.
Average Clock has a small control panel oriented at right angles to the rest of the hardware.
The software handles the clock initialization, multiplexer control for addressing each clock, sending the clock data to the MAX7219 LED drivers, and calculating the average time. This was, in some respects, the most challenging part of the project. While it’s fairly simple to sum each time reading from six clocks, then divide that by 6, I discovered the “day rollover problem”. When approaching 23:59, the average time became erratic as each clock rolled over from 23:59 to 0:00. I experimented with various methods of overcoming this problem but as the program became more and more convoluted, I decided to give up, or at least put the problem aside for a rainy day. I can always pull the controller chip and re-flash it if I come up with a solution later.
Control
MASTER RESET activates the reset pin on the controller, causing it to reboot.
Average time can be hidden with the View switch; when it is in the VIEW OFF position,
pressing the VIEW button turns on the average time. When the switch is in the VIEW ON
position, average time displays normally.
Setup Procedure:
Press the ZERO button. This sets all clocks to 0:00.
Using the HOUR and MINUTE buttons, set all clocks to the correct time.
Press the RANDOM button. This changes each clock by +/- 5 minutes. Press several times to scramble each clock while keeping the average value the same. Be prepared to go back to Step 1, since the clock scrambling may move the average clock time ahead or behind, and the more you randomize, the worse it gets. Ideally, two or three RANDOM presses should result in a correct time reading on the Average Clock.
You may disconnect the power at any time; the two CR2025 lithium cells will keep the clocks running at extremely low currents for months, or possibly even years. If you need to replace the batteries, you should disconnect the main power first.
I’ve included an automatic adjustment for LED intensity based on ambient lighting. No extra charge.
Some times the displays will lock up: press MASTER RESET to return the clocks to normal.