an exact clock for a vintage car

Since I drive my vintage XJS not too often, I disconnect the battery. This is to prevent if from going flat before I want to use it the next time. Of course it would be better to install a special charger for classic cars. But there is no outlet in the underground car park. The car starts when I want to use it, so one could say: mission accomplished. If only there was no clock in the dashboard.  It doesn’t run when the battery is disconnected. Having to adjust the clock every time is not the solution I was looking for.

My first idea was to get a DFC77 radio clock with hands, and put it inside the case of the original dash clock. All the clocks that had hands were too big to fit into the case. So I ordered a small module with an LCD. The problem was that it had good reception at home, but not inside the car. The long waves seem to have a hard time penetrating the Faraday cage of the car body.

The next option that delivers exact time over the air is GPS. So I ordered a cheap GPS receiver from China, and built a prototype with an AtMega microcontroller and a small OLED. The prototype kind of worked, but after the first drive, the GPS module failed completely. So I ordered a better one from an AdaFruit reseller in Switzerland. This module still works very well, but I found out the hard way that it needs a very clean power source. The next problem were random failures and reboots of the micro controller. This turned out to be caused by memory overruns. They are harder to detect on a micro controller  than on a regular computer. The display needs a framebuffer in RAM, and for the GPS I need enough space to store and parse the full NMEA sentences. I tried to reuse and re-initialize the same memory for every reading, but that didn’t work out. Neither didn’t I find a similar controller with more RAM. If I was going to produce a number of devices I would for sure use a better controller, but as it is a one off prototype, I just used two AtMegas. One for the display, and one for the GPS.

GPS has no reception in tunnels and underground parking garages. So I planned to implement a simple counter that just increases the time when GPS reception was lost. But then I decided it was not important enough. Instead I wanted to proceed, and have the device ready in the car. But I couldn’t resist to display a leaper for when there is not reception.

In a classic car, everything should be in original condition, so I didn’t want to destroy the original clock. Instead I was looking to buy a used clock that didn’t have to be in working condition. The ones I found in Switzerland were too pricey for only the case. So I found one on ebay for £22 that was shipped from the UK.

The problem that remains is that the OLED sometimes initializes with a random dot pattern and stays that way until the next power cycle. It happened more when I had it connected directly to the main battery. But since I connected it the the dash back light, it never happened again. So maybe it is important how fast the voltage increases when power is switched on.

As usual, the code is on github.

image20150625_202655132 image20150625_201613328 IMG_2636 IMG_2638

the infinity mirror

Lately while browsing through thinkgeek, I stumbled upon the infinite dungeon corridor. It looks cool, but they still have no affordable shipping options. That got me thinking that it should be possible to make an infinite mirror with the kids. It didn’t take long to find a recipe for how to go about it. Finding a mirror was easy, but regular window glass is a bit harder these days. The first try was with plexiglass that I had laying around. The effect was really bad, because it had a matt finish. When I asked for real glass, I got security glass. Trying to cut it to the right size, it disintegrated into a thousand tiny parts. So it was plexiglass again, this time with clear finish. I also was not sure about the window film. I bought the film that is used to taint the car windows. An LED stripe was readily available and waiting for a new purpose.

The kids were involved in all construction steps. Cutting the wood for the case, drilling, screwing, sawing, cutting the mirror, tacking the LED stripe … But one thing was entirely up to them: Usually those infinite mirrors have the two windows relatively close. But to be in the style of the dungeon corridor, I created the case with some room where the kids could paint what should look like the walls of a castle.

The effect is not as good as we would have liked it to be. I’m not sure if it is because of the plexiglass, the increased distance or the wrong type of window film. But it works, and was fun to construct. Most importantly the kids learned not just how to construct such a thing, but also about optical illusions, and how light behaves.

IMG_2639 IMG_2647