Introduction: VFD Digital Clock With Low Component Count.
I have been interested in digital clocks since my youth, building my first nixie clock 48 years ago. Electronics have come a long way since then but I still have a liking for the retro look of past and so designed a new nixie clock recently but now I wanted one using VFD's -vacuum fluorescent displays.
There are a number of designs around so I wanted to design one which was easy to build and at a much lower cost than those already available to purchase as a kit or ready built. I do not claim that I designed this from scratch, why re-invent the wheel, instead the inspiration came from a site http://vonnieda.org/tc18
I took the design and software and used readily available modules to reduce the component count. Then I sourced the components from the likes of eBay and Aliexpress, others suppliers are available.
Looking to the future I also wanted to make it as easy as possible for others to build and possibly make it available as a kit or supply components or supply boards. The display board is separate from the main board so there is a possibility to use differing displays with one main board design just changing the display board.
This Instructable is not about how the clock works in detail, this is already excellently described in the article already referenced to. The main idea of this is to demonstrate how a project evolves to become a finished article. Where I make reference to a supplier I do not necessarily endorse them, just comment on the suppliers I use.
I am not going into detail about using an Arduino or how to solder, identifying components etc as there has been other Instructables detailing that. If there is anything to be aware of I have tried to warn you.
IV-18 vfd tube
Atmega328p-pu with boot loader
22pF ceramic capacitor x 2
100nF ceramic capacitor x 6
SSOP breakout board
PCB strip pins
28 pin wide dip socket
28 pin narrow dip socket
Micro USB breakout board
RCWL-0516 module (optional for movement detection)
10K resistor x2 (optional for movement detection)
BC547 transistor (optional for movement detection)
2way 20x2 pcb male header
2way 20x2 pcb female right angle header
Step 1: Reducing Component Count.
The original design used discrete components to generate the 30v needed for the tube grid and 3.3v for the filament. Now boost converters and voltage regulator modules are easily available and are cheap so I used those instead. Mobile phones often use a wall plug with a USB outlet to connect to the phone with a cable. This is a convenient 5v so instead of using a higher voltage with a 5v regulator and associated components I used a micro USB B socket. An extra benefit of using a USB power supply is that it opens up the possibility of using a standard 'power bank' as a portable power supply. To make it easier to mount the USB socket a breakout board was used.
A compromise was taken regarding the MAX6921AWI which is only available as a surface mount component. I could have used the wsop package and soldered it on the pcb or the plcc package and used a socket however as I might sell the printed circuit boards or kits in the future and some people might not like the idea of dealing with smd I opted to use a small wsop to dil adaptor daughter board. Then I could supply a MAX6921AWI already soldered on a daughter board if anyone wanted one. As one of the considerations was cost I could not use the plcc package MAX6921AWI as only the wsop package was available at low cost from Aliexpress.
When ordering the MAX6921AWI make sure you get the 'AWI' version. Other versions have a different pin out.
When using the boost module be aware that the higher 30v is only obtained at the extremely end of the multi turn potentiometer. Not much happens when you first try and turn up the volts and then suddenly they increase.
The RTC can come in 2 versions. One type has a rechargeable button cell, the other non-rechargeable. Make sure you install the correct battery as trying to charge a non-rechargeable type can result in serious damage. Inserting a rechargeable battery into a module which only takes non-rechargeable types results in the cell failing to maintain the memory of the module quickly so in the event of power failure the time will be lost and you will have to reset it.
Step 2: Printed Circuit Board.
I decided to make the project look good and so a PCB is needed. I use DesignSpark (dspcb) This is a free application but still powerfull enough to do the job and no limitations regarding board size or component/pin count. It can produce industry standard gerber files suitable to send to a fabrication plant. I produced the schematic in dspcb but a bit of explanation. The RTC and the 3.3v regulator I plug into sockets on the board so instead of them appearing on the schematic as components they just look like sockets. You do not have to use sockets, these could be directly soldered in the board. Also the MAX6921AWI is a surface mount component but as I have mentioned previously I decided to use the wsop package and use an adaptor board rather than the plcc package and socket. Thus the MAX6921AWI appears as a wide 28 pin socket.
Perhaps a bit of a slight annoyance from me. Many people use Fritzing and I can understand why. However it does not produce standard format schematics and whilst it may allow others to build a circuit from someone else's design, it is not easy to understand just what you are wireing in my opinion. Also as a circuit becomes more complex I feel Fritzing becomes even harder to follow. So sorry all those who find it difficult to follow a schematic but remember I come from the 'old school'.
Having produced the schematic dspcb automatically produced a board which I then altered to make it the right size. Then the application autorouted the wire nets. This was not 100% successful but it was completed manually. Further tidying up to make it look pretty and the gerber files were produced.
A quick search on the net reveals numerous places which will make pcb' s for you but I have used JLCPCB a few times and have always been happy. I chose to have them made 1.2mm thick not the standard 1.6mm.
In true style I then discovered an interesting module which is described as a radar detector. This can be used to detect if someone moves in the room and its output goes high. I thought the MAX6921AWI has a blanking input which in the original design is tied low. The output of this module could be connected to this input via a transistor to invert the signal thus turning the display the display on, timeing out after a set time. This addition was easily added to the schematic but the board was already routed. Careful placing the components allowed them to be added without too much trouble. The only hope is the design works as I did not have a radar module so had to work off the data sheet. I could not wait for one to be delivered as the fabrication lab was running an offer which I wanted to take advantage of. The gerber files were then produced again, zipped up and emailed to the pcb manufacturer.
Once sent extra components were ordered from Aliexpress.
Step 3: Software
As I have said, I did not design the software but I did alter it slightly and also met a slight problem. Firstly in the UK conventionally we use the dd/mm/yy format whilst some countries use mm/dd/yy, the software was originally written for the later so I changed it to be more UK friendly. Secondly when compiling it using the Arduino IDE numerous errors and warnings were thrown up. I realised the code was written around 2009 and the errors suggested before v1.0 of the Arduino IDE. I tried to use an earlier version and 'hey' all compiled and uploaded with no problems.
For anyone wanting to play around with the code it is really well annotated.
Step 4: Proveing the Design
The first stage was to use an Arduino UNO or clone instead of a stand alone Atmega328p-pu, to reduce variables. I also used the software as published before making it UK friendly. To further reduce variables and also because I did not have an AS1117 voltage regulator it was replaced with a resistor. Using ohms law V/I=R and wanting to drop about 1.7, the tube filament takes 85mA so 1.7/0.085=20. The AS1117 was replaced temporarily with a 20ohm resistor. The prototype was built on breadboard.
As I have already mentioned, uploading the code did not go well at first. Using the latest Arduino IDE resulted in a message 'wire send replaced by wire write' and the sketch would not compile. I edited the code replacing all reference to 'send' to 'write'. Trying to compile the code again resulted in a message 'wire receive replaced by wire read' and again the sketch would not compile so again I edited all references to 'receive' to 'read'. Now the sketch compiled but there were various warnings about the latest C++ version not allowing certain references and some lines equating to zero. Research showed that 'wire send' was replaced by 'wire write' on version 1.0 of the Arduino IDE so I went back to the original code and used version 0022 of the Arduino IDE. The sketch compiled and uploaded to the UNO with no problem. Of course, the original sketch was written about 2009 and the Arduino has progressed a lot since then.
The components were sourced from Farnell or eBay as I did not want to wait the 3 plus weeks for a delivery from Aliexpress. Once the boards were designed and ordered an order for further components was made with Aliexpress. In the past boards from JLCPCB to the UK take about 2-3 weeks. If you are keen to build this and cannot wait I am sure you can source components locally.
The photograph shows the prototype built on breadboard. It does look pretty but it worked! The next stage was to edit the code slightly to give the dd/mm/yy formate, again success.
Once components started to arrive from Aliexpress I could test the radar module. The work reading about it paid off, it worked. Confidence increased that the PCB would work.
Step 5: Tools to Build the Final Design.
If you do not use a designed pcb you can use matrix board. Tools needed:
Soldering iron with small bit suitable for standard components.
Fine bit for soldering iron (only required if you solder the MAX6921AWI yourself)
Flux (only required if you solder the MAX6921AWI yourself)
Fine solder - suggest 0.5-0.3 mm (only required if you solder the MAX6921AWI yourself)
Solder suitable for general electronics use.
Multimeter (strictly not necessary but useful)
Wire cutters suitable for electronics use
Fine long nose pliers for electronics use
Step 6: Next Step.
The pcb has been ordered and I have been informed that it has been despatched. Components have been ordered from Aliexpress and have also been despatched, some already have arrived which allowed the testing of the radar module.
As this is a working project, at least the circuit has been proved working I have decided to publish it at this stage and to update it as the final design emerges.
Step 7: PCB and First Problem
It's always exciting to open the package when the boards you have designed arrive and all looked good. The board was designed to remove the top part which holds the display tube, a silk screen line shows where to cut and some vias placed to weaken the board slightly. A score mark was made with a 'Stanley' knife and the board snapped to separate the 2 parts. Mounting of the components commenced. It was then that the first problem became apparent. I had assumed the size of the MAX6921AWI breakout board was the same size as a standard wide 28 pin DIL socket whereas in fact it is about 2mm wider. The pins on the board can be bent inwards to make it fit but it is not ideal. Any future boards will have to be slightly altered to accommodate this or a new breakout board designed and made instead of purchasing an off the shelf item.
Step 8: Trying to Improve the Design
I decided that it would be better to place the rtc on the top of the board so it was moved. The radar module was attached to the pcb with a dab of hot melt glue.
The photograph shows the changes although the 3.3v voltage regulator had still not been received so the resistor is still dropping the excess filament volts. However, the ASM1117 was subsequently received, the resistor removed and the module soldered in place. All worked as expected.
Still need a case though.
Step 9: Construction and the Result.
The photograph show the completed clock, the red glow is an indicator on the RTC module. It might be better to cover it or if possible remove or disable it.
It's a bit fiddly to insert the 22 wires of the display tube into the pcb but it's a case of having to be patient. There is a marker on the pcb holding the tube indicating the 3 unconnected pins. Careful examination of the tube enables these wires to be determined. The right-angled connector is then attached to the pcb. The wire clippings from the tube can be used to attach the USB breakout board flush to the main board. The radar module is attached with flying wires to allow it to be positioned pointing outwards.
Once all components have been installed it's switch on time. The display lights but of course the time and date are wrong. These are set by choosing the menu from turning the rotary encoder then pushing the spindle down. Then turn the spindle again to the correct hours and press again. Continue this to set minutes, seconds and date.
Various differing display options are available from the menu. It is easier to try out and experiment with the various functions than try to explain in detail. The photographs show time, date and temperature which are cycled through.
The radar module will now turn the display on whenever there is movement.
Step 10: Help With the Sketch
It has been pointed out that there is a problem with compiling the sketch. It was mentioned previously that it will not compile in the latest Arduino IDE so here is the instructions for installing the version you need.
Firstly down load the software NEWTC18.pde and save it somewhere where you can find it. Next go to the Arduino site, here in the UK its https://www.arduino.cc/en/Main/Software and scroll down to Previous releases. Chose the 00xx releases, you need release 0022 - a new version will not work. Mine let me install this version as well as a more up-to-date IDE. Once installed, launch it and then 'File' - 'Open'. Navigate to where you saved the downloaded software. It might say you need to install the sketch in a folder, just accept it and then it should open.
Step 11: Update
I first published this project in June 2019 but noted it had appeared in my account as 'draft' so I decided to republish it. That explains some correspondence going back 2 years.
It looks as if I did not include the Gerber files at the time and looking back perhaps I can see why. Not my greatest creation. However I include them now and perhaps, given time as I am working on another clock (yes another), I will make a better job.
I have been looking at github but at present I must admit cannot make hide nor hare of it hence at present I suggest you can obtain the Gerber files here