Vetinari Clock

There are a couple versions of this project around, this one is my original circuit and code. It uses an ATtiny84A and an MCP79412 RTC. Once per second, the code generates a random number. If it's an odd number, it advances the clock. If it's even, it adds one to a counter. When the next odd number is generated, the clock is advanced by the number of seconds indicated by the counter. The MCU sleeps between interrupts from the RTC, and I calibrated the RTC against a GPS time base. So I hope it will run quite a while on two AA cells, and will also keep good time, hopefully to a few ppm.

I only ruined one clock learning how to hack it. Basically I just cut the traces between the clock motor coil and the original clock circuit, solder a couple wires to the coil and bring them out to my circuit. This particular clock isn't terribly well constructed (which is what I would expect for a $4 SprawlMart clock) and I ended up breaking a plastic bracket in the mechanism. Basically the entire mechanism needs to be disassembled to get at the circuit board. It has five or six gears and is not really too bad once you figure it out.

Hardware design and software are available on GitHub, Hardware: http://goo.gl/Rsk2Ki Software: http://goo.gl/oXYS8Y

Here are a couple photos of the board.

http://www.youtube.com/watch?v=nehvDRC8ats

Very good, Jack.

Although, that clock would drive me insane. ;)

Awesome, well done! And yes - that clock would drive me nuts!!

The clock seems to be acting like a kind of "un-dead", "zombie" clock.

[quote author=Nick Gammon link=topic=195669.msg1443940#msg1443940 date=1382839537] Very good, Jack. [/quote]

Thanks!

Although, that clock would drive me insane. ;)

Well, that is part of the idea after all! :D I've had one running here in my office for a couple months or so (with wires dangling out, connecting it to a breadboard) and I wondered about it at first too, but I got used to the sound pretty quickly. Think of it as low-frequency white noise :D

I like.

I Think its a little bit crazy but good for joking with friends.

Good work

Nice project, but shouldn’t it move the second hand forwards by the “countOfEvenNumbers + 1” ?

I guess, if it keeps good time, you must be doing that already.

gm1mfn: Nice project, but shouldn't it move the second hand forwards by the "countOfEvenNumbers + 1" ? I guess, if it keeps good time, you must be doing that already.

Yes, in fact that is what it does.

I calibrated the RTC against a GPS time base ...

I like the concept of a clock that is calibrated against a GPS time base, and then deliberately shows the wrong time. Nice touch. :)

I like it. Always been a fan of some of discworld's kooky ideas, and here is one in reality. How long do the batteries last or is it to new to know?

If that was in my office, I would be hoping “not long”.

[quote author=Nick Gammon link=topic=195669.msg1445518#msg1445518 date=1382956121] If that was in my office, I would be hoping "not long". [/quote]

Quote from book:

Lord Vetinari also has a strange clock in his waiting-room. While it does keep completely accurate time overall, it sometimes ticks and tocks out of sync (example: "tick, tock... ticktocktick, tock...") and occasionally misses a tick or tock altogether, which has the net effect of turning one's brain "into a sort of porridge".

fungus:
…which has the net effect of turning one’s brain “into a sort of porridge”.

That could explain a lot!

Riva:
How long do the batteries last or is it to new to know?

Yes, it’s a bit soon to tell, but I’ve had a data logger on the battery, below is a chart.

clock_battery.png

Very well done, it looks like the clock is in a time flux, or senses a gravitational well (you don't live near a black hole ?)

what would be cool was a fourth hand on the clock indicating the error (or the load of the battery:)

Sometimes you see a wall with 5 clocks: NY Tokio London etc would be really fun :)