Nixie Clock 2: Difference between revisions
No edit summary |
No edit summary |
||
Line 9: | Line 9: | ||
All said and done, I came up with the solution you see here (or, at least you will once I add pictures). | All said and done, I came up with the solution you see here (or, at least you will once I add pictures). | ||
I made a couple mistakes in PCB revision 1: a missing resistor on the I2C bus, and trying to use GPIO15 as the shift register latch pin, without realizing the logic level converter I made pulls it low on startup, not allowing the ESP8266 to boot. I fixed this by cutting the trace and attaching it to another pin. | |||
==Software== | |||
To make the PCB design easier, I drive the tubes "out of order", so I need to shift some bits around before the display comes out looking right. Here's the routine I came up with. It isn't very elegant but gets the job done. | |||
<pre> | |||
void nixie(long k, byte dp){ | |||
byte dig0=(k%10); | |||
byte dig1=(k%100)/10; | |||
byte dig2=(k%1000)/100; | |||
byte dig3=(k%10000)/1000; | |||
byte dig4=(k%100000)/10000; | |||
byte dig5=(k%1000000)/100000; | |||
byte dots=((dp&0b00100000)<<2)+((dp&0b00010000))+((dp&0b00001000)<<3)+((dp&0b00000100)<<1)+((dp&0b00000010)<<4)+((dp&0b00000001)<<2); | |||
shiftOut(srDataPin, srClockPin, MSBFIRST, dots); | |||
shiftOut(srDataPin, srClockPin, MSBFIRST, dig0*16+dig1); | |||
shiftOut(srDataPin, srClockPin, MSBFIRST, dig2*16+dig3); | |||
shiftOut(srDataPin, srClockPin, MSBFIRST, dig4*16+dig5); | |||
digitalWrite(srLatchPin,LOW); | |||
digitalWrite(srLatchPin,HIGH); | |||
} | |||
</pre> | |||
==Files== | ==Files== | ||
* [[File:Nixie2-hardware.zip]] - Hardware files - PCB and STL for case | * [[File:Nixie2-hardware.zip]] - Hardware files - PCB and STL for case |
Revision as of 22:51, 26 October 2019
After completing Nixie Clock 1 over a year ago, I still had an extra set of IN-12B tubes that were not being put to good use. Time to build another one. Actually, I ordered yet more tubes and driver ICs so I could build 3 more.
The basic design is almost the same as Clock 1: Russian IN-12B with a K155D1 driver for each tube, shift registers to run the drivers, and this 180V power supply design. A DS3232M is provided for the RTC. There are a few changes; remembering some lessons learned when I built clock #1, I made the following list of improvements:
- Simpler (or no) sockets. Most of the time towards building the first clock was wiring the 72 pins on the tube sockets. If I could somehow avoid doing that, it would save me lots of time. I ended up using pins from cheap DB25 connectors, which when taken apart (easily) get you 25 pins which are the perfect size to accept the IN-12 pins. They might work for other tubes also.
- PCB for components. After designing some PCBs for some of my other projects, I realized that it really isn't that hard. Having a PCB should make everything smaller and neater, and cut down on assembly time. I made 2 PCBs: one has the power supply, microcontroller, RTC and drivers, and the other serves as the "socket" for the tubes, which plugs into the driver board. This makes for a very compact design for the IN-12 end view tubes, and I could change out the carrier board if I ever want to experiment with other tubes.
- Some kind of case (3D printed) which is easily replicated and doesn't require many hours of hand filing like Clock 1.
- ESP8266 powered. This would give Internet access, and I could also use UDP for some remote control features instead of an IR remote, which would allow greater flexibility when interfacing with other projects, as I have always intended for these displays.
All said and done, I came up with the solution you see here (or, at least you will once I add pictures).
I made a couple mistakes in PCB revision 1: a missing resistor on the I2C bus, and trying to use GPIO15 as the shift register latch pin, without realizing the logic level converter I made pulls it low on startup, not allowing the ESP8266 to boot. I fixed this by cutting the trace and attaching it to another pin.
Software
To make the PCB design easier, I drive the tubes "out of order", so I need to shift some bits around before the display comes out looking right. Here's the routine I came up with. It isn't very elegant but gets the job done.
void nixie(long k, byte dp){ byte dig0=(k%10); byte dig1=(k%100)/10; byte dig2=(k%1000)/100; byte dig3=(k%10000)/1000; byte dig4=(k%100000)/10000; byte dig5=(k%1000000)/100000; byte dots=((dp&0b00100000)<<2)+((dp&0b00010000))+((dp&0b00001000)<<3)+((dp&0b00000100)<<1)+((dp&0b00000010)<<4)+((dp&0b00000001)<<2); shiftOut(srDataPin, srClockPin, MSBFIRST, dots); shiftOut(srDataPin, srClockPin, MSBFIRST, dig0*16+dig1); shiftOut(srDataPin, srClockPin, MSBFIRST, dig2*16+dig3); shiftOut(srDataPin, srClockPin, MSBFIRST, dig4*16+dig5); digitalWrite(srLatchPin,LOW); digitalWrite(srLatchPin,HIGH); }
Files
- File:Nixie2-hardware.zip - Hardware files - PCB and STL for case