Arduino Forum upgrade scheduled for Monday, October 20th, 11am-4pm (CEST). Sorry for the inconvenience!
Pages: [1]   Go Down
Author Topic: Peaks and Dips in HIH-4030 Humidity Sensor Readings  (Read 1140 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 38
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Using Sparkfun's HIH-4030 Breakout with my Arduino Mega, I'm getting occasional dips and peaks in the sensor's humidity readings. The dips and peaks can be as high as 10% humidity and are brief enough that they're almost certainly noise rather than signal. I've tested the Arduino itself for noise in its 5V rail and it seems to be working fine. Are these dips and peaks to be expected with this sensor, or is there likely something wrong with mine?
Logged

0
Offline Offline
Shannon Member
****
Karma: 226
Posts: 12963
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Interestingly the datasheet seems to make no mention of the output impedance of the sensor.  Stick a 10nF cap between its output and ground perhaps to reduce noise?

Is the sensor close to the board or at the end of a long cable?
Logged

[ I won't respond to messages, use the forum please ]

Offline Offline
Newbie
*
Karma: 0
Posts: 38
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Cable is approximately 6 inches long.
Logged

Anaheim CA.
Offline Offline
Faraday Member
**
Karma: 48
Posts: 2964
...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You might also look at the history (averaging) of the sensor output and discard one of a kind readings. The other thing I would recommend is a 1 - 10uF cap across the Vcc... Right AT the Sensor. Frequently spikes on the Vcc source are too fast and non periodic, so measuring them presents a real challenge unless you are really good with a high speed O'scope and even then there are ground induced currents that flow in the scope ground lead that will make trapping that kind of problem a great deal more difficult, especially if you are trying to measure the 'noise' while connected to the PC's USB port. I won't go into the reasons why here... Long and sometimes difficult to explain why you see noise on the ground lead. It is called common mode noise and apparently is "On the supply rail"... it isn't but any voltage impressed on the ground circuit must be in the hot lead as well... , or it''s mirror (opposite).

Doc.
Logged

--> WA7EMS <--
“The solution of every problem is another problem.” -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

Offline Offline
Newbie
*
Karma: 0
Posts: 38
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Frequently spikes on the Vcc source are too fast and non periodic, so measuring them presents a real challenge unless you are really good with a high speed O'scope ...

So Vcc spikes could be acting as impulses, producing obvious spikes in the humidity sensor's output that cannot be so easily detected when sampling Vcc directly?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 38
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've gone ahead and ordered another of the same sensor. I'm curious to find out whether the noise I'm getting has anything at all to do with a faulty sensor.
Logged

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 234
Posts: 14296
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset


This could be a way to
Code:
value = measureHumidity();
if (Math.Abs(value - previousValue) > (previousValue/20))  // changes > 5% (= 1/20) are considered noise
{
  value = previousValue; 
}
else
{
  previousValue = value;
}

or use a low pass filter that automatically filteres outliers ...

value = value - 0.15 (value - measureHumidity()) ;
other options include runningAverage() and runningMedian() -> see playground

Logged

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

Anaheim CA.
Offline Offline
Faraday Member
**
Karma: 48
Posts: 2964
...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You Might also try Bypassing the device, At the Device... Try a 1uF Ceramic cap... for starters up to 10uF should killl any spikes right at the sensor.
Logged

--> WA7EMS <--
“The solution of every problem is another problem.” -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

Offline Offline
Newbie
*
Karma: 0
Posts: 38
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Looks like ADC noise might indeed be the reason I'm getting unstable readings.
Logged

Anaheim CA.
Offline Offline
Faraday Member
**
Karma: 48
Posts: 2964
...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Yeah, it's real simple... call it "insurance" against a "Potential" problem... If Ya Got THe By Pass Caps installed then YOU KNOW it is very unlikely to be noise on the Vcc source. Most ALL digital devices CAN create noise so buy some CHEAP insurance... after ALL exactly how much will a handful of small caps (.1 and 4.7uF) caps cost. On a breadboard... they are child's play to insert right where the device is powered, they ARE reusable and what's worse they are just "Common Sense"..

Doc
Logged

--> WA7EMS <--
“The solution of every problem is another problem.” -Johann Wolfgang von Goethe
I do answer technical questions PM'd to me with whatever is in my clipboard

Offline Offline
Newbie
*
Karma: 0
Posts: 38
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm not disputing the remedy. Just suggesting there may indeed be nothing wrong with the sensor after all.
« Last Edit: May 11, 2012, 05:09:02 pm by AdrianLopez » Logged

0
Offline Offline
Shannon Member
****
Karma: 226
Posts: 12963
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I don't believe you said how you are powering the Mega - USB or Vin + on-board regulator?  On-board regulator is likely to be much cleaner.
Logged

[ I won't respond to messages, use the forum please ]

Offline Offline
Newbie
*
Karma: 0
Posts: 38
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I've been powering the Mega via the USB plug, but yesterday I tried the AC adapter and still got some noise. I didn't do any statistical tests to know whether it made any difference, but it did seem slightly less noisy when using the adapter.
Logged

Pages: [1]   Go Up
Arduino Forum upgrade scheduled for Monday, October 20th, 11am-4pm (CEST). Sorry for the inconvenience!
Jump to: