Go Down

Topic: Peaks and Dips in HIH-4030 Humidity Sensor Readings (Read 1 time) previous topic - next topic

AdrianLopez

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?

MarkT

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?
[ I won't respond to messages, use the forum please ]

AdrianLopez


Docedison

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

AdrianLopez


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?

AdrianLopez

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.

robtillaart


This could be a way to
Code: [Select]

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

Rob Tillaart

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

Docedison

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

AdrianLopez

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

Docedison

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
--> 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

AdrianLopez

#10
May 12, 2012, 12:07 am Last Edit: May 12, 2012, 12:09 am by AdrianLopez Reason: 1
I'm not disputing the remedy. Just suggesting there may indeed be nothing wrong with the sensor after all.

MarkT

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.
[ I won't respond to messages, use the forum please ]

AdrianLopez

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.

Go Up
 

Quick Reply

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Note: this post will not display until it's been approved by a moderator.
Name:
Email:

shortcuts: alt+s submit/post or alt+p preview