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.
Howdy,

I do some temperature logging with LM35s, hanging on cables with various lengths. AD-conversion is done with Logomatic. I put an RC filter in as recommended in the LM35 datasheet and the logomatic gets external 3.3V supplied, was too whacky before. What else can I do?

**broken link removed**

case.
 
Howdy,

I do some temperature logging with LM35s, hanging on cables with various lengths. AD-conversion is done with Logomatic. I put an RC filter in as recommended in the LM35 datasheet and the logomatic gets external 3.3V supplied, was too whacky before. What else can I do?

case.

hi,:)
What resolution is the A2D convertor.?

Do you have any filtering on the output of the A2D.?
 
I would temporarily replace the LM35 with a two-resistor voltage divider fed with the same 3.3V supply you are using for the LM35, and log that for a few hours. See if the noise is still present. If it is, you need a better 3.3V supply or better shielding...
 
Is there no way to use a digitally reporting sensor like an LM75, or something else that reports over SPI or I2C?
 
thanks for the fast responses!

>What resolution is the A2D convertor.?

12 bit. Amounts to 3 bit per centigrade. 10mV per Centigrade, 3.3V reference, 1023 bit.

>Do you have any filtering on the output of the A2D.?

at the output? Logomatic is done by www.sparkfun.com, so no idea about their filtering. Just wired in the sensors and a few Ls and CS and an LM1117 incl LC filter for the 3.3 V. Normally Logomatic generates 3.3 V on board, did not work all too well. So Excel would do the filtering....

>voltage divider
for testing I just put it on veroboard, was fine.
**broken link removed**
you mean I should gat say 5m cable and just put a voltage divider on and see what happens?
Actually its at home, would there be much noise? Could imagine in an industrial setting.
Anyhow, the sensors get 9V from a 500mA plug wart, then there is an addiditonal LC filter (100mH, and a few Cs in parallel. Then I step it down via TL7805 and LM1117 for the 3.3V and another 100mH and a few Cs before it goes into the Logomatic. The less noisy graphs are on about 3m cable, the others say 8m.

>digital sensor

seems you cannot make the Logomatic log say 1 measurment a minute, can just set a baudrate. Too much date to shift through, its for temperature logging in a house. Even every 5 minutes would be good enough

should I create a few preamps next to the sensors, bump it up by factor 3? Or is there an easier way?
 
When testing the divider, what caused the voltage to sag off? I would have expected a straight horizontal line with just whatever noise superimposed on it?

I think I'm just seeing +-1 LSB of noise, which is usual for an ADC. Re-do it at the end of your cable.

When you get the data to a PC, read it into Excel, and use the scatter plot to display it. Add a "running-average" trendline, which lets you specify a running sum over enough data points to get rid of the random variations.

You can also code your own "running average" low-pass filter.
 
Last edited:
sorry, no, that is a room temperature, heater was switched off. Put 2 sensors onto Veroboard, and about 10-20cm wire straight into the Logomatic. So just LSBs...
Since the 3.3V would be the reference voltage, if you wire it back into the ADC, whatever the 3.3V do would be 100% / 1023 reading?

edit:
**broken link removed**

filtering for peaks
=IF(B4>B3+5;(((B4+B3)/2)*330/1023)+$G$1;(B4*330/1023)+$G$1)
averaging 3 values
=(W5+AD4+AD3)/3
 
Last edited:
...
Since the 3.3V would be the reference voltage, if you wire it back into the ADC, whatever the 3.3V do would be 100% / 1023 reading?

That is why I suggested replacing the LM35 with a voltage divider consisting of two resistors. That way, the actual voltage being read by your A/D is less than 3.3V.

btw, looking at the multiple traces, there is high correlation between the noise in adjacent channels, meaning that the noise is either in the power supply, or the cabling.
 
Two years ago I interfaced some LM335's (used as temperature sensors) into a multichannel datalogger to measure and record temperature. The LM335's were at the end of 100 foot cables. Had a similar noise problem on all temperature channels. The temperature recordings were done in a home, not industrial, setting.

I tried trying adding additional filtering to all the supply voltages which didn't help. In my case, the solution was using twisted shielded pair cable. The drain wire (shield) was tied to common (ground) only on the datalogger interface. The drain wire at the LM335's were not connected to anything. Thus, there was no current flow in the shield.

creakndale
 
Last edited:
It's probably low freq noise ie mains hum. You could try twisted pair cable and also add a large cap right at the ADC input, from input to gnd.

And it wouldn't hurt to average a few input readings, take the readings over 1 (or more) full mains cycle (ie take 8 readings over the whole 60Hz mains cycle) so when you average them you will remove the +/- variation caused by the mains freq.
 
>reg hum: no, its just 1 measurment per minute, so should the grid frequency have an influence?

>reg shielded twisted pair: I should try, still 2 available ports, may as well prepare one sensor and put it there. Want to create another one anyway.

>reg correlation in noise:
**broken link removed**
filtered only noise (difference between one pint and the next), if there was a correlation, all the graphs would be parallel?

Its 1300 or so measurments, about 21hrs then, if there are some peaks could be changes in temperature as well. Windy day, weatherboard house. The peak in the first third would be half an hour or so.

The other graph from 11.51AM, these sensors been 1cm apart, if I remember right, one got RC filter, the other didnt, but would not have much of a difference, just 10-20cm wire do the ADC. Anyhow, may as well try the voltage divider bit.
 
hi,
Have you carried out the Vref test as suggested by MikeM.?

Use a 2.2K and 3k3 resistor in series, connect one end to the +3.3V and the other to 0v.
Make two of these dividers, connect one at the remote end of the cable and one close the the Logomatic.
Disconnect the LM35's.

Note: reverse the connection of one of the dividers so that you end up with two different test voltages.

The junction to the ADC1 input, should be approx +1.32V and ADC2 approx 1.98V. Doing it this way will displace the two 'test' temperature plots.

Run and log for a few minutes, post the results.:)
 
in case I would end up using twisted pair: would I need 3 pair (each pin of the sensor onto one pair) or 2 pair (supply voltages 1 wire each and sensor onto one pair)?

strange, both would be around 36°C (360mV), so why did the logomatic trail off, the temperature readings are next to zero. (left the LM35s connected).

put 2.2k/91 Ohm onto the 9V supply. One set of Rs was on a 20cm cable, the other on about 6m or so.

zooming in into the normal logging does not look that much different (200 readings.gif), 36hrs.gif, well, 2100 or so readings...
 

Attachments

  • noise.gif
    noise.gif
    23.7 KB · Views: 546
  • 200 readings.gif
    200 readings.gif
    25.9 KB · Views: 422
  • 36hrs.gif
    36hrs.gif
    37 KB · Views: 303
Last edited:
hi,
The left hand image is the plot for two resistor dividers.??
It indicates that the 'noise' is being picked up along the long cable run.

I would suggest a screened twisted pair, use the screen as the 0V connection.
Decouple the LM35 supply at the remote end, close to the LM35.
Follow the LM35 datasheet recommendations for long cable runs.

I would say the 'close' LM35 plot is within the spec of the LM35.

Ideally I would collect a number of samples, say 10 and average these within the program to give a plot value.
A rolling average could be calculated from a ring buffer of the samples, but for simple home use an average of the last 10 samples would be OK.
 
To isolate the cable as the problem, connect DC voltages right into the connector of the board. If this cleans up then you know it is the cable. I am not so sure twisted pair will suffice as twisted pair works best with differential signals. You might try running ribbon cable with ground signals separating each signal. Perhaps shielded pairs. What type of connector is on the interface?
 
To isolate the cable as the problem, connect DC voltages right into the connector of the board. If this cleans up then you know it is the cable. I am not so sure twisted pair will suffice as twisted pair works best with differential signals. You might try running ribbon cable with ground signals separating each signal. Perhaps shielded pairs. What type of connector is on the interface?
Mike,
This test recommendation has already been made and carried out, look at the plots and the posts:)
 
I did see the posted suggestions, but I did not see where the op followed them. Sorry I missed it.
 
guess DC would mean a battery. As soon as it comes trough a wall wart and then trough a 7805 and a LM1117 it is not that DC... Just came home, charging accus now. Hope they can drive the whole thing. Put them on just then, only got 1.5V out of the LM1117, not good enough. Damn, would have to be tomorrow. Then again, if the 7805 is not happy with 6 or rather 5.5V input, would have to wire up a 9V battery.
 
You need a known good clean DC source. What you described is not adequate for testing.

A battery would be better than what you describe.
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top