I am building a numitron clock with 4 IV-9 numitrons. I use one pin of the battery backed ATtiny84 to detect whether the main power is on. If not, the MCU goes into power saving mode.
This works nicely, but I thought it could be done in a better way, giving the pin some more functionality, aside from just detecting a logical state change.
Since numitrons, unlike digitrons, can fail in ways that are not that obvious (for example when the middle segment wears out, then the number 8 looks like a 0), I wanted to make the pin measure the amount of current the numitron display draws. This way I can not only say whether the mains power is on or not but also I can tell whether the current consumption of the display is in the expected range. By turning individual numitrons on, I can also tell which numitron is faulty.
I ended up with this simple circuit which measures the voltage drop on a 1 Ohm resistor connected between the display and ground.
The problem with this approach is that in order for the 10 bit ADC to detect individual segments (each drawing around 15-20mA) there has to be a large voltage drop when all the segments are lit. So basically this makes the brightness of the clock inversely proportional to the number of segments lit. Which is quite noticeable, especially in edit mode where the decimal point is blinking to mark the selected digit (pulsing the whole clock display).
Are there any ways to accomplish something like this without the voltage drop while keeping the clock relatively simple?
If you really are concerned about detecting segment failure, the more sensible approach is to have the clock briefly display "8888" on startup, and/or on some regular basis.
add an LDR / photoresistor nearby (one per Numitron) and iterate over all the segments.
start with no segments to get a reference reading for "darkness".
light up the segments one after another, should be sufficient different from the reference.
As you have 4 Numitrons with 7 (?) segments you need 4x 8 readings (incl reference).
An ADC reading takes a few millis so should be possible to check in a second
(or at least in a second per Numitron)
Alternative
You can check the LDR when the digit changes. Use the previous value as reference.
It is possible to do this check continuously.
Drawback is that the 10 hour Numitron is only checked a few times per day.
Add also a link to your stack exchange post (I can't immediately find it) because it contains additional information. Clearly, in this case, the Arduino forum is a better fit for such a project wide assessment such as this.
This is a very simple software based solution, and I was considering something like that. I am just not sure about the frequency. Because making it too frequent makes it annoying and also ironically lowers the overall life expectancy of the segments, while making it too occasional misses the point.
Informing the MCU about the failure has the advantage that the MCU can disable the failed numitron so immediately after something odd is detected, it's clear what is wrong with the clock (exept when the first digit (from the left) is faulty since leading zero is not being displayed, but usually this is not a problem since the first numitron should wear the last, because of it's limited usage).
Anyway, I will definitely try to implement the "all segments lit up at start" function for targeted diagnostics at least.
This is an interesting idea. However, it looks like it would require at least 2 free pins which I currently do not have (maybe it's time to finally move to a bigger MCU...).
Also the way the case is designed would only allow the photoresistors to be placed directly under the numitrons, so the lower segments would affect the photoresistor significantly more than the higher ones, but that is not something that couldn't be counted with.
Talking about "sensors", I was thinking how viable it would be to detect the magnetic field generated by the current going to the numitron display. In combination with some kind of an amplifier it could make for an interesting solution as well
If numitron tubes degrade so that the light level of their segments is reduced, is there also a corresponding reduction in the power consumption of the segments or is this just an assumption ? Anyway, I am wondering about the benefits of an automatic detection system when it would be obvious to someone looking at the clock that say it becomes difficult to distinguish between a '0' and an '8' or '1' and '7' etc. It is not as if you can take any automatic action in this case such as changing the duty cycle of a PWM controlled supply to compensate.
I have not thought about this type of a degradation. I do not have any experience with such behavior of those filaments. What I meant by failure in the original post is the complete burn out of the filament, where it basically breaks in a half, so there is no current at all.
The other type of failure (extreme), although much less likely, could be caused by incorrectly socketed tubes, where the common wire is accidentally connected with one or more of the segment wires. This would probably shorted the circuit, since the filament wires, when they are active, act as ground with the resistance of the register's drains (around 5 Ohm for TPIC6B595N) being the only obstacle in the way.
OK. I see now you are only interested in complete filament failure. I thought by "wears out" you meant something more gradual.
A break could of course happen at any time. A simple, regular scan of each segment individually, using the analog voltage measurement already suggested, seems the easiest approach so the clock would occasionally show a strange pattern.
On Nixie clocks this is also inevitable as the cathode anti poisoning routine runs and special patterns appear to stress each digit.
Probably, the commons of the tubes would be effectively connected together and then, via the suggested 1 ohm resistor, to the positive power rail so only 1 analog pin would be required.
I can't see how you could arrange a filament integrity test during normal clock operations, in a practical way, without the user noticing anything.
If you wanted to do current detection, You could use a current sense amplifier to provide feedback with a lower voltage drop.
Something like 100mV across the shunt at full current for example, the output of the amp would be a fucntion of this and could be for example 1A = 1V out but the drop is still 100mV ;
Something like lighiting up a single 7 segment display and checking expected current and repeat for the other three displays. Given an open segmet would result in no current you should see that between expected current and messured current if you did multiple segments at once or worst case test each segment individually ; its not something that would need to be do very often.
I personally use a I2C battery fuel guage chip with a 0.01 ohm shunt ( 10mV @ 1A ) to messure voltage and currents in a few of my numitron builds ; but I am using constant current I2C LED drivers that have open LED detection though I have not implemented that as of yet.
If you messured global current to the displays during normal time display operation and counted the expected lit segemnts ( You would know this based on the numbers its supposed to display ) and messured the current ; you could compare the messured to expected current and hopfuly detect a differance. Since this is 4 digit you are only updating every minuet so plenty of time to read the global current a few times and compare.
I still, for some reason, have this misconception that a numitron segment draws significantly higher current than an LED so that LED drivers cannot be used to drive numitrons. But actually the current drawn is pretty much comparable to the one of the LEDs except that you have to account for surge currents when the filaments are cold (much less resistive).
After some searching, I have found the TLC5916IN, which seems to be a quite decent driver that could potentially work with my IV-9 numitron tubes and it also provides some error code register. I am just not sure about the PWM fading, do you implement something like that in your own builds? Also in that case, is there actually any reason or advantage to use raw registers instead of the drivers? I have opted for them based on some other popular hobby builds out there.
Anyway, it's nice to meet a fellow numitron enthusiast
The LED drivers are constant current so there is no surge current as the driver will maintain a constant current regardless.
There are a handful of multi channel LED drivers that are happily rated to 30mA or more per channel ; more than enough to run a numitron.
I am using the PCA9955BTWJ ; 16 Channel driver rated to 57mA per channel with channel and global PWM dimming. Personally now I see no reason to use normal Shift registers in this case, With channel and global PWM dimming and constant current these LED drivers are suited to run numitrons quite well with some flexibility.
I keep off segments dim with channel PWM to keep them warm to minimize thermal swings, though not needed, could be set lower too in my case But I liked the visual look.
Plus as they are I2C based in my case I can use just 2 Pins to talk to all the temp sensors, RTC and fuel gauge IC's and LED drivers I have without added pins needed.
Same ^ , Nice to see other old display tech enthusiasts
Just showing that the multi channel constant current drivers do work, They are linear so do generate some heat as expected, minimal drop over them helps avoid this.