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 > > 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 > > On Jun 6, 1:53 am, Dekatron42 <martin.forsb...@gmail.com> wrote: > > > > > > > > > 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 > > > On 6 Juni, 00:04, Cobra007 <mic...@xiac.com> wrote: > > > > 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 > > > > On Jun 5, 11:42 pm, Tobias <tobiasmu...@gmail.com> wrote: > > > > > 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 > > > > > On 5 jun, 04:14, Cobra007 <mic...@xiac.com> wrote: > > > > > > > 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 -- You received this message because you are subscribed to the Google Groups "neonixie-l" group. To post to this group, send an email to neonixie-l@googlegroups.com. To unsubscribe from this group, send email to neonixie-l+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/neonixie-l?hl=en-GB.