Freesteel Blog » Electrical noise on the temperature sensors

Electrical noise on the temperature sensors

Friday, May 15th, 2015 at 12:17 pm Written by:

Last year I discovered interference issues with the barometric sensor, which I solved by stashing the sensor on a separate board with its own microcontroller and power supply and communicating back via an optocoupler in a way no electrical engineer would find acceptable.

Now I have finally got an understanding of the noise visible on my accurate temperature sensing system based on an analog TMP36 wired to a 16 bit analog-to-digital converter.

Those fridge temperature samples were smoothed by filtering for the maximum value across a sample window, owing to the observation that all the errors occurred downwards.

I had thought that this was an artifact of the ADC device where it would tend to get the final bits of the conversion undervalues.

But it’s clearly due to various other sensor devices switching on briefly many times a second, causing a voltage drop as they draw their power, and my ADC detecting these fluctuations rather than any changes in temperature.

The experiment which isolated this effect was a hack to the main loop to make it switch off or on sets of devices every 30 seconds, like so:

void WholeSdOledBle::LoopWhole()
{
  int mstamp = millis(); 
  int icyc = (mstamp/1000/30+5) % 8; 
  if (adctmp36)       FetchADCtmp36(100, 80); 
  if (icyc>=2)  {
    if (jeenodeserial3) FetchJeenodeserial3(); 
    if (consoleserial)  FetchConsoleSerial(); 
    if (BTLEserial)     FetchBLE(); 
    if (gpsdata)        FetchGPS(); 
    if (wr)             FetchWind(); 
    if (lightsensor)    FetchLight(); 
    if (baroreceiver)   FetchBaro(); 
    if (dst)            FetchDallas(); 
  }
  if (icyc>=3) {
    if (irthermometer)  FetchIRtemp(200, 30);
    if (compassdata)    FetchCompass(); 
  }
  if (icyc>=4) 
    if (gyrodata)       FetchGyro(); 
  if (icyc>=5) 
    if (humiditydata)   FetchHumidity(); 
  if (icyc>=6) 
    if (tbarometer)     FetchTBarometer(); 
}

Here is the graph of my temperature readings over part of this window. See how my yellow line of accurate readings (at the precision of 0.003degC) gains a 0.5degC of noise when I switch all the sensors on.

adcnoise

This is going to be of no use if I’m trying to detect the subtle temperature change due to flying through a thermal.

It’s important to note that I have been ignoring this obvious effect until now, and that it would be almost invisible had I been sampling at a more “normal” rate of once every 15 seconds, as you would if you intended your device to go somewhere boring, like on a lamp-post or in the home. Although 0.5degrees is a substantial fluctuation, it’s ostensibly within the tolerance of the device, and so would be likely to be ignored by the incurious who just want to get the data out there and onto the internet, wherein people would download the data and potentially waste their time isolating these erroneous signals caused by the instrument rather than the environment. And, not having access to the devices, they would be unable to conduct the necessary experiments to reveal this effect, even if they became suspicious.

It’s exactly this kind of applying the sensors in more interesting places that’s going to feed back to the technology as it is used in more boring scenarios — an argument that was lost on the POC21 project team which I applied to three weeks ago on a whim.

POC21: Accelerating Open Source Sustainability from OuiShare

The content of my failed application is as follows:

Proposal: With the equipment on the market today it’s very easy to make the hardware for an amazing sensor data gathering project, and be convinced that once the streams of measurements have been stored into a massive database, then there will be something which we can do with the data to make a difference.

There never is. No such software or expertise exists. All you have is flat data, maybe some graphing capability, and a system to download the data so that someone else can do something interesting with it if they can think of an idea.

In the end, when you take a critical view of most of these projects, what has really happened is that the team discovered it was too hard and too boring to do something with the data, and they lost interest and pretended that it wasn’t a problem.

http://www.freesteel.co.uk/wpblog/2014/10/21/the-exponential-decay-curves-are-nice-shame-about-the-theory/

I believe I have a platform that can generate sensor data which is sufficiently interesting that I will work out the techniques for handling this type of data and turning it into actual actions, rather than simply some pretty graphs.

My platform is my hang-glider, and I would like to learn how to fly it better.

Premature optimization is the root of all evil.

Premature application is the root of all boredom and failure.

It’s got to be fun.

Background: In 2008 I co-founded a data company called ScraperWiki in Liverpool. This is normally working with government administrative data.

More recently, my projects in dynamic environmental data have included Housahedron, based on installing 100 temperature sensors in a house, knowing its internal polyhedral volume, and being able to see in real time the cold air drafting through the front door and around the house, or the heat convecting off the radiators:
https://web.archive.org/web/20140720195335/http://www.housahedron.co.uk/

Housahedron was accepted into the Berlin Startup Bootcamp 2014:
http://www.freesteel.co.uk/wpblog/2014/10/08/washed-up-in-berlin/

Then I investigated the potential of a very cheap device you could put in your fridge (cost less than a pint of milk, and be smaller) that measured its duty cycle over time and gave it a quality rating out of 100 depending on its energy efficiency. With such ratings, it would be possible to target the replacement of the lowest rated fridges across the country and make the biggest difference.
http://www.freesteel.co.uk/wpblog/2014/11/21/fridge-temperature-filtering/

But this got too difficult when I discovered how much temperature variation there was in the interior shell, and that I’d have to spend years pushing this idea around till someone could sponsor it.

And anyway, there was only one action that would result from all the data gathering — a decision to purchase a new fridge and at what time.

So now I’m doing a really, really interesting cool sensor data project. And maybe this time I will push it through to some sort of conclusion where, yes, the data gets converted into action.

These developments, and any software and techniques, will apply to all other energy monitoring data projects — including any projects which are on the Program. I can supply teaching, skills and hard questions to any other teams who needs it.

See links for some references to on-going work in data gathering and analysis. Sensors I have are:

Geometric: GPS, compass, accelerometer, gyro (to be replaced with a single Bosch BNO055 device), highly accurate barometer, windspeed meter, wind-flow stall front detector

Atmospheric: 4 different temperature devices, humidity sensor, barometer, wing temperature infra-red sensor

Experiments include:
(a) determining the vortex rotation of a thermal
(b) discovering the temperature change when crossing the threshold of a thermal
(c) calculating the polar curve of glide angle vs air speed
(d) calculating the bank angle vs turning radius
(e) relating the temperature lapse rate in the atmospheric column and comparing with thermal strength
(f) estimating cloud base height from humidity, temperature and estimated lapse rate

If you are worried that you have too many teams who have great ideas to deploy these amazing data sensors in houses, in heat storage systems, and so on, but that they might get lost when it comes to time actually do something with the data, you need me on the Program.

Meanwhile, I spent last Wednesday nailed to the hill of Penmaenbach above Conwy in a light sea breeze dodging one other glider. Unfortunately the SD card was disconnected, so I didn’t get any data.

penmaen

At least I got some nice pictures, though.

Leave a comment

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <blockquote cite=""> <code> <em> <strong>