I feel like I've skipped over several educational touchstones in my Arduino learning process.
When receiving raw sensor data in the 0-1023 range, it can vary wildly, at least to my eyes. What makes it even worse is with a Pixhawk power distribution board I'm trying to use as my power sensors outputs very low level amperage data. We're talking ~20 for just under 2 amps.
The meat of this request is...what filters? How filter? Library filter? Programming filter? Magic physical electrication filters? I've seen capacitors being advised in some topics, and I understand how they level out the peaks and gorges of an alternating signal. I've build lighting and power projects in the past and have literally seen the results. I've tried averaging with programming and seen a more useable result in my pressure reading. But then I've seen libraries used to filter out stuff. The more recent ones were for a power meter build that uses calculus to figure RMS(relatively) and that looked good.
I understand that these tools are all different, but achieve a similar goal. It also makes me wonder why we have so many different ways of reading sensors...but that's another topic. Can anyone give me a crash course on this? I'm hoping this helps anyone else on their journey that's wondering the same thing.
I was wondering if signal output somehow played into it. The Pixhawk board does seem to output in bursts or dumps, I'd see a high level that falls then another high level that falls. Almost like a jagged wave.
It's times like this that I wish I still had full access to an oscilloscope. It's funny how much easier it is to understand something as soon as you see it.
But you know, a logic analyser from say Sparkfun is only about $20 or so, and may be able to give you some info about the timing of the pulses coming out of the PixHawk. Sorry I don't know what protocol they use.
Well, it was sold as outputting for 5v ADC. With it being RC stuff, I just figured it would be "normal", whatever that means. The voltage feels right, outputting proportional levels from the range of voltages I can test with it. I had high hopes because it solved a lot of little nagging issues with this specific use case. Consolidating two sensors into one always sounds good to me. Plus it fed back 5 volts to power the Arduino so I wouldn't need external power.
You know, a simple RC filter with say a 1k resistor and 0.1 uF capacitor (going off the top of my head, so please take it for what its worth) will have a time constant of 100 us and may be all that you need. And sample no faster than every 4-5 time constants.
Luckily I just happen to have that on hand. I'll throw those together and see how it looks later today. Thank you.
And so far I'm shooting for a half second to full second read time. I don't need anything super fast for this. The average run time I'm trying to measure over is 20ish minutes. I don't need too much data.