Nixie multimeter

224 views
Skip to first unread message

Tobias

unread,
May 31, 2012, 11:58:15 AM5/31/12
to neonixie-l
Hello, I am new to this group and I would like to introduce myself
with a project that I have been working on.

This is my attempt to create a DMM using IN-12s, a IN-15A and a IN-15B
as display. I used my nixie clock board as base, so it can double as a
clock when not used as multimeter =)

http://tobiasmugge.files.wordpress.com/2012/05/dscn4039.jpg
http://tobiasmugge.files.wordpress.com/2012/05/dscn4034.jpg

The uC is a Atmel Atmega328p. I downloaded arduino bootloader on it.
I am using supertex HV5522 as drivers for the nixies. Two of them for
64bits. A friend of mine wrote a library for it that includes
brightness control via the HV5522 blank pin. He is currently
programming the clock while I work on the DMM.

Power consumption is around 3W. DC power supply from 9 to 12V. The
voltage for the tubes is boosted from the input voltage using a switch-
mode power supply based on the TubeHobby one.

The pictures and video shows voltage reading: is the only measurement
I implemented on the software so far. Still thinking how to approach
the scales/units.

I have a shunt resistor on the board and I plan on having voltage,
current, power, frequency and duty cycle for DC. I am using a I2C A/D
with a PGA, measuring voltage on both sides of the shunt. This was a
fairly cheap solution, but the way I did it only works for DC and the
range is 0 to 32V. But allows me to measure current and voltage at the
same time =)

I have a video of the thing working: http://www.youtube.com/watch?v=PNYnFTeADow
The maximum error I measured was 1,2% when comparing to my not-that-
bad-multimeter.

I plan on implementing resistance, capacitance, inductance and AC
voltage/current capabilities. Suggestions will be greatly appreciated!

The IN-15A showed on the pictures is not fully lightened. I am
following Nick suggestion to burn it at 6mA for one hour. So far so
good.

I am still trying to find some IN-12B as those include the dot. I do
have 4 bits free on the HV5522 that I could use to drive IN-12B dots
or INS-1.

Bill van Dijk

unread,
May 31, 2012, 2:07:07 PM5/31/12
to neoni...@googlegroups.com
Hi Tobias,

Welcome!

Great project. Here is a vendor I have used that has the IN12B for a very
reasonable price (12 for $17.95), including sockets:

http://www.ebay.ca/itm/x12-IN-12-B-IN-12B-Nixie-Tubes-sockets-NOS-/190675257
528?pt=Vintage_Electronics_R2&hash=item2c652188b8

Good luck, Bill
> --
> You received this message because you are subscribed to the Google
> Groups "neonixie-l" group.
> To post to this group, send an email to neoni...@googlegroups.com.
> To unsubscribe from this group, send email to neonixie-
> l+unsu...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/neonixie-l?hl=en-GB.
>
> -----
> No virus found in this message.
> Checked by AVG - www.avg.com
> Version: 2012.0.2176 / Virus Database: 2425/5036 - Release Date:
> 05/31/12

Nick

unread,
Jun 1, 2012, 2:30:25 AM6/1/12
to neoni...@googlegroups.com
Hi Tobias and welcome...

Nice project - glad the cathode poisoning issue has been resolved - its looking good.

Keep the thread updated with how you progress on the ESR and LCR front!

Cheers

Nick

jb-electronics

unread,
Jun 1, 2012, 4:42:38 AM6/1/12
to neoni...@googlegroups.com
Hello Tobias,

nice project! I would very much like to see how this evolves.

But just one thing: You mention you measure voltage before and after the
shunt to get a current reading. This sounds to me like you are wasting a
lot (!) of ADC resolution for that fact because you would always
subtract two voltages who are roughly of the same magnitude.

Ever thought about an instrument amplifier (very sensitive differential
amplifier) across the shunt? You could also use some current sense ICs
who have all of these included (Linear Technologies has a lot of them).

Jens

Tobias

unread,
Jun 3, 2012, 7:05:21 PM6/3/12
to neonixie-l
Thank you all =)

For the past couple days we have been working on the user interface.
This is the result do far:
http://www.youtube.com/watch?v=NwBKmTFYuQk

The rotary encoder changes between the different measurements. As I
add more features I can just add more cases to the loop, making it
easy at the software.

Bill: Vitaly wrote me a email offering some for sale. Lets see how
this turns out. Otherwise I will go to ebay. Your link came back "Item
190675257 is no longer available." Do you remember the name of the
seller?

Jens: I am still studying how to approach other measurements, but I am
happy with the results so far. I think I failed on explaining how I am
doing it. Take a look at the INA219. It is the one I am using. For
less than $3,00 I gave it a shot and it works quite nice. "The INA219
senses the small drop across the shunt for shunt voltage, and senses
the voltage with respect to ground from VIN– for the bus voltage". It
looks like the hobbyists are just starting to use it, or my google
skills are quite modest, because I could not find anything better than
the datasheet. Anyway I ended up drawing the component at eaglecad and
writing the library for the arduino.

I am trying some R and C measuring designs on the breadboard but
nothing too promising so far.

A box is on the way. At least is on the paper.
http://tobiasmugge.files.wordpress.com/2012/06/nixieatmegav3.png
http://tobiasmugge.files.wordpress.com/2012/06/nixieatmegav3_frontal.png
http://tobiasmugge.files.wordpress.com/2012/06/nixieatmegav3_lateral.png

Tobias

jb-electronics

unread,
Jun 4, 2012, 4:39:33 AM6/4/12
to neoni...@googlegroups.com
Tobias,

the INA219 is amazing! Do you know if there are any breakout boards for
2.54mm pcbs?

Jens

> Thank you all =)
>
> For the past couple days we have been working on the user interface.
> This is the result do far:
> http://www.youtube.com/watch?v=NwBKmTFYuQk
>
> The rotary encoder changes between the different measurements. As I
> add more features I can just add more cases to the loop, making it
> easy at the software.
>
> Bill: Vitaly wrote me a email offering some for sale. Lets see how
> this turns out. Otherwise I will go to ebay. Your link came back "Item
> 190675257 is no longer available." Do you remember the name of the
> seller?
>
> Jens: I am still studying how to approach other measurements, but I am
> happy with the results so far. I think I failed on explaining how I am
> doing it. Take a look at the INA219. It is the one I am using. For
> less than $3,00 I gave it a shot and it works quite nice. "The INA219
> senses the small drop across the shunt for shunt voltage, and senses
> the voltage with respect to ground from VIN� for the bus voltage". It

Cobra007

unread,
Jun 4, 2012, 4:52:35 AM6/4/12
to neonixie-l
Nice project!

You could make a real true RMS meter with this by implementing the RMS
integral in your uC if it is fast enough. I would like that better
than other methods some "true RMS" DMMs use.

Michel





On Jun 4, 6:39 pm, jb-electronics <webmas...@jb-electronics.de> wrote:
> Tobias,
>
> the INA219 is amazing! Do you know if there are any breakout boards for
> 2.54mm pcbs?
>
> Jens
>
>
>
>
>
>
>
> > Thank you all =)
>
> > For the past couple days we have been working on the user interface.
> > This is the result do far:
> >http://www.youtube.com/watch?v=NwBKmTFYuQk
>
> > The rotary encoder changes between the different measurements. As I
> > add more features I can just add more cases to the loop, making it
> > easy at the software.
>
> > Bill: Vitaly wrote me a email offering some for sale. Lets see how
> > this turns out. Otherwise I will go to ebay. Your link came back "Item
> > 190675257 is no longer available." Do you remember the name of the
> > seller?
>
> > Jens: I am still studying how to approach other measurements, but I am
> > happy with the results so far. I think I failed on explaining how I am
> > doing it. Take a look at the INA219. It is the one I am using. For
> > less than $3,00 I gave it a shot and it works quite nice. "The INA219
> > senses the small drop across the shunt for shunt voltage, and senses
> > the voltage with respect to ground from VIN for the bus voltage". It

Grahame Marsh

unread,
Jun 4, 2012, 6:11:24 AM6/4/12
to neoni...@googlegroups.com
On 04/06/2012 00:05, Tobias wrote:
>
> I am trying some R and C measuring designs on the breadboard but
> nothing too promising so far.
>
>

Tobias,

For capacitance you might look at these Elektor projects:

Low range
http://www.elektor.com/magazines/2011/april/pico-c.1738839.lynkx?tab=1

High Range
http://www.elektor.com/magazines/2003/february/autoranging-capacitance-meter.55025.lynkx

In both cases they are not much more than a TLC555 timer (the design is
a bit fussy on which manufacture's 555 is used) that the controller
measures the period of and then calculates the capacitance.

Project is looking good...

Grahame

Tobias

unread,
Jun 4, 2012, 8:11:37 AM6/4/12
to neonixie-l
Thanks everyone.

jb-electronics: I draw my one, including the fuse and the shunt with
traces for up to 5A continuous, filter following datasheet
recommendation, i2c address smd jumpers and connectors for power and
i2c.
are you at Germany or the US? Take a look at the photo and let me know
if you are interested. We can work something out.
http://tobiasmugge.files.wordpress.com/2012/06/dscn4054.jpg
http://tobiasmugge.files.wordpress.com/2012/06/dscn4053.jpg

Cobra007: I can definitely try that out! I know how the math should
look like on the paper, but I have no idea how to implement this on
the controller. I would think it uses a time interrupt to capture the
measurements at at pre-defined rate, log some of the last readings..
and then what? If you give me some hint regarding a C implementation
of the math I can start working on that! =)
I searched for an arduino implementation but I could not find one that
made me happy.

Grahame: Nice, they even give you the source code! I'll have to login
and take a look =)



On 4 jun, 06:11, Grahame Marsh <grahame.ma...@googlemail.com> wrote:
> On 04/06/2012 00:05, Tobias wrote:
>
>
>
> > I am trying some R and C measuring designs on the breadboard but
> > nothing too promising so far.
>
> Tobias,
>
> For capacitance you might look at these Elektor projects:
>
> Low rangehttp://www.elektor.com/magazines/2011/april/pico-c.1738839.lynkx?tab=1
>
> High Rangehttp://www.elektor.com/magazines/2003/february/autoranging-capacitanc...

Cobra007

unread,
Jun 4, 2012, 6:42:01 PM6/4/12
to neonixie-l
You should capture your measurements in an interrupt routine, maybe
8192 or 16384 times per second. Square them and add them to a
summarizing register (choose 32 bits). Then once every second, divide
the summarizing register by 8192 (or 16384) which is the same as
shifting them right by 13 or 14 bits and then take the square root
from this number.

It would look like:
sum += sqr(measurement)

then once a second:
result = sqrt(sum >> 13); sum = 0;

Dependent on your A/D resolution, you may have to divide the
measurement by 2 or 4 to avoid the sum to overflow (like sum +=
sqr(measurement >> 1). You could also calculate the result twice per
second to avoid overflow.

That is pretty much it, I think.

Michel




On Jun 4, 10:11 pm, Tobias <tobiasmu...@gmail.com> wrote:
> Thanks everyone.
>
> jb-electronics: I draw my one, including the fuse and the shunt with
> traces for up to 5A continuous, filter following datasheet
> recommendation, i2c address smd jumpers and connectors for power and
> i2c.
> are you at Germany or the US? Take a look at the photo and let me know
> if you are interested. We can work something out.http://tobiasmugge.files.wordpress.com/2012/06/dscn4054.jpghttp://tobiasmugge.files.wordpress.com/2012/06/dscn4053.jpg

Tobias

unread,
Jun 4, 2012, 11:08:11 PM6/4/12
to neonixie-l
Michel

I found on google that the i2c speed for the atmega (at least the ones
running arduino) is around 4705 bytes per second. The INA219 requires
2 bytes to be read each time.
Unfortunately this is way less than 8192 Hz already.
If I understood the INA219 datasheet correctly, the A/D frequency for
10 bits is < 7 kHz, so even if one can implement a faster i2c it will
still be less then ~8 kHz.

If using the A/D pins on the atmega it gets even worse: less than 5
kHz.

So I decided to test speed first, before implementing a rectifier on
my circuit. I wrote a simple code to make 1000 readings and display
the time it took to make it. I am pasting the code at the end of the
message just in case someone finds this absurd and is willing to check
how I did it. Of course I used the nixies instead of a boring console
terminal to display the results:
http://tobiasmugge.files.wordpress.com/2012/06/dscn4055.jpg

1.125 ms to read the i2c, do the square sum and watch for the encoder.
1.114 ms to read the i2c and do the square sum.
0.554 ms to just read the i2c. Or 1,8 kHz. Not that far from the value
I found as max on the internet.

So less than 900 Hz. Or 14 points during the period of a 60 Hz signal.
Is that enough information for a 60 Hz signal?

The code:

case 3:
      unit = 4;
      scale = 6;
      reading = millis();
      for (int x = 0; x < 1000; x++){
      //result = r.process(); //reads encoder
      //if (result && (result == DIR_CW ? ++state : --state) > 3)
state = 0; //switches between the cases
      //sum += sq(dmm.getBusVoltage());
      result = dmm.getBusVoltage(); //reads the two bytes from the
INA219 and performs basic conversion to get value in mV.
      }
      reading = millis() - reading;

After that I just show the reading+scale+unit at the screen

Tobias


On 4 jun, 18:42, Cobra007 <mic...@xiac.com> wrote:
> You should capture your measurements in an interrupt routine, maybe
> 8192 or 16384 times per second. Square them and add them to a
> summarizing register (choose 32 bits). Then once every second, divide
> the summarizing register by 8192 (or 16384) which is the same as
> shifting them right by 13 or 14 bits and then take the square root
> from this number.
>
> It would look like:
> sum += sqr(measurement)
>
> then once a second:
> result = sqrt(sum >> 13); sum = 0;
>
> Dependent on your A/D resolution, you may have to divide the
> measurement by 2 or 4 to avoid the sum to overflow (like sum +=
> sqr(measurement >> 1). You could also calculate the result twice per
> second to avoid overflow.
>
> That is pretty much it, I think.
>
> Michel
>
> On Jun 4, 10:11 pm, Tobias <tobiasmu...@gmail.com> wrote:
>
>
>
>
>
>
>
> > Thanks everyone.
>
> > jb-electronics: I draw my one, including the fuse and the shunt with
> > traces for up to 5A continuous, filter following datasheet
> > recommendation, i2c address smd jumpers and connectors for power and
> > i2c.
> > are you at Germany or the US? Take a look at the photo and let me know
> > if you are interested. We can work something out.http://tobiasmugge.files.wordpress.com/2012/06/dscn4054.jpghttp://tob...

David Forbes

unread,
Jun 4, 2012, 11:53:57 PM6/4/12
to neoni...@googlegroups.com
On 6/4/12 8:08 PM, Tobias wrote:
> Michel
>
> I found on google that the i2c speed for the atmega (at least the ones
> running arduino) is around 4705 bytes per second. The INA219 requires
> 2 bytes to be read each time.
> Unfortunately this is way less than 8192 Hz already.
> If I understood the INA219 datasheet correctly, the A/D frequency for
> 10 bits is< 7 kHz, so even if one can implement a faster i2c it will
> still be less then ~8 kHz.
>

Not to worry! The INA219 has a built-in sample averaging mechanism.

You can ask it to take up to 128 samples and average them to produce one
number to receive over the I2C bus.

--
David Forbes, Tucson AZ

Cobra007

unread,
Jun 5, 2012, 12:38:19 AM6/5/12
to neonixie-l
> Not to worry! The INA219 has a built-in sample averaging mechanism.
>
> You can ask it to take up to 128 samples and average them to produce one
> number to receive over the I2C bus.
>
> --
> David Forbes, Tucson AZ

That won't be of much help as you need the average over the squared
samples, not the average over the samples themselves.

Michel

Cobra007

unread,
Jun 5, 2012, 12:45:34 AM6/5/12
to neonixie-l
Yeah, that seems a bit slow indeed. I would normally program that in
assembler but maybe the 16x16 squaring is taking a bit of processing
time. If you would do that interrupt based, it is most likely going to
chew up a bit more capacity as well.

900 samples per second .... 15 samples of a 60Hz signal, doesn't sound
like much. Maybe sample 2 seconds or 4 seconds to get a better
average?

Michel

Cobra007

unread,
Jun 5, 2012, 1:22:37 AM6/5/12
to neonixie-l
You should also try to avoid doing anything else but the absolute
necessity in your loop.

I think you can write a second routing dmm.getBusVoltageFast(), that
does nothing more than the absolute necessity, which is reading the 2
bytes from the INA219. No conversion or anything else needs to be done
at his stage, just read the 2 bytes and square them as quick as you
can.

You could optimize your routine like this:

for (int x = 0; x < 1000; x++){
//sum += sq(dmm.getBusVoltageFast());
}

Nothing more, just that because anything else you put there is going
to be done 1000 times and chewing up time. Making
dmm.getBusVoltageFast a local procedure will also make it faster to
call than a procedure of an object. Writing it as z=getBusVoltageFast;
z *= z will most likely also be faster than sq(getBusVoltageFast), try
it out!

I think you can get double the speed if you optimize it properly.

You don't need to check the state of the encoder 1000 times per
second, just once or twice a second will be just fine.

Michel

David Forbes

unread,
Jun 5, 2012, 2:25:31 AM6/5/12
to neoni...@googlegroups.com
The way to do this properly, as in how a real DMM does it, is to use a
dual-slope converter that will produce a useful number with every sample.

These successive approximation converters that are common as dirt these
days are just not very good at the job of converting a signal and
producing a useful number.

Cobra007

unread,
Jun 5, 2012, 4:14:32 AM6/5/12
to neonixie-l
>
> The way to do this properly, as in how a real DMM does it, is to use a
> dual-slope converter that will produce a useful number with every sample.
>
> These successive approximation converters that are common as dirt these
> days are just not very good at the job of converting a signal and
> producing a useful number.
>
> --
> David Forbes, Tucson AZ

DMMs with true RMS measurements have been discussed here before, but
the only proper way to measure true RMS is by following it's
definition.

My DMM is also true RMS, but really, any DC voltage shows as 0V RMS
which is by definition incorrect. Leaving out the DC component means
including a high pass filter, but they are not ideal, so for any
frequency below the specified frequencies, you cannot rely on the RMS
reading. Following this integral and squaring method should produce a
reliable reading from 0Hz up to a certain frequency.

Michel

Tobias

unread,
Jun 5, 2012, 9:42:16 AM6/5/12
to neonixie-l
David: I am using the INA219 averaging at 128 samples. It is a very
good feature indeed. We are trying to get a library together with all
the functions so we can switch back and forth between some of the
features depending on what is being read from it.

Michel: Tests are done! I found a faster way to do the i2c. And your
math worked great reducing processing time!
I tried to run the encoder function once in a while but it did not
work. Lets say was a mistake not to put a interruption pin on my IO
header.

Just i2c get bus voltage:     193 ms
Using sq() function:            388 ms
Using z*=z then summing: 196 ms
Including encoder z*=z:      207 ms

At 207 ms for a thousand readings we have 4.8 kHz, or 80 points for a
60Hz sine. =)
I think I will finish up the code and try to take some measurements.

You say doing time interrupt is going to slow this down. What about
counting all the 1000 readings and dividing by the time it took to
make them? Not a good idea?

Tobias

Cobra007

unread,
Jun 5, 2012, 6:04:19 PM6/5/12
to neonixie-l
That is a fabulous result!

I think I would do the same thing, take the 1000 readings non-
interrupt based. See how accurate it is, otherwise take 2000 samples,
or 3000 which will only take 0.5 seconds.

Let us know the result, measure sine waves, triangular waves and
square waves.

Michel

Dekatron42

unread,
Jun 6, 2012, 4:53:36 AM6/6/12
to neonixie-l
Don't forget to measure half-wave rectified signals to see what
results you get (square, sine and triangular) as that is something
that many RMS meters fail on.

/Martin

Tobias

unread,
Jun 9, 2012, 3:57:31 PM6/9/12
to neonixie-l
Gentlemen

After a very long week I am happy to say that the last three hours
playing with my Nixie Multi Meter were very rewarding!
We finished the code.

The long sum was overflowing after 500 or so measurements, so I had to
divide it by 10 before squaring it. The final result shown on the
serial monitor is in centivolts, if that makes any sense.

I did only two experiments so far: using a 1,5V cell showed.. 1,52V!
and my DMM showed 1,523V. Not bad.
And the one Martin proposed. Awesome results. A little transformer
being half-wave rectified.

I took a oscilloscope shot of it that includes a RMS reading of 5,38
V:
http://tobiasmugge.files.wordpress.com/2012/06/rms_waveform.png

Then my NMM, doing 512 samples in ~254 ms: 5,35 V, with a 0,05 V
variation measurements.
http://tobiasmugge.files.wordpress.com/2012/06/rms_reading_512.png

And @ 1024 samples in ~374 ms: 5,34 V with 0,03V variation between
measurements.
http://tobiasmugge.files.wordpress.com/2012/06/rms_reading_1024.png

My RMS(!) DMM was reading 3,635 V! +_+

I will write a piece of code that changes between the averaging
function David talked about and the 10bits no-averaging mode AD for
the RMS measurement.

Now I think I need to build a precision rectifier for the input, so I
can read AC voltages.

Thanks everybody!

Tobias

Cobra007

unread,
Jun 9, 2012, 7:37:55 PM6/9/12
to neonixie-l
That sounds awesome!

I just wonder why your summing register would overflow after 500
samples. If you have a 10 bit A/D converter, summing 500 squared
samples would only require 29 bits. That is a very odd number, so
there must be something wrong here. Is the 10 bit value a signed value
or unsigned?

You should define z as a double (32 bit) and also your summing
register as a double. Then you should have enough bits for 4096
samples.

Anyway even with just 500 samples, it is clear that the measurement is
far superior to your DMM measurement (which was to be expected).

Michel


On Jun 10, 5:57 am, Tobias <tobiasmu...@gmail.com> wrote:
> Gentlemen
>
> After a very long week I am happy to say that the last three hours
> playing with my Nixie Multi Meter were very rewarding!
> We finished the code.
>
> The long sum was overflowing after 500 or so measurements, so I had to
> divide it by 10 before squaring it. The final result shown on the
> serial monitor is in centivolts, if that makes any sense.
>
> I did only two experiments so far: using a 1,5V cell showed.. 1,52V!
> and my DMM showed 1,523V. Not bad.
> And the one Martin proposed. Awesome results. A little transformer
> being half-wave rectified.
>
> I took a oscilloscope shot of it that includes a RMS reading of 5,38
> V:http://tobiasmugge.files.wordpress.com/2012/06/rms_waveform.png
>
> Then my NMM, doing 512 samples in ~254 ms: 5,35 V, with a 0,05 V
> variation measurements.http://tobiasmugge.files.wordpress.com/2012/06/rms_reading_512.png
>
> And @ 1024 samples in ~374 ms: 5,34 V with 0,03V variation between
> measurements.http://tobiasmugge.files.wordpress.com/2012/06/rms_reading_1024.png
Reply all
Reply to author
Forward
0 new messages