Analog Sensor

Go To Last Post
49 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


Dear friends,

 

I am designing a line following robot that utilizes a sensor that is made with a Phototransistor [L-7113P3C] and IR LED [L-7113F3BT]. However, when I use a UART and put the robot design that's supposed to follow a line using a sensor the values that are outputted are very similar even on light or dark surfaces? any idea what's going on?

 

Links to components:

 

Phototransistor:

https://www.rapidonline.com/kingbright-l-7113p3c-5mm-phototransistor-58-0325

IR LED: 

https://www.rapidonline.com/kingbright-l-7113f3bt-5mm-blue-lens-infrared-diode-58-0320

 

PCB design:

 

 

Set up:

 

 

Code for ADC:

 

 

Results:

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

How do you know that your dark surface doesn't reflect IR as well as your light surface?

 

[E2A]

 

I don't see any shielding around the LED and sensor to stop the seeing a direct path for the IR.

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

Last Edited: Sun. Apr 24, 2022 - 01:26 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ee3strugles wrote:
Phototransistor [L-7113P3C]

 

R6 of 470k... perhaps too many. Can you check how it goes with 10k ohm, please.

 

First of all, tell us the voltage measured on R6 by a Voltage meter.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


First of all, thank you for responding, I really appreciate it.

 

During the testing period before soldering components onto the PCB etc. I used the same material for the line (electric tape). I also didn't use any shielding and measured the voltage output on white surface vs dark.

 

Example of the scale I used:

 

 

Results:

 

 

as you can see the voltage was fluctuating, so it should of done the same on the PCB when giving out the ADC values. Unfortunately, it doesn't...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


I tested multiple resistor values and the 470k resistor gave the best and most accurate values. The 10k resistor values are below please compare them to my other reply on the thread so you can understand how i measured them.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Can you move 10k to the collector of Q3 and try.

 

In your tables, what means Voltage column and what means Resistor column, explain please.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

That was the results for the 10k collector, also the voltage column was the voltage drop from 5v input after i turned it on, the resistor is the value of the resistor i used at the diff spots in the scale shown in my previous response. i moved the sensor from -5 to +5 measuring the collectors voltage output 1.5 cm away from the line

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I can not follow you. I asked for a voltage on R6, and, now you are telling that it is a 'drop'. Produce a valid schematic and mark measure point.

 

I can not help you, sorry, too fuzzy informations.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ee3strugles wrote:

During the testing period before soldering components onto the PCB etc. I used the same material for the line (electric tape). I also didn't use any shielding and measured the voltage output on white surface vs dark.

 

But what stops the sensor above the dark line 'seeing' the white background?

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Line Following Bots are fun.

 

You need to improve the quality of your signals.

(i.e. improve the Signal to noise ratio for your black vs white signal determination)

 

To do that:

1) Make sure your sensor's active surface is facing down.

That sounds dumb, but the active surface might not always be on the side of the sensor that you think it is!

You can look at the sensor's data sheet, and you can test the sensor.

 

2) Mount a short cylinder around the IR receiver sensor.  This could be a narrow piece of electrical tape.

This helps to decrease the ambient light that hits the sensor.

 

3) Mount your IR Tx and Rx as close to each other as you can, within mm's of each other, AND put them as close to the surface of the track as possible, i.e. just mm's above the track.

This, also, will increase your signal's quality, (S/N ratio).

 

JC

 

Edit:

Solved: 8 Channel IR Line Following Robot Sensor Question | AVR Freaks

 

Look at Post #14 of the above Thread.

That Thread is about one of my LFR's, and the guidance I received from The Freaks.

 

Two things to note:

1) The IR Sensor array I used was easy to use and very cheap.

(Easy to use once I understood how to turn the IR emitters (sources) on and off).

 

2) It shows how I mounted the sensor PCB just barely above the track.

I used two springs from clickable pens and long bolts and nuts to allow me to adjust the sensor PCB's height.

 

JC

 

Edit:

Technically you can build a LFR with only 2 IR sensors.

It makes the tracking algorithm a bit more complex.

Having an odd number of sensors, i.e. 3 sensors, or a sensor array, (5, or 8, etc.), makes the tracking algo easier.

 

Once you have a good sensor signal you will appreciate this concept better.

 

JC

 

 

Last Edited: Sun. Apr 24, 2022 - 03:42 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

To reinforce grohote's concerns, the phototransistor data sheet charts with R6 of 470K, where the maximum current would be around 10uA, would have the phototransistor operating at bottom of the charts at 0.0 mA. The phototransistor is not in a usable operating condition.

 

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


Dear Doc,

 

Thanks for the response, I have attached some images below to show different angles of my sensor setup. I don't think I am able to mount a short cylinder, and the IR LED and Phototransistor are as close as possible. I also made sure they were phasing the right way using the datasheet provided. Any other suggestions on how I can improve the signal? because before the soldering onto a PCB these sensors were giving me a good reading :(. Also this is just the start of my line following robot i have a lot more to do since mine plans to be closed-loop system and uses odometry to know where it is on the track using encoders.

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Dear sbennett,

 

Thank you for your response, from your response I realized that the voltage input for my IR LED is way too high I'm getting 0.03 amps when the parameters require 20 mA to work at its best intensity with voltage input of 1.2-1.6 V.

and regarding the phototransistor i dont know how to read that datasheet.

 

kind regards,

EE3struggles

Last Edited: Sun. Apr 24, 2022 - 05:18 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You don't seem to be doing much actual investigation.  Why?  Did you try disconnecting the LED? Did you try covering the sensor to see the value? Did you shine a lamp into the sensor?

Since the ADC has a very limited range (or clipping), did you use a multimeter to measure your readings during this problem?

 

The ADC needs to see a resistance of roughly 10k or lower, you cannot use 470k with the ADC. You might get to 50k or 100k with some degradation of results, but 470k is way off the chart.

With 10k, if you shine a flashlight/led at the sensor or cover it up do you get a wide voltage response?

You'd prob be better off using a buffer to drive the ADC, then you have more flexibility on the detector side.

 

read here, around 3.2-8:

https://marktechopto.com/applica...

 

I also didn't use any shielding and measured ​​​the voltage

Did you evaluate the sensitivity to variations of that approach?  It may be as sharp as a knife blade--a little change in the situation can upset things a lot. 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Dear avrcandies,

 

Thank you for your response. to answer a few of your questions. I cannot disconnect the LED, however, I did cover up the sensor and read the ADC values to see if a change occurred, and I did test the sensor on a completely white surface vs a black surface with barely any change in the value. Furthermore, I didn't use a multimeter to measure the readings during the problem since I'm working from home on this home project and am very limited with equipment and experience. This is the first time I'm attempting something like this. 

 

Kind regards,

ee3struggles

 

p.s. also im about to start reading the link you provided.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 I don't think I am able to mount a short cylinder, and the IR LED and Phototransistor are as close as possible.

 You can't put a half inch of non-transparent heat shrink tubing over the detector?  That would give some directivity.  A colored straw might help in a pinch--Some plastics are very transmissive to IR, though they look opaque (look at a tv remote control with a red plastic end).

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

Last Edited: Sun. Apr 24, 2022 - 04:57 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Change it to 10k.  Now aim a LED directly into the sensor and also block it...do you now get wide adc readings? That shows things are working.   

That may say you are not getting enough reflection to drive the sensor very well.  You can increase the illumination (more LEDs, brighter LEDs, etc), or add gain to the sensor.

Watch out the ADC itself isn't clipping and confusing the issue (that is where a multimeter would be helpful for diagnose).

 

You can prob get away with 50k tops.  You do have a 0.1 or 0.01 uF filter cap at the ADC pin?  I hope so, you don't want a noisy signal.

 

As an aside, I much prefer photodiodes for any measuring app (such as making a light meter)...they are extremely straight-line linear over several orders of magnitude.  Here you are less concerned about that & the phototransistor should be fine.

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You must have Voltage meter of 10M ohm (digital one), to measure R6 voltage toward ground. If 5V, or 0V with some light, it is not good.

 

Try to decrease R6 to 10-47k, and place them in Collector, then Emitter goes to ground. This is for a better sensitivity.

 

Other options is: optotransistor does drive another transistor, which have 10k towards AVR.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you for all the responses, a bit overwhelmed and stressed but appreciative of all the comments. I'll try to go to a laboratory tomorrow and test everything. Hopefully theyre open.

 

kind regards,

EE3struggles

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

place them in Collector, then Emitter goes to ground. This is for a better sensitivity.

I would avoid that since in moving it to the collector, the measured voltage (voltage drop from Vcc) is not referred to gnd, but the variable VCC_CONNECT.

It is better to measure the voltage with respect to common adc gnd so as to maintain the ADC precision.  

 

 

https://www.allaboutcircuits.com...

 

https://www.elprocus.com/phototr...

 

 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

Last Edited: Sun. Apr 24, 2022 - 05:52 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

avrcandies wrote:
I would avoid that

 

Agree with you in principle, a 10k in emitter looks solid. If only possible.

 

See in our forum for further reading.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


Just a quick update, I activated my program on my board without a sensor even being connected and I was still getting ADC values as shown below: Any idea why this is occurring?

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 Any idea why this is occurring?

Strange question....Because you are reading values, you get values.  did you try grounding your ADC pin?  did you try jumpering it to Vcc?

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

avrcandies wrote:

 Any idea why this is occurring?

Strange question....Because you are reading values, you get values.  did you try grounding your ADC pin?  did you try jumpering it to Vcc?

 

Shouldn't even have any values since it's not reading anything? But yea i was just trying to test some things but like i said i have to wait till tomorrow when i have access to a lab to do proper changes since im limited.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ee3strugles wrote:

Shouldn't even have any values since it's not reading anything?

 

But it is reading something. Even a disconnected pin will have some voltage on it. Have you ever connected up an audio system and heard hum because a cable was missing? That's because the audio system was picking up stray mains voltages. The only way to ensure a stable voltage is to connect to something. It can be Vcc, it can be ground, but it'll be something.

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

oh snap true, thanks.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Shouldn't even have any values since it's not reading anything?

 Keep your programming hat on---what do you expect your code steps to do?  One of your steps, probably the last, is to send a number back to the caller of the ADC measurement.  Now which number you get in the situation might be a question that you'd discuss.

What happens to your ohmmeter or voltmeter readings before you connect it to a circuit---you see some type of reading. 

 

Another very common misconception of beginners involves an assignment...here is some code  (warning do not use a spreadsheet to figure this out)

cat = 23;

dog = 4;

rat = cat + dog;

dog = 10;

frog = rat - dog; 

cat = 20;

.....you run this code, ok, how much is rat (we are not talking about your roommate)?  How much is frog ??

I hope you don't make the most common error!!!

 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


I didn't find a previous mention in the responses for alignment of each IR LED and Photo Transistor set.

 

These are both highly directional, stated as having a "Viewing Angle" of 20 degrees, also described as Half-Angle or Angle of Half Intensity/Sensitivty. Look at the Spatial Distribution chart for the IR LED, below.

 

They seem to be mounted solidly (perpendicular) on the sensor circuit board in posts #1 & #12.

 

Ideally one or both should be angled such that they look at the same spot on the track to be followed.

 

Unsolder both the IR LED and Photo Transistor and pull them out a bit such that they can flex on their leads for aiming before resoldering.

 

If their two "Viewing Angles" do not intersect well the Photo Transistor won't be able to decisively detect when moving on and off the track.

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I will be doing this, thank you for your input and advice. For today im only able to change the resistor and will post the results later.

 

kind regards,

EE3struggles

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I switched the value of R6 from 470k > 10K and now the values are not the same anymore. When one of the sensors is in the presence of a dark surface the ADC is reading 990 while the other one on a light surface is reading 999.

when they're both on the line they read 995. so i guess changing the resistor helped give me a wider spread of values than i was getting before because previously they were giving same value no matter what surface was there.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Now you are dealing with maybe: a weak light, 10 counts is not enough for reliability.   What do you get when aiming into thin air?  What if you cover up the led (do you have led light leakage to the sensor). You should get a very low value.

If you aim a led right into the sensor what do you get? What about when you cover the sensor---you should read closer to zero.

Try reversing the detector leads---you may have them backwards!!!

Are you too far away from the tape?

Report your numbers.

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 

The results below show from left to right, aiming towards the ceiling (air), aiming a flash into the sensor, aiming the sensors on the line (downwars), and the last one shows covering the LED then covering the phototransistor from top to bottom:

 

not sure how to aim the LED right into the sensor since ive soldered on my components and i dont know how to reverse the detector leads and im within a cm from the line when phasing downwards.

 

p.s.: the voltage im using to power both phototransisitor and LED is 5v

 

Last Edited: Tue. Apr 26, 2022 - 04:01 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

maybe i should change the value of my resistor for the LED cause at the moment its 160 for R5 i should make it 220 or 270 so the current to it is 22.73 to 18.52 mA instead of 31.25 mA it is at the moment? maybe ive been using to much current and ive damaged my ir leds?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

not sure how to aim the LED right into the sensor since ive soldered on my components

Just use a flashlight, we want to see that it maxes out (looks like maybe you did that in column 2?).  In any case, your low numbers (190, 200, etc) of the last column shows you do have dynamic range (good)*, but you are suffering from light leakage (either from room light or from the led next door. Try putting a piece of black heat shrink tubing around the sensor (or wrapping it in black tape) , so only the front face is visible. 

It may be that the floor is reflective (good), but your tape is also reflective to IR (bad). It is shiny or dull?  Is it black masking tape or shiny plastic tape?  Try a sheet of black paper as a comparison--what kind of numbers do you get? Do you have any masking  tape?  Evaluating IR reflectivity by eyeball is somewhat hit or miss (other than a dull surface vs shiny).

 

* which also proves the sensor is installed with the correct polarity.

 

No, it does not seem like the led is damaged.  It seems like you are suffering from light dynamics, such as adjacent leakage or room light, or the tape is too reflective (which ruins dynamic range).   9 or 10 counts of range is probably way too little. 

changing the resistor somewhat can change the dynamic "balance", but is probably not the first thing to investigate.

 

Evaluating IR reflectivity by eyeball is somewhat hit or miss (other than a dull surface vs shiny).

Darker colors absorb the visible wavelengths in sunlight, not IR rays. Therefore, the color of the material is unimportant in the ability of a material to absorb infrared light. 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

Last Edited: Tue. Apr 26, 2022 - 04:32 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

avrcandies wrote:

Try putting a piece of black heat shrink tubing around the sensor (or wrapping it in black tape) , so only the front face is visible. 

 

I'd use something known to be more IR-proof. I speak from bitter experience; credit cards pass IR quite well.

#1 Hardware Problem? https://www.avrfreaks.net/forum/...

#2 Hardware Problem? Read AVR042.

#3 All grounds are not created equal

#4 Have you proved your chip is running at xxMHz?

#5 "If you think you need floating point to solve the problem then you don't understand the problem. If you really do need floating point then you have a problem you do not understand."

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'd use something known to be more IR-proof. I speak from bitter experience; credit cards pass IR quite well.

Very true---we made an IR unit who's plastic case looked normal (solid), but let our IR signal come right through as desired.  I've used some electrical tape here for blocking IR sensors, & it did knock the levels way down...your milage may vary!

 

Maybe we actually want the tape reflectivity to be high & the adjacent floor (carpet?) to be low?  Ultimately we want a significant difference of some sort between the two

 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

Last Edited: Tue. Apr 26, 2022 - 04:45 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


The values changed rapidly when i used credit cards to cover the phototransistor. Unfortunately, i don't have any shrinking tube but I do have black electric tape (the same type I'm using as the line)

 

do you basically want me to cover the LED like this? (please excuse terrible drawing)

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

How about rolling a tube of tinfoil (watch out for shorts!)...you know that will block IR coming through from the led next door. Put that around the sensor & extend it just a little beyond the face.

 

Maybe we actually want the tape reflectivity to be high & the adjacent floor (carpet?) to be low?  Ultimately we want a significant IR reflectivity difference between the two surfaces.

 

interesting:

most dyes are transparent at near-IR wavelengths, so dark fabric or other dyed material will show up as white.

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

Last Edited: Tue. Apr 26, 2022 - 04:51 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ee3strugles wrote:
maybe i should change the value of my resistor for the LED

 

There is a workaround here. Advanced solution will do it pulsed, when a measure is starting the same moment as the pulse of the IR light.

 

The pulse length- calculate yourself, should not be more than 10 ms per measure.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm a bit late to this, but in my personal experience 'shiny black electrical tape' and 'white paper' look almost identical in the infrared. 

 

Just because your eyes see 'white' and 'black' doesn't mean your IR sensor does.  Get some matte black tape (I used gaffer tape, but that might not be readily available),  or any of a number of not-shiny surfaces.  Try coloring paper with a black marker.  Try a few other things, and just wave them at the sensors while watching your readings.  It's remarkable how different things look at different wavelengths.

 

Have fun,  S.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

There is a workaround here. Advanced solution will do it pulsed, when a measure is starting the same moment as the pulse of the IR light.

Well, yes and no.  It won't help much here if the tape and floor have close to the same reflectivity.   It can help verify you are seeing the IR source rather than background light.  It is more helpful in cases where the sensor is AC coupled, to reject the DC ambient.

 

example sensing report from someone (showing what is possible):

. The values will be hundreds apart. I get about 700 for the background, dark gray carpet, and about 100 for the line, masking tape.

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

Last Edited: Tue. Apr 26, 2022 - 06:31 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Reading previous posts seems that black line surface must not be smooth, but mat.

 

Remember /from TV/ how the Scrolls of the Dead Sea were read: by IR wavelength that penetrates to some depth of a pergament structure.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

This might be worth a read to give yourself more ideas about line following/sensors and so forth:

https://renegaderobotics.org/wp-...

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ee3strugles wrote:

The values changed rapidly when i used credit cards to cover the phototransistor.

That's the best approach - start with what gives largest changes, (ie start with a brick wall / open space :)  ), and then move the test to closest to your final track and you need to confirm your track contrast with a meter, not your eyeball.

Another test is to switch the LED current manually, and meter the phototransistor, as you will then see how much of your own infrared source the  phototransistor 'sees'.

 

ee3strugles wrote:

Unfortunately, i don't have any shrinking tube but I do have black electric tape (the same type I'm using as the line)

do you basically want me to cover the LED like this? (please excuse terrible drawing)

I'd suggest shielding the photo transistor rather than the LED, as your simple linear design is very susceptible to side-light pollution.

 

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ee3strugles wrote:

I have attached some images below to show different angles of my sensor setup. I don't think I am able to mount a short cylinder, and the IR LED and Phototransistor are as close as possible. I also made sure they were phasing the right way using the datasheet provided. Any other suggestions on how I can improve the signal?

because before the soldering onto a PCB these sensors were giving me a good reading :(. 

That last statement is a clue, as mentioned above, 'as close as possible' is not quite optimum, you need the emitter to be focused on the track, at the track operating height.

I would make the detector vertical, as that is easier to place a tube around, and then angle the emitter so the spot is directly under the detector at the track operating height.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thank you, everyone, for responding and giving me tips, tomorrow i intend to make tubes with the tape around the phototransistors and do the tests, i will also order some matted black tape or paper and check if the value changes vs the current line i have.

 

honestly, i really appreciate all the guidance everyone's given me, and @avrcandies I will read the line following the robot link you provided as well. hopefully im able to fix this sensor issue so i can move onto PWM and PID 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

 (watch out for shorts!)...you know that will block IR coming through from the led next door. Put that around the sensor & extend it just a little beyond the face.

 

By extending the tube slightly it will "zoom in" on a smaller area & less susceptible to reflections from a larger surface area.. You could even have more leds, though it is prob not needed (you seem to have plenty).  You are flooding the surface with light and ideally either reflecting or not reflecting depending on position.  However you are not looking at a pinprick, so any extraneous light off adjacent surfaces (such as from extra leds) causes interfering degradation.  

If you wanted to get fancier you could add lenses for a more focused distance, use a laser pointer for a pin spot, etc.

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0


 

avrcandies wrote:

... (watch out for shorts!)...you know that will block IR coming through from the led next door. ...

Indeed, shorts blocking the IR coming through the window:

 

 

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

Last Edited: Wed. Apr 27, 2022 - 01:58 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Indeed, shorts blocking the IR coming through the window:

Don't get burned by IR! 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!