-
A nicer enclosure, Tindie thoughts
02/19/2017 at 15:31 • 0 commentsAs I grew more and more fond of this clock I decided a nice looking enclosure is in order. Unlike quite some numiton and nixie projects I decided to go with a more modern looking enclosure, simply made from 2 pieces of aluminium.
I designed the enclosure using frontpanel designer from Schaeffer. A small note, there are 2 versions, the one from Schaeffer AG and the one from front panel express. They are identical but when you want to order the front panel the Schaeffer one can be used to order them in Europe and the Front panel express one can only be used for US orders.
I ordered a set of top and bottom parts for the enclosure and a week later I received them, looking absolutely perfect as always.
Some assembling later and we arrived at this:
I would say that makes a fine looking clock, some more pictures will be uploaded in the galley. The design files for the enclosure will also be made available. The downside is that the enclosure made of aluminium is not the cheapest option. Just a single enclosure is around 35 euro's including shipping, while a similar made enclosure made from Plexiglas would be less then half the price.
The design files should also be usable for laser cutting services as front panel designer can also export DXF and SVG files.
With this project finished and looking quite nicely I was wondering if there would be interest in selling kits of this project on Tindie, I'd love to hear some thoughs about that :)
-
Assume makes an ass out of u and me...
01/22/2017 at 19:47 • 0 commentsThe MBED libraries for the stm32f042 use an 8Mhz external crystal or the internal 8Mhz cristal. As the internal one was not good enough at all for timekeeping I added an external crystal in revision 0.2. For that I used the common 3.2*2.5mm crystal.
Only to find out those are only available in 12Mhz or higher...
So I made a revision 0.3 with a 3.2*5mm crystal footprint, in case someone wants to build one themselves. I have not ordered these as I hacked on the 5*3.2mm crystal and I can live with that. All the other issues have been fixed in revision 0.2 and the clock has been working wonderfully the last few weeks.
I will add instructions how to build one and a binary for the clock very soon :)
-
Revision 0.2
12/25/2016 at 12:37 • 0 commentsTime to end the year with a new clock.
I listed a few issues in the previous log of the project, the biggest issue was the accuracy of the clock. To solve this and the other problems a new hardware revision was needed. In revision 0.2 an external crystal has been added, as the 20 pins package of the STm32F042 does not have pins for an 32Khz RTC crystal a normal 8Mhz crystal was added. The RTC in the STM can also use the high speed crystal as input. The slight difference in distance between the numitrons and the annoying pin twist have also been fixed.
The new PCB.
This also means some changes in the software, and here the downside of using the MBED environment shows, changing something low level as the clock settings for the RTC is near impossible. In the end I had to add the MBED-dev source instead of using the precompiled libraries and in the file "targets/TARGET_STM/TARGET_STM32F0/rtc_api.c" change the RTC settings.
The clock has been running for about a week now and is still accurate, a big improvement over the few minutes a day in drift it had with the internal crystal.
-
The issues
11/13/2016 at 21:26 • 0 commentsThis project functions mostly at the time of typing. A few problems have been found which I will try to address in the next version.
- The internal oscillator is crap. This is the biggest issue and easily solved by adding an external crystal. The internal RC is better then most as it can do USB without an external oscillator but for a clock it's not good enough unless a minute per day is accurate enough for you. With a 10 cent external oscillator this is reduces to a minute per month.
- The 2 numitrons for the hours are slightly differently spaced from the 2 minute numitrons. When you start noticing it it's annoying.
- The numitrons have to be twisted a bit when inserted in the PCB for soldering.
-
The software
11/12/2016 at 08:51 • 0 commentsThe software is MBED based and can be found here: https://developer.mbed.org/users/riktw/code/Numitron_clock/
The main file can be found here: https://developer.mbed.org/users/riktw/code/Numitron_clock/file/d1558f6f88bf/main.cpp
The clock has to do several things. First of all, it's a clock, it should keep track of the time. This is done using the STD time library to make things easy. Second, the displays have to be updated from time to time so the current time is displayed, else it's a bit of a useless clock. And third, the time has to be adjustable, so the button input has to be processed.
The code does this all in the following way:
1. keeping track of time
As mentioned, the std time library is used, MBED uses the RTC somewhere deep in the code to do this but this is all done automaticly. Just set the time with the set_time command and done. How lovely
2. displaying time.
The TLC5916's I used can be chained together. If using only one, the normal way of using it is sending 1 byte of data to it using SPI and then toggling the LE pin to latch the send data to the output of the TLC5916. When using more then one, just send more then one byte of data. Byte one will first arrive at the first TLC5916. The second byte "pushes" this byte out to the next TLC5916. The second byte will now be in the first TLC5916 and the first byte in the second TLC5916. This can be upscaled to as many TLC5916's as you want.
To display the time, every second the current time is converted to a few bytes that are then send to the TLC5916's, which then make sure the numitrons are on correctly. It also makes the dot of the second left numitron blink for a nice effect.
3. Processing buttons
There are 4 buttons, one per numitron. Pressing it will raise it with one. This gives a quick way to set the current time.
The buttons are read in using the BusIn object. This way they can be read in in a single command, which returns a number between 0 and 15 depending on the buttons pressed. The buttons are checked twice with a small 50ms delay in between to negate button bounce.
The current time is then retrieved, adjusted and set as the new current time. At the end the display is updated directly to reflect the change in time.
Because of the use of the MBED libraries the code is relatively small and easy to understand and adjust if needed.
-
The hardware
11/11/2016 at 23:09 • 0 commentsThe clock is based on an STM32F042 microcontroller for several reasons:
- It's in a small but still hand solderable package, ssop20.
- It has enough IO's for this project
- It has a build in USB bootloader, so no USB to serial converters or programmers needed.
- It has a build in RTC and crystal, so no external RTC components needed.
The second major component is the numitron driver, and 4 of them to be precise. I picked the TLC5916. (or TLC5917 if that one is easier to get) This has several reasons:
- Numitrons work best with a current of 20mA, just like an LED. This is something the TLC5916 is designed to provide.
- Simple SPI like protocol that supports chaining several together, just 4 IO's required in total.
- Possible to control the current, making dimming the displays possible.
- Available in an easy to use SOIC package.
4 buttons are used to set the time of the clock. These are nice and orange to match the tube glow.
The rest of the components are basic jellybean things; An LM1117 3.3V regulator to power the microcontroller, several 100nF decoupling caps, several 1K pullup resistors, a 1K resistor per TLC5916 to set the current to 20mA for the numitrons and 2 buttons to reset the uC and set it in bootloader mode.