2012年11月18日星期日

Help!with Long Range IR Sensor Noise

Hi guys,

I am in the process of building a track robot with the capability of using the SHARP89 2Y0A700 IR. I have begun testing the IR but have been getting back very noisy results. My question for you is how to reduce the noise produced from lights, sunlight etc.

I have heard about using a sort of tubing for the receiver and transmitters as well as some sort of RC filter.

Thank you for your help and sorry if this question has been asked in the past.

---------------------------------------------

Re: Help with Long Range IR Sensor Noise
by Ben

Hello.
How are you powering the sensor, and how are you measuring the noise? In my experience, these sensors are largely immune to noise from ambient IR; are you sure this is the source of your trouble? Have you added the suggested 10+ uF cap across power and ground somewhere near the sensor?

- Ben

----------------------------------------------
Re: Help with Long Range IR Sensor Noise
by L3mon0s

I have just connected the 10uF cap and I am able to obtain desired results but it is unstable. I am using Arduino ATMEGA 328 Duemilanove in addition to MATLAB and Arduino 1.0.1.

Here is the MATLAB code I'm using;

a=arduino('COM#')
a.analogRead(#)

% The pin number where the sensor is connected
analogPin = 0;
% The amount of measurements to record
sampleSize = 100;
% Set up an array to hold the digital numbers and time
data = zeros(100,2);
% Grab an initial reading to set the bounds of the graph
initialReading = a.analogRead(analogPin);
upperBounds = initialReading + 70;
lowerBounds = initialReading - 70;
% Start the timer
timer = tic;
for n = 1:sampleSize
data(n,1) = a.analogRead(analogPin);
data(n,2) = toc(timer);
subplot(2,1,1);
plot(data(:,2), data(:,1)), axis([0 (sampleSize*0.05) lowerBounds upperBounds]);
subplot(2,1,2);
hist(data(:,1)), axis([lowerBounds upperBounds 0 sampleSize])
drawnow
end

---------------------------------


I have now connected the capacitor through the analog pin and have stopped getting the 0 readings. I have attached my output in the file for you to look at.

How does it look to you?

ATTACHMENTS
Output.png

没有评论:

发表评论