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 <[email protected]> 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 > > 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 <[email protected]> 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... > > > 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 -- You received this message because you are subscribed to the Google Groups "neonixie-l" group. To post to this group, send an email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/neonixie-l?hl=en-GB.
