Searching \ for '[PIC:] My second project: IR LED Distance Sensor' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/ios.htm?key=sensor
Search entire site for: 'My second project: IR LED Distance Sensor'.

Exact match. Not showing close matches.
PICList Thread
'[PIC:] My second project: IR LED Distance Sensor'
2004\06\08@092436 by Lindy Mayfield

flavicon
face
Hello List.

Thanks to all of your suggestions for a PIC distance sensor, I have come up with my second project design which is coming along quite nicely, but with some problems I cannot figure out, and I would like to ask if someone would offer some advice.

The design uses a TSL260R IR light-to-voltage optical sensor, read by the A/D pin on a 16F88.  Right now on the breadboard I have two IR LED's wrapped in shrink tube (thanks for that suggestion!) and the code that prints out the on/off voltage differences to my PC terminal.

With the exception of a pull-down resistor for the sensor, and of course the LED's and resistor, there are no other components in the design.

My problem I am having is that I get "noise" from the sensor.  
For example with pairs of readings, 1/4 second intervals, I get the following (no LED's involved):

DIFF --> 0002
DIFF --> 0102   *
DIFF --> 0001
DIFF --> 0002
DIFF --> 0002
DIFF --> 0000
DIFF --> 0001
DIFF --> 0000
DIFF --> 0001
DIFF --> 0101   *
DIFF --> 0001

My question is, is the sensor simply picking up IR radiation from the environment?  Would there be something I could do electronically to filter this out, or should I try to filter it programmatically?

Thanks in advance.

Cheers,
Lindy


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.699 / Virus Database: 456 - Release Date: 6/4/2004

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email spam_OUTlistservTakeThisOuTspammitvma.mit.edu with SET PICList DIGEST in the body

2004\06\08@093102 by Jan-Erik Soderholm

face picon face
Lindy Mayfield wrote :

> My problem I am having is that I get "noise" from the sensor.
>
> For example with pairs of readings, 1/4 second intervals, I
> get the following (no LED's involved):

With regular intervalls, right ? :-)

I had a similar problem in an IR project. Finaly I found out
that the IRDA port of my laptop tryed to "make friends" now
and then...

Look around, what possible IR sources do you have ?
Laptop ? Maybe a cellular phone with an IR interface ?

> My question is, is the sensor simply picking up IR radiation
> from the environment?

Probably.

>  Would there be something I could do
> electronically to filter this out, or should I try to filter
> it programmatically?

It depends on what you application is ment to do.

B.t.w, *how* will you be measuring distance using IR ?

Jan-Erik.

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email .....listservKILLspamspam@spam@mitvma.mit.edu with SET PICList DIGEST in the body

2004\06\08@094931 by Lindy Mayfield

flavicon
face

> Lindy Mayfield wrote :
>
> > My problem I am having is that I get "noise" from the sensor.
> >
> > For example with pairs of readings, 1/4 second intervals, I
> > get the following (no LED's involved):
>
> With regular intervalls, right ? :-)

Yes.  I think.  Wait 1/4 sec, read AD, wait 1/4 sec, read AD, take difference.  I did it that way because depending on the light the voltages change, but the difference... well, I don't know right now, linear or exp, but I can see the differences happening when I test it. (-:


>
> I had a similar problem in an IR project. Finaly I found out
> that the IRDA port of my laptop tryed to "make friends" now
> and then...
>
> Look around, what possible IR sources do you have ?
> Laptop ? Maybe a cellular phone with an IR interface ?

Well I'll be, there's a cell phone right there next to it. (-:

> >  Would there be something I could do
> > electronically to filter this out, or should I try to filter
> > it programmatically?
>
> It depends on what you application is ment to do.
>
> B.t.w, *how* will you be measuring distance using IR ?

It's supposed to be for my little robot. I want to make a 16f88 coprocessor that I can talk to from the BS-II.  Right now I have 2 LED's on either side of the sensor.  I calculate the difference in AD readings between the voltage with the LED's off and on which is supposed to tell me how close something is.  The sensor is only about 5ˆ so I could afford to us a few of them in different places on the robot.  
But I wonder if you are pointing out an error I made when I said "measuring distance".  I think I should have said "detecting proximity".  (-:  But still from my initial tests, it does look plausible that it could compute a distance with some degree of accuracy.
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.699 / Virus Database: 456 - Release Date: 6/4/2004

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listservspamKILLspammitvma.mit.edu with SET PICList DIGEST in the body

2004\06\08@095757 by Jan-Erik Soderholm

face picon face
> > Look around, what possible IR sources do you have ?
> > Laptop ? Maybe a cellular phone with an IR interface ?
>
> Well I'll be, there's a cell phone right there next to it. (-:

Just shut it off and see what happens...

>
> But I wonder if you are pointing out an error I made when I
> said "measuring distance".  I think I should have said
> "detecting proximity".  (-:  But still from my initial tests,
> it does look plausible that it could compute a distance with
> some degree of accuracy.

Yes, I read it as measuring the distance using the
speed of (IR-) light... :-)

Anyway, using ultrasonic seems to be the recomended way
of doing what you are doing.

Jan-Erik.

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email .....listservKILLspamspam.....mitvma.mit.edu with SET PICList DIGEST in the body

2004\06\08@101453 by Lindy Mayfield

flavicon
face
>
> Yes, I read it as measuring the distance using the
> speed of (IR-) light... :-)
>
> Anyway, using ultrasonic seems to be the recomended way
> of doing what you are doing.
>
That is the next project, but it requires that I understand more on electronics.  My Art of Electronics and Beebob... books arrived today, so maybe that will help.

I have a sonar sender and receiver, and I understand (I think) that I only need to PWM the proper frequency to the sender to make that work.  
It is the receiver that I am having problems with.  All this is a learning experience for me, so I want to understand how everything works before building things.  (I've built projects before, but that was just soldering and not the same as designing and building things yourself.)  
The receiver has two leads, and I am looking at op-amps in order to build a circuit where I can read it. (Is that correct?  Why can't I read it with the AD on my PIC?  Is the signal too weak or something like that?)

How's this for an idea for a nice project?  A sonar based Theremin.  I've seen an IR one, but not sonar.    
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.699 / Virus Database: 456 - Release Date: 6/4/2004

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email EraseMElistservspam_OUTspamTakeThisOuTmitvma.mit.edu with SET PICList DIGEST in the body

2004\06\08@101703 by Lindy Mayfield

flavicon
face
>
> Yes, I read it as measuring the distance using the
> speed of (IR-) light... :-)
>
Just curious, how fast a processor would I need to measure light?

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.699 / Virus Database: 456 - Release Date: 6/4/2004

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listservspamspam_OUTmitvma.mit.edu with SET PICList DIGEST in the body

2004\06\08@103551 by D. Jay Newman

flavicon
face
> > Yes, I read it as measuring the distance using the
> > speed of (IR-) light... :-)
> >
> Just curious, how fast a processor would I need to measure light?

It depends on your scale of measurement and the precision that you want.

For example, if you wanted to bounce a laser off something approximately
1 light-month away (we're assuming a *really* good laser and reciever)
pretty much any processor will work.

If you wanted to measure something only several feet away, I'm not sure
that they make processors that fast. There was a discussion a couple
of weeks ago that you could do this with an external timer, but I'm
old enough to just assume that the speed of light is too fast to worry
about.  :)
--
D. Jay Newman           !
@spam@jayKILLspamspamsprucegrove.com     ! Xander: Giles, don't make cave-slayer unhappy.
http://enerd.ws/robots/ !

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email KILLspamlistservKILLspamspammitvma.mit.edu with SET PICList DIGEST in the body

2004\06\08@105218 by Marcel van Lieshout

flavicon
face
This document helped me a lot in understanding how to do it.
http://www.uow.edu.au/eng/phys/200labs/phys205/spdoflght.pdf

Have fun! :-)

Marcel

D. Jay Newman wrote:
{Quote hidden}

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email spamBeGonelistservspamBeGonespammitvma.mit.edu with SET PICList DIGEST in the body

2004\06\08@114223 by tim_webb

flavicon
face
Make sure you are not working in an area where you might be exposed to direct sun light or other IR emitting light sources.  Noise could be generated by the sun and even by the wind blowing a tree branch that is in the path of the sun.

{Original Message removed}

2004\06\08@121853 by Russell McMahon

face
flavicon
face
>> Yes, I read it as measuring the distance using the
>> speed of (IR-) light... :-)
>>

> Just curious, how fast a processor would I need to measure light?

Very hard.
Work it out.
Vl= 3E8 m/s
or roughly 1E-9s/foot.
ie a nanosecond is a light foot.
For a 5 foot distance there and back it takes 10 nanoseconds.
! :-)
Most processors are going to need some sort of hardware assistance.
It's liable to be far harder than using ultrasonics, which is a commonly
implemented amateur method.

Light methods using interference fringes are easier, but still far from
trivial.



           RM

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email TakeThisOuTlistservEraseMEspamspam_OUTmitvma.mit.edu with SET PICList DIGEST in the body

2004\06\08@140849 by hilip Stortz

picon face
do you have any bypass capacitors?  very, very essential, especially
when you start doing analog work.  intensity of reflection to distance
is doable, though influenced by the reflectance of the "target".

timing will be close to impossible, in high school i set up an
experiment to measure the speed of light, we modulated a HeNe laser, ran
it into a beam splitter and detected one beam right at the beam splitter
and the other after bouncing off a wall way down the hall, by looking at
the 2 pulses on a 100mhz scope you could just see the difference between
when the 2 pulses arrived at their photo detectors.  remember, speed of
light is 168 thousand miles per second (or is it 169?  best to check).

shorter distance is best measured ultrasonically since sound only
travels about 1000 FT per second (330 metres or so).  you can pulse an
ultrasonic transducer and listen for the echo, or drive the transducer
off of a modulated oscillator and listen for the echo (easiest with a
second transducer, but possible with one).  also, remember that with
sound or light the intensity of the reflection is the inverse square of
the distance, times the reflectance of the surface so you need a lot of
amplification unless things are very close.

it's either lidar (with a laser) or sonar (with sound), or optical radar
with an led.  in any case, it's not trivial.  unless you use a laser
you'll also get reflections from the floor and every other object for
some distance and have to sort it all out.

kodak does make an ultrasonic ranging kit, check newark or arrow or do a
web search.  what type of distance do you want to measure?  you'll
definitely need some analog electronics besides just the a/d converter,
a filter at the least with an led or ultrasonic transducer and probably
a log amplifier or a voltage control amplifier linked with the pulse
timing so the gain increases exponentially while you wait for the return echo.

it's a good project, but fairly advanced, especially with light. (note
that with light or sound you will want a retro reflector to cover any
range, a retro reflector (which surveyors call a "prism" because some
retro relectors are prisms) always returns an echo directly at the
sound/light source which simplifies alignment).

RemoveMEtim_webbspamTakeThisOuTAGILENT.COM wrote:
-------
> The design uses a TSL260R IR light-to-voltage optical sensor, read by the A/D pin on a 16F88.  Right now on the breadboard I have two IR LED's wrapped in shrink tube (thanks for that suggestion!) and the code that prints out the on/off voltage differences to my PC terminal.
>
> With the exception of a pull-down resistor for the sensor, and of course the LED's and resistor, there are no other components in the design.
>
> My problem I am having is that I get "noise" from the sensor.
---------------

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listservEraseMEspam.....mitvma.mit.edu with SET PICList DIGEST in the body

2004\06\08@141929 by Koen van Leeuwen

flavicon
face
On Tuesday 08 June 2004 16:15, Lindy Mayfield wrote:
> > Yes, I read it as measuring the distance using the
> > speed of (IR-) light... :-)
>
> Just curious, how fast a processor would I need to measure light?

In an indirect way, continuous wave radar works with this.
One form of it uses a fast frequency sweep, so the reflected frequency always
lags a bit. The difference between the received frequency and the currently
transmitting frequency is a measure for the distance. "Just" mix the two and
FFT the mixed signal ;o)
Any PC with some hardware aid can do that...

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email EraseMElistservspammitvma.mit.edu with SET PICList DIGEST in the body

2004\06\08@182504 by Brent Brown

picon face
Hi Lindy,

I played around with this once upon a time (last century). You will find a lot of
IR background in many environments caused by lighting and the sun.

Simplest way to get rid of most of the problem is a high-pass filter on your
ADC input. Assume the IR from electrical lighting to be 100 or 120Hz (for
50/60Hz mains frequency), assume IR from the sun to be very low frequency
(basically just a DC offset), and assume your IR to be a relatively high
frequency (ie. turn the IR LED on, take an ADC reading, turn the LED off -
doesn't take long). A simple CR filter will work very well.

Similarly the filtering could be done in software (although I would choose the
hardware solution first as it gives better dynamic range). Read the ADC to
get the current "background" IR, turn the LED on, read the ADC again, turn
the LED off, subtract the background value. The faster you can do this the
better the results. Also you can average a number of samples to smooth out
remaining noise. You could do fancy filtering algorithms but it may be overkill
for what you want.

--
Brent Brown, Electronic Design Solutions
16 English Street, Hamilton, New Zealand
Ph/fax: +64 7 849 0069
Mobile/txt: 025 334 069
eMail:  RemoveMEbrent.brownEraseMEspamEraseMEclear.net.nz

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email RemoveMElistservspam_OUTspamKILLspammitvma.mit.edu with SET PICList DIGEST in the body

2004\06\08@183541 by Jinx

face picon face
> I get the following (no LED's involved):

> DIFF --> 0002
> DIFF --> 0102   *
> DIFF --> 0001

etc

Are you able to 'scope the o/p of the receiver to ascertain exactly
what that "noise" is ?

If not, and you can't find an obvious local culprit, perhaps data log
the ADC at a higher rate than 1/4s to look for a pattern (or not)

A quick experiment would be to put the whole thing in a box and
make sure that with no light whatsoever the o/p is low and stable

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email RemoveMElistservTakeThisOuTspamspammitvma.mit.edu with SET PICList DIGEST in the body

2004\06\08@192422 by Lindy Mayfield

flavicon
face
Thanks for the hints.  
> Simplest way to get rid of most of the problem is a high-pass
> filter on your
> ADC input.
The light-2-voltage sensor is supposed to be reactive to the IR wavelength of 940nm.  But it does get a little more "jiggly" when I turn on the lights.

> Similarly the filtering could be done in software (although I
> would choose the
> hardware solution first as it gives better dynamic range).
Turned out that the jumps in voltage were quite predictable.  I was already computing the difference between the readings between ON and OFF of the LED's.  I simply subtracted the two 16 bit numbers and dropped off the high byte.

And now it works great!  Thanks for everyone's help along the way.

I put in some threshold numbers, which I can adjust, and now it outputs a LEFT, RIGHT or both when an object is near one of the LED's.  
I can now tune it a bit, maybe add the averaging as you suggested, polish up the code a bit.  Then turn it into a coprocessor (or move on to sonar...)  But it works kinda nice now.
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.699 / Virus Database: 456 - Release Date: 6/4/2004

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email EraseMElistservspamspamspamBeGonemitvma.mit.edu with SET PICList DIGEST in the body

2004\06\08@193503 by Lindy Mayfield

flavicon
face
> > I get the following (no LED's involved):
>
> > DIFF --> 0002
> > DIFF --> 0102   *
> > DIFF --> 0001
>
> etc
>
> Are you able to 'scope the o/p of the receiver to ascertain
> exactly
> what that "noise" is ?

Unfortunately not yet as a scope for me is still in the wish-for phase.  

> If not, and you can't find an obvious local culprit, perhaps
> data log
> the ADC at a higher rate than 1/4s to look for a pattern (or
> not)

Actually I moved it down to 1/4 second for the same reason.  I at first had it running as fast as possible and was seeing the "noise", so I slowed it down dramatically to see if the fluctuations were still there.  And yes they were.

But I think I found a suitable answer.  If you look just at the three DIFF above, you'll see that if you take only the last byte of the hex number, the numbers look as expected:  02, 02, 01.  
So I did that and all the "noise" disappeared magically.

> A quick experiment would be to put the whole thing in a box and
> make sure that with no light whatsoever the o/p is low and
> stable

You know I was thinking something along that line.  I was thinking that if it was in a black box that it might be able to measure distance quite accurately. But I couldn't think of a good reason to measure a distance to something in a dark place.  (-:

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.699 / Virus Database: 456 - Release Date: 6/4/2004

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email RemoveMElistservKILLspamspammitvma.mit.edu with SET PICList DIGEST in the body

2004\06\08@195355 by Jinx

face picon face
> > Are you able to 'scope the o/p of the receiver to ascertain exactly
> > what that "noise" is ?

> Unfortunately not yet as a scope for me is still in the wish-for phase

For that kind of signal you should be able to use a PC's sound card
and a sound capture/processor utility (eg Goldwave - free, very good,
hardly disabled at all, used it for years). Can also be used as a basic,
very basic two-channel, logic analyser

http://www.hitsquad.com/smm/programs/GoldWave/

or http://www.goldwave.com of course

I've tried others (eg CoolEdit), prefer GW (OK GW, where's my $$$ ;0)

{Quote hidden}

But are you sure you aren't sticking your head in the sand ? If there
really is a physical noise problem, a s/w workaround won't make it
go away. Apologies if that sounds preachy

> > A quick experiment would be to put the whole thing in a box and
> > make sure that with no light whatsoever the o/p is low and stable

> You know I was thinking something along that line.  I was thinking
> that if it was in a black box that it might be able to measure distance
> quite accurately. But I couldn't think of a good reason to measure a
>  distance to something in a dark place.  (-:

Make you a wiz at Murder In The Dark ?

What I was getting at was that by putting the circuit in a lightless box
you have a controlled environment which you can use to judge/verify
the sensor's performance

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listservSTOPspamspamspam_OUTmitvma.mit.edu with SET PICList DIGEST in the body

2004\06\08@201517 by Lindy Mayfield

flavicon
face
>
> > So I did that and all the "noise" disappeared magically.
>
> But are you sure you aren't sticking your head in the sand ? If
> there
> really is a physical noise problem, a s/w workaround won't make
> it
> go away. Apologies if that sounds preachy

You're right.  My thinking was that from first looks the voltage differences between the LED off and on were always less than 0xff when there was an object in front.  And that when I got the "noise" the voltage difference is greater than that.  So in essence I'm taking samples and throwing away anything that is too high.  
I would have to do more filtering if I were to implement this.  I just noticed that the TV remote will trigger it.  If it were on a robot then turning the channel on the TV would make it go nuts.
(-:

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.699 / Virus Database: 456 - Release Date: 6/4/2004

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email spamBeGonelistservSTOPspamspamEraseMEmitvma.mit.edu with SET PICList DIGEST in the body

2004\06\08@205940 by Lindy Mayfield

flavicon
face
>
> For that kind of signal you should be able to use a PC's sound
> card
> and a sound capture/processor utility
Also this, but this one looks really complicated.
http://www.ee.washington.edu/conselec/CE/sp95reports/guterman/final/scope1.htm



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.699 / Virus Database: 456 - Release Date: 6/4/2004

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email KILLspamlistservspamBeGonespammitvma.mit.edu with SET PICList DIGEST in the body

2004\06\08@210152 by Lindy Mayfield

flavicon
face
>
> For that kind of signal you should be able to use a PC's sound
> card
> and a sound capture/processor utility
That's a great idea!  Looking around on Google I found someone who made the software:
http://polly.phys.msu.su/~zeld/oscill.html



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.699 / Virus Database: 456 - Release Date: 6/4/2004

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email EraseMElistservspamEraseMEmitvma.mit.edu with SET PICList DIGEST in the body

2004\06\08@211605 by Robert Ussery

flavicon
face
>-----Original Message-----
>From: pic microcontroller discussion list [@spam@PICLIST@spam@spamspam_OUTMITVMA.MIT.EDU]
>On Behalf Of Lindy Mayfield

>That's a great idea!  Looking around on Google I found someone who made the
>software:
>http://polly.phys.msu.su/~zeld/oscill.html

Cool software... Does using the sound-card as an O-scope for standard
PIC-type circuits (i.e., low-voltage digital) require any interface
circuitry? Any general cautions on input type (i.e., voltage, impedance,
etc.), or is this totally dependant on the particular sound card?

Thanks!

- Robert


_______________________________________________
"The most terrifying words in the English language are: I'm from the
government and I'm here to help."
- Ronald Reagan

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email spamBeGonelistservspamKILLspammitvma.mit.edu with SET PICList DIGEST in the body

2004\06\08@211818 by Lindy Mayfield

flavicon
face
>
> > So I did that and all the "noise" disappeared magically.
>
> But are you sure you aren't sticking your head in the sand ? If
> there
> really is a physical noise problem, a s/w workaround won't make
> it
> go away. Apologies if that sounds preachy
>
I've been doing even more thinking about what you said and research, and I'm convinced all the answers are right in front of me, i.e. in the datasheet for the sensor.  I simply do not understand things yet.

My _The Art of Electronics_ book came in today.  It's a lot bigger than I thought it would be.  And the print is awful small.  Plus, it has all these mathematical symbols in it I don't understand.  Not like the Robot Building for Dummies that started this trek...  o-:

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.699 / Virus Database: 456 - Release Date: 6/4/2004

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email .....listservspam_OUTspammitvma.mit.edu with SET PICList DIGEST in the body

2004\06\08@215356 by techy fellow

picon face
As I am new to EE and MCU, pls ignore this if it doesn't add value.

I came across a book called, "Core LEGO MINDSTORMS Programming: Unleash the Power of the Java Platform" (by Brian Badnall) which although tailored for LEGO Mindstorms but, there is a section (Chapter 9) whereby the author discribed how a proximity/ distance sensor works, how to build one (looks very easy) and how to interface it with the Lego Mindstorms RCX brick. The construction section may of interest to you.

The author even went a step further in Chapter 10 by describing how to Navigate with a digital compass sensor and how to build one. The book was rated 5 stars at amazon.com.



Lindy Mayfield <TakeThisOuTLindy.Mayfield.....spamTakeThisOuTEUR.SAS.COM> wrote:
>
> > So I did that and all the "noise" disappeared magically.
>
> But are you sure you aren't sticking your head in the sand ? If
> there
> really is a physical noise problem, a s/w workaround won't make
> it
> go away. Apologies if that sounds preachy
>

I've been doing even more thinking about what you said and research, and I'm convinced all the answers are right in front of me, i.e. in the datasheet for the sensor. I simply do not understand things yet.

My _The Art of Electronics_ book came in today. It's a lot bigger than I thought it would be. And the print is awful small. Plus, it has all these mathematical symbols in it I don't understand. Not like the Robot Building for Dummies that started this trek... o-:

---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.699 / Virus Database: 456 - Release Date: 6/4/2004


--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email TakeThisOuTlistservKILLspamspamspammitvma.mit.edu with SET PICList DIGEST in the body

---------------------------------
Do you Yahoo!?
Friends.  Fun. Try the all-new Yahoo! Messenger

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email .....listservspamRemoveMEmitvma.mit.edu with SET PICList DIGEST in the body

2004\06\08@221059 by Jinx

face picon face
> http://polly.phys.msu.su/~zeld/oscill.html

Looks nice and simple. That would be a very good first cheapie
'scope (with storage to boot !) and an extra pair of low-res channels
for an existing 'scope owner. I've d/led it myself, even though I've
plenty of diagnostic tools already

Now an interface. You could do worse than this -

http://www.siliconchip.com.au/cms/A_30518/article.html

(a pity they used jpgs for diagrams, kinda readable, I have the
original if you get curious but you may be able to work it out from
the parts list)

Basically, if you're not going to leave your brains in bed and measure
mains or Tesla coils, a switchable attenuation/amplification circuit with
op amps would do. Something with high impedance not to load an
A/D channel for example

In the above article they mention s/w on Page 7 - that article is not,
unfortunately, on-line ;-( I'll scan it later and upload it. Here is the
list
from quite a full article and review of 'scope s/w. (2 years old,
probably others around now)

http://polly.phys.msu.su/~zeld/oscill.html (which you found already)
http://www.trueaudio.com
http://www.sumuller.de/audiotester
http://www.wavebuilder.com
http://www.brownbear.de
http://heliso.tripod.com/download/download.htm

A low-budget system could be put together that would be an
excellent tool for examining PIC i/p and o/p signals, albeit to the
limits of a sound card/PC. In the same issue is a Digital Storage
Logic Probe

http://www.siliconchip.com.au/cms/A_30519/article.html

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email RemoveMElistservspamspamBeGonemitvma.mit.edu with SET PICList DIGEST in the body

2004\06\08@231825 by Jinx

face picon face
For your viewing pleasure Lindy, I've uploaded the Silicon
Chip article on some soundcard s/w

http://home.clear.net.nz/pages/joecolquitt/soundcard.html

Had to snip all the purdee pictures (screenshots). Text a
bit rough but quite readable

Also uploaded to the same page a clearer version of the
SC interface circuit

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email spamBeGonelistserv@spam@spamspam_OUTmitvma.mit.edu with SET PICList DIGEST in the body

2004\06\08@233107 by Lindy Mayfield

flavicon
face
Thanks for the link below.  But what you've already shown me is amazing!  So far, audioTester was the best thing.  I literally installed the software and then unplugged my synthesizer and clipped an alligator clip to the pointy end of the audio cable from my pc sound card.  I stuck this in my circuit on the output of the IR sensor, and voilá. As my hand got closer I got more of a beautiful sine wave, pure as the driven snow.  No spikes, no "noise", no nothing.  (Do I need to do anything with the ground from the sound card? It doesn't seem to matter.)

My "noise" problem then must be a programming error, or something I'm doing wrong in reading the A/D.  That's what I think now, at least.  

> {Original Message removed}

2004\06\09@001848 by Jinx

face picon face
That's really good progress news

Earthing is mentioned in the interface artice. ie a PC is grounded
to mains earth and they advise caution about measuring circuits
like switch-mode supplies. In your case you say you can see what
looks like a sine wave, without using a ground connection to the
circuit. Possibilities are that the PS ground for your circuit is the
same as the PC and what you see is the actual wave, or that the
ground for you PS is not grounded andd you could be looking at
induced mains hum. The big clue will be the frequency of the sine
wave. If your PIC or whatever isn't putting out 50Hz or 60Hz but
that's what you see, then dot dot dot dot dot [ join them ;-) ]

--
http://www.piclist.com hint: To leave the PICList
TakeThisOuTpiclist-unsubscribe-requestspamspammitvma.mit.edu

2004\06\09@031645 by Ake Hedman

flavicon
face
>Can also be used as a basic, very basic two-channel, logic analyser
Interesting. How is your setup for this?

/Ake

-----Ursprungligt meddelande-----
Från: pic microcontroller discussion list
[PICLISTEraseMEspamMITVMA.MIT.EDU]För Jinx
Skickat: den 9 juni 2004 01:56
Till: RemoveMEPICLISTEraseMEspamspam_OUTMITVMA.MIT.EDU
Ämne: Re: [PIC:] My second project: IR LED Distance Sensor


> > Are you able to 'scope the o/p of the receiver to ascertain exactly
> > what that "noise" is ?

> Unfortunately not yet as a scope for me is still in the wish-for phase

For that kind of signal you should be able to use a PC's sound card
and a sound capture/processor utility (eg Goldwave - free, very good,
hardly disabled at all, used it for years). Can also be used as a basic,
very basic two-channel, logic analyser

http://www.hitsquad.com/smm/programs/GoldWave/

or http://www.goldwave.com of course

I've tried others (eg CoolEdit), prefer GW (OK GW, where's my $$$ ;0)

> > If not, and you can't find an obvious local culprit, perhaps data
log
> > the ADC at a higher rate than 1/4s to look for a pattern (or not)

> Actually I moved it down to 1/4 second for the same reason.  I at
first
> had it running as fast as possible and was seeing the "noise", so I
> slowed it down dramatically to see if the fluctuations were still
there.
>  And yes they were.

> But I think I found a suitable answer.  If you look just at the three
DIFF
> above, you'll see that if you take only the last byte of the hex
number,
> the numbers look as expected:  02, 02, 01.

> So I did that and all the "noise" disappeared magically.

But are you sure you aren't sticking your head in the sand ? If there
really is a physical noise problem, a s/w workaround won't make it
go away. Apologies if that sounds preachy

> > A quick experiment would be to put the whole thing in a box and
> > make sure that with no light whatsoever the o/p is low and stable

> You know I was thinking something along that line.  I was thinking
> that if it was in a black box that it might be able to measure
distance
> quite accurately. But I couldn't think of a good reason to measure a
>  distance to something in a dark place.  (-:

Make you a wiz at Murder In The Dark ?

What I was getting at was that by putting the circuit in a lightless box
you have a controlled environment which you can use to judge/verify
the sensor's performance

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email @spam@listservRemoveMEspamEraseMEmitvma.mit.edu with SET PICList DIGEST in the body

--
http://www.piclist.com hint: To leave the PICList
EraseMEpiclist-unsubscribe-requestspam@spam@mitvma.mit.edu

2004\06\09@042852 by Jinx

face picon face
> > Can also be used as a basic, very basic two-channel, logic analyser

> Interesting. How is your setup for this?

I have to admit not doing this myself, merely pointing it out to Lindy as
an inexpensive way to get a useful tool for debugging his circuits. I
should have also mentioned oscilloscope s/w rather than audio s/w.
Dropped the ball there, sorry

But to make a logic analyser should be very simple, assuming normal
5V signals. Feed straight into the soundcard (one signal per channel),
and it would be clipped automatically. This may not be recommended,
so better would be to use a resistive divider to get it down to or below
the input voltage limit of the sound card. Timing is the important function
of an digital analyser rather than voltage (which for digital you know
anyway - 5V) but a sound card has an advantage that a normal analyser
doesn't. You could measure the effect of a digital signal on an analogue
signal, or the analogue's response to a digital signal. For example
converting PWM to a waveform by measuring input and output

The other attractive feature about a PC-based oscilloscope/analyser
is that you could monitor and record both digital/analogue signals in a
PIC circuit for literally hours using the installed RAM and drive space

--
http://www.piclist.com hint: To leave the PICList
@spam@piclist-unsubscribe-requestspam_OUTspam.....mitvma.mit.edu

2004\06\09@081634 by Lindy Mayfield

flavicon
face
>
> > > Can also be used as a basic, very basic two-channel, logic
> analyser
>
> > Interesting. How is your setup for this?
>
> I have to admit not doing this myself, merely pointing it out to
> Lindy as
> an inexpensive way to get a useful tool for debugging his
> circuits.
It really works very nicely.  I discovered some things, (I think), that I wouldn't have seen.  First was that I didn't see the "noise" I was expecting.  I just don't know about that yet, but it may be some sort of programming error or an error in how I am reading the AD.

The most important thing, though, was with my new scope I could see that it was wonderfully sensitive to great distances and that it wasn't fooled by turning on lights in the room.  (I also could see it was picking up the back of my chair, even though it looked completely out of the way of the LED reflection.)

I *think* this is telling me that I can greatly increase the sensitivity by boosting the signal through an op-amp before going into the AD, with a pot to adjust the gain for tuning.



---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.699 / Virus Database: 456 - Release Date: 6/4/2004

--
http://www.piclist.com hint: To leave the PICList
spamBeGonepiclist-unsubscribe-requestEraseMEspammitvma.mit.edu

More... (looser matching)
- Last day of these posts
- In 2004 , 2005 only
- Today
- New search...