ADC Noise #524
Replies: 5 comments
-
Posted at 2014-06-10 by @gfwilliams Wow, that's a pretty serious noise issue. What's the other side of the thermistor connected to? GND and 3.3v would be best as that is what the microcontroller is also using. When I was doing the stuff for http://www.espruino.com/Thermistors it was pretty stable. As far as software filters, the simplest is:
But you can also do a median filter, which is the kind that's used for noise reduction in digital cameras, TVs and stuff like that:
Hope that helps! While doing this I found a bug in Float32Array.set, so you won't be able to use that until 1v65 I'm afraid. However if you need floats you can always use the normal Array - it'll just take up a bit more memory. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-06-10 by StuntMonkeh Thanks Gordon that's a huge help. I did manage to get to a reasonable point by logging temperatures to an array. That was until the array got too large and crashed the Espruino! So now when I get to the max array size I 'unshift' the first value off the array. Mode appears to work better than median. I will investigate further using your post above. The noise may be down to the thermistor I am using. I'm using a 10K thermistor with a 10K resistor as the divider all on a small board next to the Espruino. To test the readings I was using a 10K resistor in place of the thermistor so in theory I should be reading bang on 25°C but it was fluctuating around too much. The response doesn't need to be super fast so I think some sort of array and average should work okay. |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-06-11 by StuntMonkeh Well this is slightly embarrassing! |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-06-11 by @gfwilliams :) Ahh, well that's good to hear anyway! Were you running out of memory using Uint16Array from the example? That's quite a big array! |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-06-11 by user6350 You can use a moving average with an interval of 8 or 16 samples .
Input[V] = 0.494 Angle[°] = 15.6 Next reading = 15.6, SMA = 15.6 |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-06-10 by StuntMonkeh
I have a thermistor connected to one of the ADC's but I am having quite a bit of trouble with noise.
As a test I have setup the circuit with another resistor in replacement of the thermistor bead but I cannot seem to get the readings to a stable state. I have in addition tried using a 100nF capacitor across the input which helps to some degree but not enough.
Ideally I would like to stabilise the temp to at least one decimal place.
I would assume some sort of software filter, any suggestions?
Beta Was this translation helpful? Give feedback.
All reactions