Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

noise with LM35 sensor

Status
Not open for further replies.
Lm35

There is some nice literature given about sensors and their interface charachteristics and usage. look on the links
**broken link removed**

and some additional information is here
**broken link removed**
 
>reg hum: no, its just 1 measurment per minute, so should the grid frequency have an influence?
...

The noise you are getting looks like low freq (mains freq) noise. That's further backed up with your second chart showing you getting the most noise in the living room and roof.

Mains noise is hard to RC filter as it's such a low frequency, you need a BIG cap (try 470uF, with another 0.1uF cap in parallel with it) right on the ADC input. I already suggested this.

Also, if you take a group of readings, all equally spaced, over a period of exactly one mains cycle and AVERAGE them, the + and - noise caused by the mains cycle will cancel out. I already suggested that too. :)

Even better since you only have to take a reading every minute, I would take say 16 samples over each mains cycle, for total 16 mains cycles, then add all 256 samples together and /256 to get your reading for that minute.
 
ok, here some readings. Using a 4x1.5battery pack, a 9V battery and copied a bunch of temperature readings in for comparison.

Maybe a 0.5A power supply does not really drive it, need 1A? Or have to twiddle with caps? Has to drive 6, later on 8 LM35s and reads them at the same instance.

Whats interesting, both readings for the Rs should be the same, about 350mV/109 reading, but they differ a fair bit.

edit: confused. the readings are at one minute already, so one set is 2100 readings/35hrs. Noise from switches would also be a reason, if you hapen to switch something just when its reading.
 

Attachments

  • battery.gif
    battery.gif
    21.6 KB · Views: 187
Last edited:
ok, here some readings. Using a 4x1.5battery pack, a 9V battery and copied a bunch of temperature readings in for comparison.

Maybe a 0.5A power supply does not really drive it, need 1A? Or have to twiddle with caps? Has to drive 6, later on 8 LM35s and reads them at the same instance.

Whats interesting, both readings for the Rs should be the same, about 350mV/109 reading, but they differ a fair bit.

edit: confused. the readings are at one minute already, so one set is 2100 readings/35hrs. Noise from switches would also be a reason, if you hapen to switch something just when its reading.

hi,
Been studying your plots.
For the top two traces, fixed resistors from a battery shows the battery voltage falling about ~10mV, which is OK.

The lower test voltages jump at a point of approx 66% along the X axis.
Most likely a poor connection.?

You do realise the LM35 output is only 10mV/Cdeg change and the accuracy is about +/-0.5C.

I would say the majority of the plot points fall close to the LM35's spec.

Do you have any filtering close to the logger for each LM35 input.

EDIT:
>What resolution is the A2D convertor.?
12 bit. Amounts to 3 bit per centigrade. 10mV per Centigrade, 3.3V reference, 1023 bit

10bit resolution is 1023 counts, 12bit is 4095.
 
Last edited:
sorry, its 10 bit. 1023 for sure.
+-1 digits, fair enough, LSB noise. And maybe there is alterations of 1 deg within 1 minute, every now and then. But there are pikes of 5 or more counts.
Maybe I should ramp it up to 6 readings one minute, see what happens.
The 1st picture I posted, 3 graphs are fine, am worried about the others, more than 3 digits noise.

There are filters at the sensor end, as in the LM35 data sheet. 75R and 1µFC to ground from sensor reading. But no, nothing at the ADC input side.
Could modify the firmware....
 
Last edited:
sorry, its 10 bit. 1023 for sure.
+-1 digits, fair enough, LSB noise. And maybe there is alterations of 1 deg within 1 minute, every now and then. But there are pikes of 5 or more counts.
Maybe I should ramp it up to 6 readings one minute, see what happens.

There are filters at the sensor end, as in the LM35 data sheet. 75R and 1µFC to ground from sensor reading. But no, nothing at the ADC input side.
Could modify the firmware....

hi,
I use software filtering of low level signals with weigh scale applications.

If you can access the firmware settings, sample at least 10 readings and form an average.
Can you also adjust the sampling rate.?

For a domestic application you need filtering/averaging for the signals, especially if you plan to control fans/heaters etc,
else they will be switching on/off all day.!:)
 
Last edited:
firmware is open source:

SparkFun Electronics - Logomatic v2 Serial SD Datalogger

can adjust sampling rate from 187 Hz (8Channels) to 1 in 72 s without too much effort. If I would want to do say 10 readings per minute and then average then and just store 1 reading per minute, would be some more effort.

I cannot see how changing the sampling rate will help with the noise.

If you are unable to modify the program to give an averaged value, you could consider analog amplification and filtering of the LM35 signals prior to the adc input.

Do you have a list of numeric temperature voltage values from the LM35, that were used to produce the plots.?
 
Last edited:
sampling rate: could save you some LSB noise, maybe, if temperature changes just a bit. But thats unlikely, changes not that quickly in this application (inside/outside a house)

here the readings.
 

Attachments

  • raw data.zip
    20.1 KB · Views: 102
sampling rate: could save you some LSB noise, maybe, if temperature changes just a bit. But thats unlikely, changes not that quickly in this application (inside/outside a house)

here the readings.

hi,
Are you able to write a program for a PC with anysort of basic.?

If yes, you could feed the tabular data into a averaging prog and determine the best method for reducing the effect of the noise.
Use that a model for the logger firmware changes.
 
I have a basic idea of C, but the code for the logomatic is a bit, say, confusing. Does not really make a difference if I would want to average by 4 or 16.

Signal amplifier sounds a good idea, sometimes the logger has some offset, the LM35s start at 0° with 0 mV, last night was pretty cold so I missed out, maybe 6 digits offset. Would have been interesting what happens in a leaking lightweight structure at temperatures like that.
 
I have a basic idea of C, but the code for the logomatic is a bit, say, confusing. Does not really make a difference if I would want to average by 4 or 16.

Signal amplifier sounds a good idea, sometimes the logger has some offset, the LM35s start at 0° with 0 mV, last night was pretty cold so I missed out, maybe 6 digits offset. Would have been interesting what happens in a leaking lightweight structure at temperatures like that.

hi case,
Note that the LM35's lowest tempr, in the standard configuration is +2Cdeg [20mV]
If you wanted to go sub zero, the LM135 or LM335 would do the job, they are in Kelvin deg...

Whats the highest tempr you would expect in the house project.?

I could work out and post an amp/filter circuit,, what amps do you have on the shelf..?
 
Last edited:
was hoping I am getting away with the LM35. It hardly gets below 3° in Melbourne but it will be in the 70 centigrades in the roof space in summer, thats 3.4V, logomatic only does 3.3.

for home any Opamp will do? There is always ebay, got the LM35 from Thailand, faster and cheaper than buying them in Oz.
 
was hoping I am getting away with the LM35. It hardly gets below 3° in Melbourne but it will be in the 70 centigrades in the roof space in summer, thats 3.4V, logomatic only does 3.3.

for home any Opamp will do? There is always ebay, got the LM35 from Thailand, faster and cheaper than buying them in Oz.

That figure of 3.4V, are you amplifying the LM35, 0.7V output by ~4.85 on the logomatic.?
 
hi case,
As you expect the loft tempr in the 70Cdeg's, if we choose a max tempr of say, 85.25C, which is 3.3Vmax.

Multiply the LM35 output by ~3.87, so 85.25C would be +3.3V [1023 adc counts]

Divide the counts by 12 [ I have chosen the max tempr so that the divisor is an integer] = 85.25C.

At 20Cdeg, LM35 out 0.2V * 3.87 = 0.7742V, the adc count value would be
[0.7742/3.3] * 1023 = 240, then dividing by 12 in the logger firmware will give 20.0Cdeg.

If these limits are ok, let me know I'll sketch out an amp circuit.:)
 
Last edited:
That figure of 3.4V, are you amplifying the LM35, 0.7V output by ~4.85 on the logomatic.?

no, if I took a LM135/335, its 0V at 0K, at 0°C its 2.73V, at 70° 3.43V?

For the amp: amplification of 3 would be enough (easier to check), the logger gives values between 0 and 1023 and I let Excel do the math. Plus the house has a black roof (Australians are pretty good building houses exactly how you should not), so no idea what happens at a 45° day, hope the sensor in the roof space does not blow up. Anyway, better design it with 100° in mind....
 
CAT 5 did cut the mustard:
the 2 parallel curves "ins top" and "living floor" is the ones with CAT5 cables. The graph is without the averaging I'd normally use. The 17.5m CAT5 does better than even the "subfloor" which is about 2m normal cable. The lines are parallel because I was testing the sensors first if they would have offset or what not, positioned them next to each other.

219-sensortest.jpg


I connected 1 pair to voltage supply and ground the other pair to sensor output and same ground (i.e. ground would be 2 strains). The other option may be one pair for the sensor output so in that pair the noise would neutralise. But, seems to work for me the way it is now and the spec says one pair would be signal and its ground, that's how I did it.

Category 5 cable - Wikipedia, the free encyclopedia
 
Last edited:
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top