Archive for January 24, 2014

Don’t Starve!

Cool game, brilliant artwork

I’ve been on the hunt for a game that really amuses me, there are times where I just don’t feel like being in the lab or doing anything serious. I’m only human right?

So, in going through reviewer lists looking for a game that isn’t a bloody shooter (grr why is every game some bloody FPS?) and with some heart I stumbled upon a recent release by Klei Entertainment called “Don’t Starve

What a cool game! The artwork is absolutely lovely. Gorgeous and quirky illustration style coupled with a stirring soundtrack really make this puzzle/survival game come alive. Basically, you are a “Gentleman Scientist” who is dropped off in the woods and you have to survive by making do with whatever you find. You can interact with almost anything and put them together to craft various tools to aid in your survival.

Best part – the game comes with no manual, no instructions and no tutorial. You just play it. The game is quite accessible if a bit head scratchy at first. Explore and click on things, see what you can do with them. Trial and error is the best way. Resist the temptation to google it up and just play.

When night falls, you better build a fire. It gets right spooky, and you don’t want to get eaten by a grue!

The game is a paltry $14.99 and is distributed digitally, DRM free. Isn’t that brilliant? You get a unique game and no bullshit. I know you might be tempted to steal it, but really – if any developer deserves the money, these guys do just for releasing it without copy protection. Think of it this way, you are casting a vote for quality software that isn’t crippled and doesn’t spy on you.

Also for sale is the bundle with the game and the soundtrack which I bought, can’t beat it 🙂

Check it out


So this game is so fun I’ve pretty much been sucked into it. Definite recommend. I WILL get the nixie clock finished, I promise!

Everything in its proper place…

Or how not to clutter up a user’s hard drive with your crap

Just a quick post as I clean out my hard drive, something I usually don’t have time to do. Usually, it’s a straightforward if laborious process but I’m running into an old problem that has annoyed me for years. It seems that many developers like to store their application information somewhat at random. Back in the day, at least on mac, this was ok since there was no designated folder structure other than what the user wanted it to be. Apps were self contained and you could run it from anywhere, you could move stuff around generally without problem.

Enter OSX. Like, more than 10 years ago. Here’s where Apple switched to more of a Unix/Linux folder structure scheme and it has worked out brilliantly. I always know where to find things – provided the developers of apps I install follow the same bloody structure!

Too often I still find folders of application information, shared libraries, caches, save files etc. randomly strewn around my hard drive. If I move them to their proper place, chances are the app in question will no longer function, at least properly, because it cannot find what it needs. What a pain. So I have useless app folders cluttering up my documents folders, or in the worst case essential files tucked in directories that – by definition – are meant to hold temporary, sacrificial files.

While not exhaustive, treat this as an introductory guide in how not to mess up your user-base’s hard drives.


  • This is the user space for the user’s documents, it is not for saved preferences and profiles. This is where we store our stuff, not your stuff. Stop cluttering it! Worst offenders: Adobe, Microsoft, many many games
  • Many linux programs love to put their stuff in here putting a “.” before the file name making it invisible. Though I realize this is the norm for *nix systems, please don’t do it on OSX. It’s annoying when we can’t see files. Though I much prefer this to the above
  • Leave this folder alone, don’t put anything into it ever

~ (home)

  • This is the top level user directory. Never put anything in here. Ever!


  • Do not put anything in this directory. You will note that there are several specialized sub-folders for this purpose. Use them, don’t clutter the library folder top level

~/Library/Application Support/

  • You can put stuff in here.
  • This folder is used for things to support your application (duh), put shared libraries, help files, icons, sounds, plugins etc.
  • Save games, custom workspaces and layouts etc. are also acceptable
  • In debugging problems with applications, one of the routines is delete your folder in here, so make sure the application can re-generate it’s factory contents on launch if possible
  • This is not a good place for user preferences, profiles, caches and logs (see below)


  • This is the ideal place to store your application’s cache files.
  • If you have multiple ones, put them in a folder so as not to clutter it up
  • Name your folder with the proper convention, usually the reverse of your web address: e.g. com.companyname.appname
  • remember: this directory is sacrificial. deleting cache files (some or all of them) frequently solves stability and speed bugs which build up over time. Don’t put anything you intend to keep in here


  • Put nothing in here, whatever it is, it’s not necessary to start it at login


  • Store your log files here so we can find them to read or remove them


  • This is where you can store your user preferences files
  • If you have multiple files, put them in a folder
  • Use the standard naming convention: com.companyname.appname
  • It is acceptable to store saved layouts, customizations, workspaces etc. in here
  • Use the standard XML plist format for files so we can read them and adjust them if there is a problem
  • If you must store personal information, license keys or the like: encrypt them!

/ root directory

  • Store nothing here, ever. It is for the operating system and nothing you could ever make is that important that needs to be at the root directory level
  • Unless absolutely bleedingly necessary for program functionality (not including the shitty things you force us into), you have no right to install anything outside of the user space apart from your application binary in the applications folder


  • This folder is for binaries of your application ONLY. Do not put user preferences, logs, and useless crap like readme files
  • shared libraries and auxilliary programs are ok provided you put everything nicely in a folder


  • A mirror of the user space Library with a few extra folders, same functionality, see above

Things to NOT do

  • Unless your program gives an option to install for all users of the machine, DO NOT install anything outside of the user space apart from the binary in the applications folder
  • Your program, unless it’s specific function requires it (not your selfish desire) you have NO NEED to run as admin (or *gasp* root)
  • Unless we specifically tell you to, you do not need to run at startup, at login, or run continually. Stay out of /Library/LaunchAgents /Library/LaunchDaemons and /Library/StartupItems, you are not welcome there

In conclusion

Following these simple guidelines is beneficial for both of us. You end up not cluttering up my hard drive or forcing me to spend hours looking for your files when I need them. You leave my documents’ space for my documents and allow for easy troubleshooting should something go awry with your program. The best key to user base loyalty is not to piss them off right? Work, be unobtrusive, don’t break things and you will be fine.

Nixie Clock Schematic Finished

After a lot of testing, it’s looking good!

My Nixie Clock Schematic

My Nixie Clock Schematic

So here is my more-or-less final schematic. Since I used bits ripped off from a bunch of places and cobbled them together, use it freely for your own clock project. Schematic posted here.

Please of course bear in mind that though I’ve made an effort not to make mistakes on the schematic, they are bound to be there so if you build this and hurt yourself because you didn’t check your work, well that’s your fault isn’t it? You’ve been warned. Some parts of this circuit have potential around 170Vdc which will zap you good!. I very much doubt the the circuit can kill, but I don’t want to see a test of that either. Enough, you get the point.

So I am quite pleased. Although I’ve been unable to breadboard up the entire thing at once, I’ve built it in pieces and it seems to work well. Quite low power also, I reckon the thing draws 150mA or less. I will have to wait a bit to give a measured reading on that as I accidentally melted one of the fuses in my multimeter and will seek a replacement for it.

Things put in, things left behind

There are many things I added to this circuit to give it some functionality and to make it usable. One can set the hours and minutes independently using push-button switches and in this sense works just like an alarm clock. There is also a seconds reset button which will zero out the seconds when whatever your setting it to reaches zero seconds to keep them close to in-sync. Holding down the button also acts as a seconds-hold so that’s quite useful. These three should be push-button momentaries, the type that have three terminals: a normally closed, input and normally open. The seconds reset needs to be double-pole double-throw momentary. All cheap and easy to find.

I’ve helpfully labelled the transistor pinouts as well. As it happens, I seem to have selected ones with every type of pinout combination possible. Infuriating really, why can’t they just stick to one standard one? Doesn’t matter what it is, just make it the same! All of the parts here, apart from the nixie tubes themselves, are cheap as chips and commonly available.

How it works

The circuit is divided into five basic sections. At the bottom left we have the 5V power supply (simple 7805 regulator) which powers all the CMOS chips as well as the crystal oscillator and the vanity LEDs. Moving right we have the 4521 frequency divider IC and the crystal oscillator. The resistors and caps start the crystal resonating and the 4521 divides its frequency down to the desired pulses we need for other parts of the circuit.

At the bottom right is the blue ultra-bright vanity LEDs which I plan to mound under the nixies to give them a nice nuclear blue glow that I’ve seen from other projects. Gotta have that! It pulsates once every four seconds and uses an RC timing circuit to fade it in and out. It should be noted that this circuit causes slight voltage fluctuations elsewhere in the circuit though these seem to not effect it’s function at all.

Above that we have our 12V Supply. I chose a 12V wall wort, since they are frequently over voltage anyway and as it happens it overcomes the 7812s dropout voltage to make a reasonable 11.90V. Moving right we have the small switch-mode supply that steps up the voltage for the nixies to about 170Vdc. This is quite a lovely circuit I lifted in its entirety from stuff posted around the net (see my previous posts for schematic). It is quite reliable and works well. As I mentioned in previous posts, it has a maximum output of 10mA. Since each nixie draws about 1.25mA, and each of the neons that make the separator colon draw about 1mA, we are only up to 7mA. Plenty of headroom. This saved me from having to step up un-isolated mains voltage and makes the whole circuit a damn lot safer.

The third row up from the bottom is where all the time calculation happens. Six 4017 counter ICs are used, one for each digit. Since the clock only has four nixies, the first two (the 1s seconds and the 10s seconds) are left with their outputs unconnected. Function couldn’t be easier: the 1s seconds accepts the 1Hz signal from the 4521, counts to ten then resets, passing a signal to the 10s seconds 4017 IC which counts to six and resets, passing it on to the minutes and so on. The function of the three switches is explained above and the hours in the previous post.

Finally, at the top we have the four nixie tubes and two neon lamps for our display. Each number of each digit (and the pair of neons) are driven by the MPSA42 high voltage transistor which accepts the input from the appropriate counter IC output via a 33k resistor. This works wonderfully. The two neons use the same transistor, but use the 1Hz signal from the 4521 as an input.

That’s it really. Better explanations of how this works are out there written by others more eloquent than I.

If you are going to build this up, I would highly encourage you to examine the circuit closely and test as you build it up. For a beginner project (as that is what I am still) this has some quite excellent educational value.

So now, I just have to build it up. The last challenge is, of course, to select (or build) a suitably attractive case for it. I’m hoping to hunt through a few junk shops for a nice box I can use.

Nixies on display

and the tiny amount of current that drives them

Here’s just a quickie post to show off my Hivac XN11 nixie tubes. I simply brought out the power supply for them and hooked up all four to various numbers. Nothing special apart from the nixies themselves which I find nerdtastially beautiful! Here:


Isn’t that a thing of beauty? I hooked all four of them up (for the first time ever as it happens) to try and get a current reading to see if I might be in danger of overloading my power supply. This is a serious consideration considering such high voltages (~170Vdc) bad things could happen if I get to close to the edge. I was delighted to find that four nixie tubes draw a measly 4.67mA. Considering my power supply for them is rated for 10mA, I’m in business!

24 hours in a day

Like many of you feel, it’s simply not enough 🙂

What I’m referring to is the slight issue with 24 not being a multiple of 10 and using two decade counters for an hours display for a clock. Normally, I can set a 4017 counter to reset when it hits any of its digits without issue. In this particular case, the 1s hour digit has to count to 10, increment the 10s, reset, count to 10 again, increment the 10s again, reset and then count to four at which time both hours counters need to be reset.

This is a tad more difficult than counting out 60 seconds and 60 minutes in which the counters can reset themselves without caring what the others are doing. For the hours, I have to have them conditionally reset which brings up a whole bunch of interesting thoughts on digital logic.

This is really my first real foray into digital electronics that wasn’t some silly LED chaser or other such dinky toy. The 4521 and 4017 chips are digital CMOS chips and thus only accept inputs and generate outputs as either DIGITAL HIGH (about 5Vdc or DIGITAL LOW (a certain threshold beneath that). The 4521 (as explained in previous posts) divides the crystal frequency down to 1Hz pulses that are HI for half the cycle and LOW for the other half (a square wave). Every time the 1s of seconds counter receives a HI pulse from the 4521, it increments a digit by making its next sequential output HIGH and making the previous one (as well as the other outputs) LOW. It does this until it hits it’s reset point, which is dictated to where it’s RESET pin is tied to. If it’s tied to ground it will count to 10 and reset. Optionally, it can be tied to any other digit to set the reset point. When it hits this point, it sets the 0 output to HIGH, the others to LOW and sends a HIGH pulse out of it’s CARRY OUT output pin. This carries a signal to the next counter’s CLOCK input causing it to increment and the cycle goes on.

All very logical, which is what you would expect from a chunk of digital electronics. In this light, the solution to the 24 hour reset problem would be a logical one.

Since the 1s of hours digit needs to count to ten twice, we need to tie the RESET pin to ground. Since the 10s of hours needs to count to three and then reset, we tie it’s RESET pin to its 3 output pin. So now we have a case where the two counters will count to 30 or exactly 6 hours more than the length of a day on planet earth. Not a very good clock if it falls behind six hours per day and displays cryptic times like “27:45”.

What’s going to solve this is a conditional reset of both counters. Using our logic we can say that IF 10s == 2 AND 1s == 4 THEN reset both counters. In order to do this, when the 1s just turns 4 and the 10s is at 2, we need to take both RESET pins HIGH so they both go to 0.

Off the top of my head I can think of two possible ways to do this. One being digital the other being somewhat analog. The first would be to take the above logical statement literally and use an AND gate, which is one of the basic logic gates and available in a convenient IC package of 4. I could use something like a 4081 quad AND gate or make AND gates from the 4011 quad NAND gate (you can make any gate out of a bunch of NANDs). Same goes for the equivalent 7400 TTL series ICs. It’s two inputs would be the 1s 4 output, and the 10s 2 output, the true condition taking both reset pins HIGH. Bit of a problem to figure out how to disconnect the 1s reset from ground though. I’m thinking on it.

Another, simpler solution is suggested by the original schematic for the nixie clock, which ties both RESET pins together with some circuitry voodoo to basically perform the same task. What appears to have happened is the 1s digit is shifted over a nudge so that the reset pin can be removed from ground and be solved using a flip flop in combination with the other reset pin. The modification to this circuit to make it a 24 hour clock is something I still need to decipher but is basically the AND logic as described above.

Few hours later

It appears someone else has ran into the same issue and even done up a clearer schematic to illustrate how the hours resetting works for a 24 hour clock. here:

24 hour 4017 wiring

This is a snippet from this schematic LEDSales in Australia (not Austria heh) who interestingly also carry the schematic and sell kits for both this and the power supply for the nixies that I’m using. From what I can see here, they’ve modified the one over at Mike’s Electric Stuff (or vice versa or who knows where the original one came from) in a way that agrees with his notes on the original I have.

It sort of makes sense, from looking at it. The two reset pins are indeed connected but how and why this works I haven’t a clue! I am assuming that it is balanced to only reset if both the 10s hours is 2 and the 1s hours is 4 (as explained above, ok that works) but how the 1s hours resets when it has to count to 10 twice is a mystery to me. I also don’t get that 4148 diode, why it’s there and why it’s biased that way.

The only way to find out is to build it of course! To the lab!

20 minutes later

Well waddaya know? It works! Fantastic. Wired it up according to that schematic and it does indeed count to 24. Mind you, I still don’t understand WHY it works. The reversed biased diode, resistor and cap and what these are actually doing are not obvious to me. Perhaps I’ll submit it to the EEVBlog forum and let the experts there explain it to me in layman’s terms.

That’s it for the timer! Another module is ready to rock. I guess I’ll just figure out how to set the time, a simple pair of push-button momentaries to increment the hours and minutes should do it. Since I probably won’t include a seconds display, there’s no reason for a seconds hold switch. Probably the most challenging part of this build will be finding a suitably nice case for it. I’ll talk about that in a soon-to-come post.

10 Minute Clock

I briefly had a chance to mess about in the lab last night just to continue doing some tests for my nixie clock project. I’m pretty sure I have a firm handle on how the 4017 decade counter works and the timebase is working beautifully. I also did a quick current measurement of my Hivac XN11 nixie tubes to be sure the power supply can handle them.

I first did a simple test of adding to my previous circuit with the addition of two more 4017 decade counters. I had run out of them and was forced (oh poor me) to go out shopping for more. I bought about 20 of them thinking I’ll make good use of these chips in other projects down the road. The result, before I ran out of space on my large breadboard, is a 10 minute clock that counts seconds and one digit of minutes before resetting. Video of the result is below. I used the 16Hz output from the timebase so it’s more exciting than watching paint dry or beards grow.

So yeah, that works. I’ve also been mulling over how to get the hours to reset at 23:59. Though it’s easy to get one counter to reset when it hits any number, it’s more difficult to get two counters to reset conditionally. What I mean by this is that the hours digit must count to 10 twice, then count to 4 while the 10s of hours digit counts only to 2 then resets at 3. When the 10s of hours resets, the 1s of hours should reset when it hits 4.

This I can make possible by linking the reset signals of both chips together though how I will actually do this isn’t quite clear to me yet. The original schematic I’ve had for years, found over at Mike’s Electric Stuff, suggests that I connect the two together and use an RC plus a diode to actuate the reset. The 24 hour clock instructions are written (the schematic is for 12 hour clock) rather than diagrammed so I’m trying to decipher what they mean without melting anything. It would mean that I can ditch the 4013 flip flop entirely from the circuit, being unnecessary.

It’s on the list for this evening’s entertainment. I’ll modify my 10-minute clock to simulate the hours digits for testing.

I had also given some thought to adding two more digits to the clock, which would be easy to do provided I had more nixie tubes. I was gifted a pack of 4 so that is rather limiting. I’ve found a potential source here in Toronto so I may investigate adding a seconds display to my clock. Or I may not. Reason below.

Power to the nixies

The original nixie clock schematic linked above is great I am sure, but it did scare me a bit in that it used un-isolated mains power to both power the circuit and provide a clock for it. I am not quite confident enough to mess with that especially given a certain degree of klutziness of which I am prone. My alternative was to use the schematic for a kit I found that is a power supply for nixies and neon lamps which is pretty cool. It is much safer to my mind and I can use a wall wort to power the thing. One limitation of this little switchmode converter is that I read somewhere it has a max current output around 10mA which is not much at all.

Fortunately, though they require a high voltage to operate, nixies draw very little current. I read somewhere that a typical max current rating of your run-of-the-mill nixie is about 2.5mA. Using the 33k resistor (recommended for the XN11) and 170V I am able to get the things to light up nicely. A quick current measurement from my multimeter gives me the joyous news that it draws a measly 1.25mA. So technically I can power up to 8 of them. Being the cautious sort, I would limit myself to 6 of them and/or a neon lamp to indicate the flashing colon.

I think what I will probably end up doing is just stick with the 4 digit clock and use ultra-bright blue LEDs underneath them to indicate that seconds are indeed being counted. After all, a seconds display is nice to look at when you are playing with a clock, but annoying in every other conceivable circumstance.

The LED under-lighting idea came from photos of numerous nixie clock projects and looks pretty damn cool. It would be a simple matter to add 4 ultra-bright LEDs in any colour I choose, then use a simple NPN transistor to switch them on and off to the 1Hz or 2Hz signal (whichever looks better). The addition of a capacitor would also give them a fading effect rather than an annoying blink. Going to look super-cool!

10 Second timer

As a follow up to the previous post, I breadboarded up the timebase and added a counter. Due to lack of 4017 chips, it can currently only count 10 seconds and reset. This is quite strange as I could have sworn I had cubic buttloads of 4017 counters laying about in my parts bins. I had used them for a previous project and I usually never buy parts singly. There are probably more in a baggie somewhere, I’ll have to hunt or hit the shops to grab some more.

Timebase and 10 second counter

Timebase and 10 second counter

Murphy, in his infinite wisdom, decided to hand me a non-functional 4017 just to drive me crazy for half an hour wondering what I had mis-wired or thinking the clock signal was too weak to trigger the 4017 (which is foolish, of course it isn’t). After ripping another one out of the aforementioned old project (I’ll have to replace it later), it works a treat. Using the 1Hz output of the 4521 (see here) and dumping into the CLOCK input of the 4017, it increments once per second. Nice.

Next step is, of course, to obtain several more 4017s either from the nethers of my parts bins or from the shop and chain them together to count seconds, minutes and hours. The Easy part will be getting the 10s of seconds and minutes to reset when they hit 6 (60 minutes/seconds), the more difficult will be getting it to roll over at 23:59:59 to 00:00:00. I see a solution in the schematic to roll it over using a D-type flip flop so that will be educational as well.

See it in action:

Dividing Frequency

Crystal oscillator and dividing it’s frequency to make something useful

Last time I was messing with crystals, I managed to get a stable 0.5Hz timebase for my nixie clock and frequency counter projects. After some investigation through data sheets, I thought I’d take a moment and de-mystify a very useful IC called the 4521 24-stage frequency divider. Not that it is much of a mystery to those who know electronics, but for an amateur like myself who is figuring this all out for the first time, it can be a bit annoying to build something and not know why it works. I won’t go into the details of the crystal oscillator part, but focus on the 4521 IC.

Basically what this little beastie does is take the frequency pulses from a pulse generator (in this case, a crystal oscillator) and performs some math on them to divide the frequency down from the megahertz range to the hertz range which is more suitable for clocks and things that humans actually will see.

Consider the schematic on the right.


Pretty simple huh? The crystal’s frequency (printed on the can) is 4.194304MHz. That’s 4,194,304 cycles per second. You might think that is a weird number to pick but as usual, math comes to the rescue. Stick with me. The 4521 frequency divider exponentially divides the frequency generated by the crystal oscilator by powers of 2. You can see outputs labelled Q18-24. These are the exponents of 2. So Q18 is 218. What it does is divide the frequency from its input by this number and out pops the result on the appropriate pin of the IC. So in the case of Q18: 4,194,304/218 = 16Hz. Get it? Not hard at all. For my 0.5Hz timebase, I used the Q23 pin so: 4,194,304/223 = 0.5Hz. I’ve helpfully labelled the outputs on the schematic for you to show the various output frequencies.

Of course, if you substitute a crystal with a different frequency, you will get different results using the math above proportional to that frequency.

Dummy loads

The need to build everything to have something to calibrate against

In my testing of the pre-regulator, it quickly became obvious that stocking a whole bunch of high power resistors just isn’t feasible. In order for that to work, I would have to have on hand a variety of high power resistors to suit various voltages and currents. In addition to that being a pain, it’s also very hard (and expensive) to find accurate resistors at high power and having to acquire a collection of them is just silly. Since my power supply must be capable of delivering up to 3A at 24Vdc, that means a potential power dissipation of 72 watts! Any resistor I find for that specification (which would be 8Ω) would essentially be a giant heating element and probably have a wide tolerance.

The best solution is to build yet-another piece of test gear: the dummy load. I mentioned before the ever-great Dave Jones of EEVBlog fame has a nice quick video on how to build one. Though this appears to work great, the specifications are a bit wimpy for what I need for this application, and limits possible future applications as well. Dave’s design seems to max out at about 1.335A and I would need more than double that to test my power supply. It also marks the re-appearance of another hassle which has plagued me in current measurements, and that’s finding an adequate shunt resistor(s). Dave’s design uses 10x 10Ω 1% resistors which certainly keeps the math easy, but I’m finding it really hard to find any of them at my local electronics shops! I’ve found 1Ω ones, 0.1Ω ones, but no 10Ω ones to parallel up to make 1Ω. Bummer. This is a job for DigiKey for sure.

Higher power design

Naturally, needing something with a bit beefier spec, I hunt through google looking for similar but higher power capability. I found a really nice one done by Paul Renato and he’s used a similar design to Dave’s but has improved on it quite a bit. For one, he’s upped the current sinking capacity to 7A (I had arbitrarily picked 5A for my needs so this is ample). He’s also made use of the two unused opamps in the LM324 to provide some overload and thermal protection. There are a couple of things I’m not clear on, namely how to select the proper MOV, thermistor, and schottky diode from his schematic. I may have to write him on it. Beauty of his design is he’s already gone to the trouble to whack in as much functionality as possible, which is usually something I do when presented with a project schematic. I can’t think of anything I would add to this one. Brilliant.

Here’s the full article and schematic

So yeah, more parts to acquire and more projects to build. This one definitely looks like a winner and not terribly complicated either. I need to go shopping for MOSFETs and some other choice bits. Ah damn those current shunts! I’ll get those too finally.


The diode close to the power supply appears to be a zener, not a schottky (got me symbols mixed), though why that’s there is a bit of a mystery to me. It could be regulating the 12V input since his photos show him using a wall wart to power the thing. It’s the only imaginable purpose I can come up with. The 10:1 voltage divider used to set the current seems to me to have a max of 1.2V in this case (setting 12A) though he indicates 0.7V (7A) should be max. I assume the overload circuitry is designed to catch the over-current, but I may just tweak the input to be a little friendlier as well as substituting the zener with a proper voltage regulator.

Fried crystals mmmm

Parallel to my power supply project are two others, both requiring an accurate timebase.

These are my nixie tube clock and my frequency counter (which I will probably combine with my function generator that I will also build).

The two, being time-based, are inherently related. The nixie clock happens to use the mains frequency as a timebase and I really do not like the idea of using an un-isolated mains if I can possibly avoid it. The frequency counter schematics I have all seem to use a crystal timebase which seems more logical. After all, if all of our clocks and watches rely on them, why can’t my nixie clock?

With the mind to use the same time base circuit for both projects, I thought I’d quickly whack it up on the breadboard and see what I get.

I first tried the timebase from Miguel Pedroso‘s cmos frequency counter project. I liked the look of this project, as it seemed simpler than the other one I was looking at which looks scanned from an old electronics magazine. Also, it uses the more modern 4000 series cmos chips rather than the 74HC ones (which I am sure are good too). Anyway, his timebase was deceptively simple, involving only a CD4521 24-stage divider, a 4.194304MHz crystal, a trimmer cap, and a 10pF cap. Great, I like simple.

So I build it up and immediately notice something wrong. It’s not oscillating. What’s more, the 7805 regulator powering the thing is heating up, which it most definitely should not. I tried fiddling with it, checking my wiring, swearing at it, nothing worked. It could have been a dodgy trimmer cap or some other mistake of mine, after all Miguel Pedroso seems to have got his working fine and he did warn me the thing was touchy.

Reaching a dead end, I figured I’d try another schematic I found in a forum, which seems to agree with many others I find floating around the internet. Posted here:

1Hz timebase

My sincerest apologies to the original author and the gentleman (or woman) who posted and cleaned it up. I have forgotten where I found it.

Anyway, I build this up and the bloody thing still doesn’t work! On a whim, I swap the crystal out for another one and behold! My ‘scope starts twitching hi and low every second – making a 0.5Hz square wave. Joy.

I tried the original crystal and discovered it is indeed dead. For all I know, it could have always been dead, or it could have been fried due to the absence of resistors connected to the crystal in Mr. Pedroso’s diagram. Either way I got it working!

Even more fun, I noticed the other output pins on the 4521 give you different divisions of time. It appears I can get 0.5Hz, 1Hz, 2Hz etc. Handy!