Nixie Tube Clock
Team Members
- Hunter Wardlaw
- Liam King
Overview
For our project we designed a 24-hour Nixie tube alarm clock with the mbed LPC1768. The clock features a programmable alarm as well as a backup battery supplied by a supercapacitor to maintain the real time clock (RTC) in the event of power loss. Each Nixie tube is driven by 10 high voltage transistors, each connected to a BCD (binary coded decimal) decoder. Each decoder is sent the number to be displayed in BCD with four digital out pins on the mbed (expect the leftmost tube). The Nixie tubes are powered by a 170V power supply fed by a 12V wall adapter. Although the mbed is capable of running off of 12V it is above the recommended operating voltage, so a 5V buck converter was used to power the mbed and all other non-high voltage circuitry. A two-way toggle switch is used to enter the set current time state, and a three-way toggle switch is used to alternate between alarm on, alarm off, and alarm time set states.
Components
- mbed LPC1768 (1)
- IN-12 Nixie tubes (4)
- High voltage transistors (32)
- BCD decoders (3)
- 33kohm anode resistors (4)
- 10kohm resistors (21)
- 5V supercapacitor
- Pushbuttons (4)
- Two-way toggle switch
- Three-way toggle switch
- Diode
- 170V power supply
- 12V wall adapter
- 5V buck converter
- Speaker
- Audio amplifier
Functionality
The clock accurately keeps time, allows setting of the current time, setting of an alarm time, and the ability to toggle the alarm on and off. The alarm will play if set to on and plays a loud, alternating tone. The alarm times out after 60 seconds if no action is taken. The three-way alarm switch can be switched to off to turn off the alarm, or any other four pushbuttons can be used to snooze the alarm for five minutes.
Power Setup
The nixie tubes require 170 volts to operate. This is generated by the high voltage power supply, which takes in 12 volts from the wall adapter. The 12 volts is used with a 5V buck converted to give 5 volts to the mbed and its peripherals. The 5 volts also powers the backup supercapacitor, which keeps the RTC powered in the event of a power loss. The diodes prevent the supercapacitor from attempting to power the mbed itself.
BCD chips
| mbed | Left Hour Digit | BCD(Right Hour Digit) | BCD(Left Minute Digit) | BCD(Right Minute Digit) |
|---|---|---|---|---|
| p9 | D | |||
| p10 | C | |||
| p11 | B | |||
| p12 | A | |||
| p13 | D | |||
| p14 | C | |||
| p15 | B | |||
| p16 | A | |||
| p17 | D | |||
| p18 | C | |||
| p19 | B | |||
| p20 | A | |||
| p22 | T1 | |||
| p23 | T2 |
Each Nixie tube, except fro the leftmost hour tube, is driven by high voltage transistors controlled by a BCD decoder. This is not needed for the leftmost tube, as it only displays the digits 1 and 2. Thus, they are controlled directly by the mbed. Each output pin on the mbed has a resistor in series to limit current.
Buttons and Switches
| mbed | B1(Hour Up) | B2(Hour Down) | B3(Minute Up) | B4(Minute Down) | 3 pos switch | 2 pos switch |
|---|---|---|---|---|---|---|
| Vout | + | + | + | + | + | + |
| p24 | - | |||||
| p25 | - | |||||
| p26 | - | |||||
| p27 | - | |||||
| p28 | - | |||||
| p29 | - | |||||
| p30 | - |
Class D Audio Amp
| mbed | TPA2005D1 | Speaker |
|---|---|---|
| 5V(external) | pwr+ | |
| Gnd | pwer-, in- | |
| P18 | in+ | |
| out+ | + | |
| out- | - |
Code Snippet
void wakeUp() {
int i = 0;
struct tm* clock;
speaker.period(1.0/700.0);
// Play tone until disabled or timeout
while (switchAlarmOn && (i < 6000)){
speaker = .5;
i++;
time_t currTime = time(NULL);
clock = localtime(&currTime);
setDigits(clock);
// Alternate tone
if (i%50 < 25)
speaker.period(1.0/700.0);
else
speaker.period(1.0/500.0);
// Snooze
if (buttonMinUp || buttonMinDown || buttonHourUp || buttonHourDown) {
speaker = 0;
i = 0;
for (int j = 0; j < 30000; j++) {
time_t currTime = time(NULL);
clock = localtime(&currTime);
setDigits(clock);
wait(.01);
}
}
wait(.01);
}
speaker = 0;
wait(2);
return;
}
int main() {
alarmTime->tm_hour = 12;
struct tm* clock;
while(1) {
// Get current time
time_t currTime = time(NULL);
clock = localtime(&currTime);
setDigits(clock);
// Check if additional action needed
if (switchAlarmSet)
setAlarm();
if (switchTimeSet)
setTime();
if (switchAlarmOn && clock->tm_hour == alarmTime->tm_hour && clock->tm_min == alarmTime->tm_min && clock->tm_sec == alarmTime->tm_sec)
wakeUp();
wait(.2);
}
}
Import programfinal_24
24 hour nixie tube clock
Please log in to post comments.
