Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: RITESH29 on January 07, 2012, 07:30:36 AM

Title: About I.R. sensors.......
Post by: RITESH29 on January 07, 2012, 07:30:36 AM
Hello Everyone,

I was just testing SOR IR circuit .....
I was just confused that above it was R2 20kohm Pot and at below R2 = 220 Kohms (calculate as above, or use Pot for white line following) so, is that any mistake ??
http://www.societyofrobots.com/schematics_infraredemitdet.shtml (http://www.societyofrobots.com/schematics_infraredemitdet.shtml)

and is there any cathode and anode of photo diode also if yes how to know?
Title: Re: About I.R. sensors.......
Post by: Cristi_Neagu on January 07, 2012, 09:34:38 AM
If you would have looked above, you would have noticed this:

Quote
Or use a 20kohm Pot here in series with a 100ohm resistor for white line following calibration.

You either use a resistor, or, if the one resistor doesn't work properly, you could use a pot to calibrate the line follower.
Title: Re: About I.R. sensors.......
Post by: RITESH29 on January 07, 2012, 09:36:29 AM
I think you don't get me any way...
In above it is 20K then R2 changes too 220k
Title: Re: About I.R. sensors.......
Post by: Soeren on January 07, 2012, 09:09:29 PM
Hi,

I think you don't get me any way...
In above it is 20K then R2 changes too 220k
You're mentioning R2 values for two different circuits.
Title: Re: About I.R. sensors.......
Post by: RITESH29 on January 07, 2012, 09:18:42 PM
ohhh.... It was may mistake.
Anyway I want to add some more doubt:-
1.) I am little confused how to find cathode and anode of Photo diode as it is black(opaque) from out.
2.) As per schematic value of all resistance is given, whenever i use pott. meter they never set to accurate and changes every time. so I want to have five sensors in BOT can i do multiplex with resistance to reduce the numbers of resistance.
Title: Re: About I.R. sensors.......
Post by: Soeren on January 07, 2012, 10:29:45 PM
Hi,

Anyway I want to add some more doubt:-
1.) I am little confused how to find cathode and anode of Photo diode as it is black(opaque) from out.
You need photo transistors (PT), not photo diodes (PD), but perhaps it is PT that you have(?)

Some PT's have 3 pins (base, emitter and collector)and look exactly like a common transistor, only with a window (whether "black" to the naked eye or water clear), while others have only two pins (collector and emitter).

The incoming light goes to the base in both configurations and the PT's with the base brought out can be used to bias the PT to speed it up a little or a lot (while lowering its sensitivity proportionally).

Since I don't know which device you have (they come in many shapes), I can only give general advice...
Connect it up with like in the drawing in series with anything between 22k and 220k and measure the voltage over R2. Now cover the PT and the voltage should fall, then let light shine on it again and the voltage should rise - if it don't, reverse the pin connections.

The exact voltage change (light/dark) depends on the value of the resistor as well as your specific device, but anything from 1V upwards is proof it works.

If you cannot get at least 1V of change (no matter the way you connect it), it's probably a PD instead and that won't work in this simple circuit.

A datasheet will tell the connections as well (and have a lot more useful content). Always find datasheets on the components that you use - only way to know all the details.


2.) As per schematic value of all resistance is given, whenever i use pott. meter they never set to accurate and changes every time. so I want to have five sensors in BOT can i do multiplex with resistance to reduce the numbers of resistance.
Not sure I understand what you mean?
If light changes, so does the resistance value needed for a given output, but I don't think that's what you think of.

Do you want to have five sensors just to make up for the varying light, or do you want to 5 sensors and want to save 4 resistors by using more I/O pins?

Or is it just to save trimming potentiometers?
If so, take a look at this circuit (http://That.Homepage.dk/PDF/Line_Sensor.pdf), which is a 4 sensor circuit. It can be extended easily, but since op-amps comes in either singles, duals or quads, it made sense making a 4 sensor module, but in principle, any number is possible.

If you meant something else, please try to rephrase it :)
Title: Re: About I.R. sensors.......
Post by: RITESH29 on January 07, 2012, 10:42:00 PM
Hi,

I am using this as show in images....

Quote
Some PT's have 3 pins (base, emitter and collector)and look exactly like a common transistor, only with a window (whether "black" to the naked eye or water clear)

In three terminal the surface are is big so, i think it will pick some stray Infrared rays also,right?

Quote
or do you want to 5 sensors and want to save 4 resistors by using more I/O pins?
Yes...

The circuit you are telling  is totally diff. is there anyy way to find Resistance values?
Title: Re: About I.R. sensors.......
Post by: Soeren on January 08, 2012, 12:12:46 AM
Hi,

In three terminal the surface are is big so, i think it will pick some stray Infrared rays also,right?
That's not determined by the area. A larger area just means it's more sensitive (and more sensitive to noise, but that's not an issue in this circuit).

I think you're really thinking of angle of incident light, rather than surface area and the angle has nothing to do with the number of pins.

The devices you have, do they resemble 3mm LED's, only black?


Quote
or do you want to 5 sensors and want to save 4 resistors by using more I/O pins?
Yes...
It could be done, but you'd need an analog multiplexer like 4051 and while you'd save 4 resistors, it would be more expensive and take up more PCB space.


The circuit you are telling  is totally diff. is there anyy way to find Resistance values?
The best way to find the resistance values is looking at the schematic - sort of like Find Waldo actually, just easier ;)

The main difference from the other schematic is, that this circuit uses the op-amps like comparators, rather than as gain-blocks.

Each "op-amp-comparator" has got hysteresis by the 4.7 MOhm resistors, to avoid oscillation around the shifting point and they all share the same reference voltage from the wiper of VR1. This means that the photo transistors needs to be the exact same type and preferably from the same production batch (which they'll usually be if you buy a sealed bag of eg. 10 devices.)
The outputs are high/"1" when they see light.


If you want to make it as cheap as possible, just go with the first circuit on the page you referred to, the one without op-amps. The outputs can go directly to the I/O pins of a controller.

You just need to make one circuit, to find the best resistor value. Use a potentiometer or a trimmer to dial it in, then de-solder it without disturbing the position of the wiper and measure its value. Finally install resistors with the same value as you measured.
Title: Re: About I.R. sensors.......
Post by: RITESH29 on January 08, 2012, 07:29:03 AM
Hi again,

Quote
The devices you have, do they resemble 3mm LED's, only black?
Sorry i don't get u?

Quote
Each "op-amp-comparator" has got hysteresis by the 4.7 MOhm resistors, to avoid oscillation around the shifting point and they all share the same reference voltage from the wiper of VR1.

Can you explain me more about hysteresis in comparator, how??
that mean using gain block will not have hysteresis, right??

Quote
If you want to make it as cheap as possible, just go with the first circuit on the page you referred to, the one without op-amps. The outputs can go directly to the I/O pins of a controller.

No way i don't want to losses quality of signal...!!

Quote
ou just need to make one circuit, to find the best resistor value. Use a potentiometer or a trimmer to dial it in, then de-solder it without disturbing the position of the wiper and measure its value. Finally install resistors with the same value as you measured.

OK, I was just using that second gain block op-amp circuit in SOR the value of R2 was given as 200K but i don't find that efficient as compare to 20-30K .......
so, i think 20K pot. meter is best.

Finally install resistors with the same value as you measured.
But in some cases like outdoor using line follower will causes problem in its sensitivity, then how to change the reff. voltage..?



Title: Re: About I.R. sensors.......
Post by: Soeren on January 08, 2012, 04:46:17 PM
Hi,

Quote
The devices you have, do they resemble 3mm LED's, only black?
Sorry i don't get u?
Never mind, I took a look at your blurry photos.
Do you know the name of the PT's and do you have a link to the datasheet?


Can you explain me more about hysteresis in comparator, how??
that mean using gain block will not have hysteresis, right??
Sorry, this is not the place for complete tutorials. Google the subject, there's plenty of tutorials on both op-amps and comparators on the web.


Quote
If you want to make it as cheap as possible, just go with the first circuit on the page you referred to, the one without op-amps. The outputs can go directly to the I/O pins of a controller.

No way i don't want to losses quality of signal...!!
What makes you think that you'd loose quality in that circuit over the other?


OK, I was just using that second gain block op-amp circuit in SOR the value of R2 was given as 200K but i don't find that efficient as compare to 20-30K .......
so, i think 20K pot. meter is best.
Electronics is not a guessing game. The resistance needs to be tailored to the effective resistance of the PT (under the various conditions it will operate) and the threshold value of the op-amp.


But in some cases like outdoor using line follower will causes problem in its sensitivity, then how to change the reff. voltage..?
There's plenty of ways to do that, but you need to understand the circuit and the components first and building the basic circuit will be a step in that direction.

Measure the needed resistance in all possible environments, outdoor in strong sun light, indoor in semi darkness or whatever. Then use a resistor a little lower in value than the minimum resistance needed and make up for the rest with a potentiometer in series.

It's possible to make automatically self adjusting circuits as well, but you need to start with circuits that you have a decent chance of understanding - and after a while, you'll be able to improve the circuits.
Title: Re: About I.R. sensors.......
Post by: RITESH29 on January 08, 2012, 09:32:56 PM
Hi again,
Quote
Do you know the name of the PT's and do you have a link to the datasheet?

I think its local Photo transistor....no data sheet provided.
and how to differ between photo diode and photo transistor?

Quote
Measure the needed resistance in all possible environments, outdoor in strong sun light,

I have measure the resistance in sunlight it was very less (negligible), can i use freq. modulation then filter it ..?
as we do this in Television remote control???
Title: Re: About I.R. sensors.......
Post by: Soeren on January 08, 2012, 11:08:48 PM
Hi,

I think its local Photo transistor....no data sheet provided.
and how to differ between photo diode and photo transistor?
Since you can measure a large difference with a DMM, it's a transistor.


I have measure the resistance in sunlight it was very less (negligible),
"very less (negligible)" doesn't really tell me that much, as I have no idea of your frame of reference. I'd guess that anything from 10mOhm to a few hundred Ohm, perhaps a few kOhm might be considered a small value compared to the dark value, but you need exact numbers to complete the circuit.
Whenever you make measurements, take notes - they will come in handy when you need them but cannot make them, like measuring sun light at night (only works in two very cold areas ;)).

Since you need this for a line follower, you need to make the measurements like the sensors will be used, which is close to the ground and pointing down. Don't point the PT's into the sun, that wont give you a realistic result.
A shade can be made to shade the sensors, if the sun is still too bright when measured correctly.


can i use freq. modulation then filter it ..?
as we do this in Television remote control???
Yes, when you have learned to use them. For now, just build a single version of the simplest (i.e. non op-amp) circuit and mount it in a way that will give you realistic data. Then experiment and take notes along the way.
IOW, don't dream up more ways to solve a problem that you haven't verified the existence of yet - build the plain one and see if there is any issues that needs attention, you're just wasting time as it is.
Title: Re: About I.R. sensors.......
Post by: RITESH29 on January 09, 2012, 08:51:03 AM
Hi again,

I am really suck with this circuit, i don't understand this simple circuit is creating so much problem with IR as there is no datasheet for Photo diode I can't surely identifies the -ve and +ve terminal ( cathode and anode) + The value of R2 as i am using 50K pot. meter varying it is also not changing so much reference voltage to op-amp .....

any hint or suggestion that any one wants to give me for this problem will be appreciated..!!
Title: Re: About I.R. sensors.......
Post by: Soeren on January 09, 2012, 01:16:17 PM
Hi,

I am really suck with this circuit,
Then compensate by listening :)


i don't understand this simple circuit is creating so much problem with IR as there is no datasheet for Photo diode I can't surely identifies the -ve and +ve terminal ( cathode and anode) + The value of R2 as i am using 50K pot. meter varying it is also not changing so much reference voltage to op-amp .....
Don't blame the missing datasheet. Identifying is simple - if it doesn't work, it's the other way around.

Do not use a potentiometer without a series resistor of a least 2..5kOhm. If you do and you then turn it fully to one side, you have close to 0 Ohm and bright light may then make the PT self destruct.
Perhaps you already did and then you probably need a new PT.


any hint or suggestion that any one wants to give me for this problem will be appreciated..!!
OK, but if you don't follow this, I'll stand down.
Build this basic circuit:
(http://www.societyofrobots.com/images/schematics_infraredemitdetbas.jpg)
With the values:
Vcc = 5V
R1 = 220 Ohm
R2 = 100 kOhm

No potentiometers, just the above mentioned resistors (and the LED and the PT of course)!
Then measure the voltage at Vout (referenced from GND) under 3 different lightning conditions; Outdoor in sunshine, indoor in well lit room and finally in a semi-dark room. Remember to position the PT as it will be used on a 'bot.

Note each voltage reading and post the numbers with the condition under which it was taken (dark, light or inbeteen), then I can calculate the approximate value needed for R2 to get the output voltage you need.

Mind you, that if you do not produce these number, I'll consider you out of reach, as this really is a 2 posts max. problem.
Title: Re: About I.R. sensors.......
Post by: RITESH29 on January 09, 2012, 09:30:28 PM
Quote
Remember to position the PT as it will be used on a 'bot.
Sorry, i didn't get you..!!
Title: Re: About I.R. sensors.......
Post by: newInRobotics on January 10, 2012, 01:33:50 AM
Quote
Remember to position the PT as it will be used on a 'bot.
Sorry, i didn't get you..!!
Put photo-transistor to where it has to be on the robot and then take measurements Soeren asked You for.
Title: Re: About I.R. sensors.......
Post by: RITESH29 on January 10, 2012, 07:16:25 AM
Hi again,

Quote
Put photo-transistor to where it has to be on the robot and then take measurements Soeren asked You for.
OK, i am just testing it on Bread board for now..!!

my reading are:-----

a.  Dark condition 3.8V max 1V min
b.  Bright             .7V max  .21V min
c.  Normal           3.3V max .20V min

max mean black and white -> min.



Title: Re: About I.R. sensors.......
Post by: RITESH29 on January 10, 2012, 08:50:33 AM
I forget to add these value of Resistance used..!!

R2-> 28K(pot) + 4.7K ( series)
R1 with IR Tx -> 600Ohms
Title: Re: About I.R. sensors.......
Post by: newInRobotics on January 10, 2012, 12:05:18 PM
It works  ;)
Title: Re: About I.R. sensors.......
Post by: RITESH29 on January 10, 2012, 09:21:52 PM
Quote
It works  ;)

No need to add op-amps??
Title: Re: About I.R. sensors.......
Post by: newInRobotics on January 11, 2012, 02:38:33 AM
If R2 is well picked - then no need for op-amp. Just wait for Soeren to come back to You with calculations he promised ;)
Title: Re: About I.R. sensors.......
Post by: RITESH29 on January 11, 2012, 09:08:55 PM
Help needed......
Title: Re: About I.R. sensors.......
Post by: newInRobotics on January 12, 2012, 02:05:25 AM
It would help if You wrote what help exactly You need. Or are we supposed to guess?  ;D
Title: Re: About I.R. sensors.......
Post by: RITESH29 on January 12, 2012, 02:43:22 AM
I want to add gain block op-amps....
and why we use these op-amp why not this voltage divider circuit for IR sensors??
Title: Re: About I.R. sensors.......
Post by: newInRobotics on January 12, 2012, 04:53:19 AM
I'm not sure I understand what You ask.

If You want to add op-amp to amplify the signal from IR circuit, why do You ask what op-amps are used for?
Title: Re: About I.R. sensors.......
Post by: RITESH29 on January 12, 2012, 06:26:38 AM
I was just asking as we have the voltage divider was giving good result....that mean using op-amp will give more result.
So, I was just confuse many time that what point to keep in mind while calculating the resistance..
Title: Re: About I.R. sensors.......
Post by: Soeren on January 12, 2012, 07:28:30 AM
Hi,

OK, i am just testing it on Bread board for now..!!

my reading are:-----

a.  Dark condition 3.8V max 1V min
b.  Bright             .7V max  .21V min
c.  Normal           3.3V max .20V min

max mean black and white -> min.
I forget to add these value of Resistance used..!!

R2-> 28K(pot) + 4.7K ( series)
R1 with IR Tx -> 600Ohms
Next time, just use the "Modify" link to add it into the other post.

Even if on breadboard, you can take the entire breadboard and hold it upside down to imitate the intended use.

It's amazing how you, in a simple circuit with 2 resistors, can get 4 things wrong!

I'll just repeat it here...
Build this basic circuit:
(http://www.societyofrobots.com/images/schematics_infraredemitdetbas.jpg)
With the values:
Vcc = 5V
R1 = 220 Ohm
R2 = 100 kOhm


No potentiometers, just the above mentioned resistors (and the LED and the PT of course)!
[...]
Remember to position the PT as it will be used on a 'bot.
Apart from that, where did you get a 600 Ohm resistor? There's no 600 Ohm resistors in the standard ranges.

If you want the circuit done and working, stop acting like a 9-year old that had way too much sugar and pay attention.
Forget about hooking up an op-amp, if you cannot even make this simple circuit work, an op-amp will just complicate matters - a lot.

You also need to understand how each component work, so keep things simple and you may have a chance of getting it together (although I'm starting to have serious doubts).

Try once more and do it as directed - including turning the breadboard (or at least the LED and PT) upside down. Don't let the sun shine into the PT, not even from the back - use black tape on the sides and the wire end if needed.

And please stop writing "Help needed......" posts - we already know that and such post are just annoying.
Title: Re: About I.R. sensors.......
Post by: RITESH29 on January 12, 2012, 07:36:28 AM
Hi again,
Quote
Apart from that, where did you get a 600 Ohm resistor? There's no 600 Ohm resistors in the standard ranges.

It was ~~600ohms

OK, i will try once more time using 100K and 220ohms...

thanks
Title: Re: About I.R. sensors.......
Post by: RITESH29 on January 16, 2012, 03:10:10 AM
Hi again,

I was waiting for clear cloud as there was raining regular.

So, today the climate was better than previous.

1.  in room medium white -> 0.12V black-> 0.16V
2.  in room bright    "            0.14V "           0.18V
3.  outside not so bright         0.13V             0.17V
Title: Re: About I.R. sensors.......
Post by: Soeren on January 16, 2012, 04:36:25 PM
Hi,

1.  in room medium white -> 0.12V black-> 0.16V
2.  in room bright    "            0.14V "           0.18V
3.  outside not so bright         0.13V             0.17V
Looks like you have more light indoor than out in the sun.
I assume this is using 5.0V and a 100k resistor? (Always mention your measuring conditions to avoid mistakes).

If you had adjusted your voltmeter from the 20V range to the 2V range, the numbers would have been more reliable with better resolution - always adjust to the lowest range that will show what you measure without over-ranging.

Now change the 100k resistor to a 10k resistor and repeat the measurements in the correct voltmeter range, and confirm the component values and conditions. Then we'll see a more clear picture of the PT's range of equivalent resistance.

If you have overcast sky, just do the indoors measurements for now.
Title: Re: About I.R. sensors.......
Post by: RITESH29 on January 17, 2012, 03:39:19 AM
Hi again,

Here is the reading:-

1. In dark ROOM at 100K PT  and 220ohm IR Tx   0.131V on white and 0.178V on black
                            10K    "             "                 0.75V  "                  3.12V   "

2. on semi bright sky 100K                                 0.122V "                    0.167V
 "         "                   10K "                               0.4V                          3.5V
Title: Re: About I.R. sensors.......
Post by: Soeren on January 17, 2012, 06:47:26 AM
Hi,

Here is the reading:-

1. In dark ROOM at 100K PT  and 220ohm IR Tx   0.131V on white and 0.178V on black
                            10K    "             "                 0.75V  "                  3.12V   "

2. on semi bright sky 100K                                 0.122V "                    0.167V
 "         "                   10K "                               0.4V                          3.5V
Now it starts looking like something, although I wonder why you both get a lower high reading AND a higher low reading indoors (if this sounds confusing, just look at the readings), but perhaps you had slightly different distances during the indor and outdoor sessions.

Forget about the 100k readings, the PT's you have are very different from the ones on my table, but they seem to conform better to the one used in the original schematic.

Maybe more power to the IR LED will help (maybe it won't), so try changing the LED resistor to 120 Ohm as in the original. It will give around twice the current, namely 30mA.

The outdoor measurements (0.4V on white and 3.5V on black) looks fine and will drive an input pin directly. The "dark indoor" may be OK, but you'll have to test it, as the datasheet isn't particularly clear on the exact shifting points (~3.0V for the upper and somewhere between 0.5V and 1V for the lower threshold).

You need a little bit more to make sure it will work outside with a clear sky - a 10k (trimmer) potentiometer in series with a 5k resistor will allow you to vary it +/- 5k from the 10k value you have now (start with the pot midway for a total of ~10k like you have now.

Test with 120 Ohm for the LED and if that doesn't give you enough variance, adjust the pot a small step and re-measure, you'll get the hang of where it needs to be in a given light setting in no time and you may even be so lucky to hit a spot that works in most light environments.


I hope this have given you a little bit of understanding of both the circuit, how PT's work in general and how important it is to communicate all relevant parameters when discussing a circuit ;D
Title: Re: About I.R. sensors.......
Post by: RITESH29 on January 17, 2012, 08:32:21 AM
Quote
Maybe more power to the IR LED will help (maybe it won't), so try changing the LED resistor to 120 Ohm as in the original. It will give around twice the current, namely 30mA.

Hi,

I am sure my IR will be damage then because it was getting little RED with 220ohms and when view by camera it give lot of bright light ..!!
i have seen when i put a opaque sheet between sensors like PCB give me more good reading. as without sheet most of Infrared rays pass to diode directly from it sides..
Title: Re: About I.R. sensors.......
Post by: Soeren on January 17, 2012, 08:02:56 PM
Hi,

I am sure my IR will be damage then because it was getting little RED with 220ohms and when view by camera it give lot of bright light ..!!
That's the problem with not having a datasheet...

The reason they shine a little red is not too much current, but a wave length of around 830..850nm (nano-meter) or less. This wave length is ideal for camera lights for shooting in the dark, but unless you're sure that your PT is matched to it, there's a very real chance, that its peak sensitivity is around 920..980nm and in that case, you'd see an improvement in IR light received by your circuit if you change it.

920..980nm doesn't light up nearly as much, when seen on a cam, as the shorter wavelength that shows a little visible red to the naked eye.
Perhaps the best way of illustrating the difference is, that it is something like the one from red to yellowish green.

If you compare the one you have to an IR remote for a TV or radio (which is above 900nm), it should look very light (on a cam) in comparison.
If you have a discarded IR remote, you could salvage the IR LED from it.

No matter the wavelength, just try the 120 Ohm - I promise you that is won't hurt it, just make it brighter!


i have seen when i put a opaque sheet between sensors like PCB give me more good reading. as without sheet most of Infrared rays pass to diode directly from it sides..
Yes, a screen to remove direct light is more or less mandatory, as you'll get false (direct) side light drowning out some of the reflected light without screening.

If you use PCB material, make sure it's (un-etched) copper clad, as most PCB substrates (carrier material) won't stop IR completely (I sometimes etch encoder discs from PCB and shine IR through the etched parts (FR4 glass fiber).

For screen, I usually use brass, copper or bronze foil, as they solder well and are easy to cut with common household scissors (and yet is rigid enough to stay in shape).

Another very easy way is to use a thin metal tube to cover the PT (or the LED if the PT is of an irregular shape, but screening the PT gives the best effect, as it takes some of the ambient light as well).

Plastic works well if opaque to IR, but you have to measure it first to find out, so it's easier to just go with metal - or glue some aluminum (household) foil or aluminum roofing tape on the plastic to make it completely opaque.
Title: Re: About I.R. sensors.......
Post by: RITESH29 on January 18, 2012, 03:43:25 AM
Hi again,

Today i have tested again ( bad weather) IR tx at 120ohms

1. dark room at 14K  160mv white 1.7V on black
    bright room          180mV white 2V on black

2. dark at 7K             230mV white line 3.3V on black
    bright                   208mV white line 2.9V on black (i don't know it is less than bright)
Title: Re: About I.R. sensors.......
Post by: Soeren on January 18, 2012, 01:27:49 PM
Hi,

1. dark room at 14K  160mv white 1.7V on black
    bright room          180mV white 2V on black

2. dark at 7K             230mV white line 3.3V on black
    bright                   208mV white line 2.9V on black (i don't know it is less than bright)
Could you try 10k and ~5k as well with the 120 Ohm LED resistor?
The 10k to see how much it changes the old 10k readings with the higher LED current and the 5k because it seems that you need slightly less than 7k to get the "bright" values to conform (i.e. to be at least 3V on black).
Title: Re: About I.R. sensors.......
Post by: RITESH29 on January 20, 2012, 12:59:13 AM
Hi there,

At 5K

1. bright room 3.06V at black line and 0.62V at white line
2. dark room    2.78V                        0.27V
3. outside b'coz sun was clear then earlier 2.4V  and 0.23V

At 10K

1. bright room 2.03V on black  and    0.23V on white
2. dark room 1.1V and                     0.179V
3.outside 1.2V and                          0.170V


Note:- I found these sensor do you think these work well??
http://robokits.co.in/shop/index.php?main_page=product_info&cPath=11&products_id=43 (http://robokits.co.in/shop/index.php?main_page=product_info&cPath=11&products_id=43)
Title: Re: About I.R. sensors.......
Post by: Soeren on January 20, 2012, 01:56:36 PM
Hi,

At 5K

1. bright room 3.06V at black line and 0.62V at white line
2. dark room    2.78V                        0.27V
3. outside b'coz sun was clear then earlier 2.4V  and 0.23V
When you look at these numbers together with the rest (hopefully you note them down for reference), do you come to any conclusions at all, or are they just more or less random to you?

Did you try like 3k? 2k? 1k?
You could safely try down to 470 Ohm without damaging the PT.


Note:- I found these sensor do you think these work well??
If not, they probably couldn't get away with selling them for long, but...
You are already close to a better solution yourself.

With a lower resistance you will get there, with no additional amplification and no need to readjust to adapt to different environments (not the case for the ready made unit) and you learn nothing from buying a solution - and I guess that's the main reason for your venture?

I think you should get what you have in range, if nothing else, for the learning experience, but do make some conclusions whenever you see the result of the changes you make and don't underestimate the importance of keeping a notebook with all parameters on each change and measurements (plus date and time).

If you cannot get it completely to comply under all lightning conditions, you could have a switch to select between two resistors, one for bright light conditions, the other for darker conditions. This switch could be common to all modules (if you want to make more than one sensor).

Even if you would just stop at what you have, a comparator (an op-amp coupled as a comparator would work as well), set to 1.0..1.4V with a small hysteresis (small amount of positive feedback) would make it work in dark to bright conditions.

Show some stamina and take notes of changes along the way, you're almost there :D
Title: Re: About I.R. sensors.......
Post by: RITESH29 on January 20, 2012, 09:22:28 PM
Hi there,
Quote

Did you try like 3k? 2k? 1k?
You could safely try down to 470 Ohm without damaging the PT.

Now, i have to measure at these values??
How long it will take  to have good sensors..!!

Quote
Show some stamina and take notes of changes along the way, you're almost there

The value i have noted are save on this forum so, no problem of previous readings..!
Title: Re: About I.R. sensors.......
Post by: Soeren on January 21, 2012, 12:02:43 AM
Hi,

Quote
Did you try like 3k? 2k? 1k?
You could safely try down to 470 Ohm without damaging the PT.

Now, i have to measure at these values??
That's for you to decide.
Do you want to get some routine in measuring?
Do you want to have your sensor optimized?
Do you want to learn?
Have you still not seen any pattern in output voltage response vs. resistance?


How long it will take  to have good sensors..!!
Well it's up to you how much you want to do about it. You can call it quits here and they'll work perfectly fine under some conditions.
However, don't think that you'll have optimum sensors without doing what it takes.

If you had been able to make all the previous measurements under the exact same lighting conditions, same distance to same "white"/"black" surface etc. the dynamic behavior of the PT could be calculated more precisely and personally, I'd have found the needed resistor value in a few minutes, had it been on my desk, but you have a lot to learn before you can replicate that and so, I've hoped that you'd see the patterns emerge and suddenly go "Ahaa" and complete it by yourself.

If you're bored already, electronics may not be your thing (the trip should be the motivation, the goal is not nearly as exciting as what the trip brings you), then so be it, just buy a line sensor, an H-bridge, a servo controller etc. but then you learn absolutely nothing.

Building you a robot or a sub-circuit for same is not my goal, but to enable you to make it yourself is.
What would you rather say when you present the finished robot to friends: "I build it from the ground up" or "I bough the parts and put them together like the manual said" :)


The value i have noted are save on this forum so, no problem of previous readings..!
Yes, but they sure lack some info to be used at a later date and they're not in an easy readable form.

If you keep a page or two in a note book reserved to this, it may have columns like:
Code: [Select]
Date/time, Vsupply, I_LED, R_photo transistor, Light. cond., V_out_white, V_out_black, V_range
2012-01-20 07:30, +5.0V, 30mA, 5k, indoor dim,            0.27V, 2.78V, 2.51V
                                   indoor bright,         0.62V, 3.06V, 2.44V
                                   outside fairly bright, 0.23V, 2.40V, 2.17V
You have a much better  (and faster) overview that will help you, no matter what circuit you're experimenting with (just change the columns to whatever is relevant for any given circuit).

Please tell me whether you want to take it to the end, or if I'm just wasting my time here.
Title: Re: About I.R. sensors.......
Post by: RITESH29 on January 21, 2012, 01:56:23 AM
Hi there,
Quote
Please tell me whether you want to take it to the end, or if I'm just wasting my time here.
Please don't say like this I will continue to have best result.....

Thanks.
Title: Re: About I.R. sensors.......
Post by: RITESH29 on January 22, 2012, 07:03:33 AM
Hi again,

test taken at 06:15 PM.....

with 3K 1.14V on white and 3.4V on black
       2K 2.7V                      3.8V "
"      1K 3.1V  "              "   3.95V "
Title: Re: About I.R. sensors.......
Post by: Soeren on January 22, 2012, 04:10:30 PM
Hi,

with 3K 1.14V on white and 3.4V on black
       2K 2.7V                      3.8V "
"      1K 3.1V  "              "   3.95V "
If they were taken under similar conditions to the previous measurements, clearly, 3k is too low, as the PT can no longer pull it adequately low.
The optimum value is probably somewhere between 3k and 5k (if not at 5k).

So, sticking to the 5k, which (under the chosen conditions) were close to what an Atmel wants to see.
Perhaps you have reached the limit for what they can do (although you could mess around with values a bit more to see if you can get it to comply).

However, I think it's time to bring in an op-amp (coupled as a comparator) and based on the 5k values, I've drawn and attached a simple circuit that will give you the widest possible tolerance under the tested conditions (tell me if you need it a bit larger).

I've only drawn one circuit, just duplicate it. You need two LM324 chips for 8 sensors.
The hysteresis value is to make sure the outputs don't oscillate when on a marginal reading. Choose the smallest value that don't cause "hunting" around the shift points for the fastest working circuit.

Don't forget to shield the PT from direct IR (on the sides and backside) and use a shade over the fully assembled sensor to exclude direct sunlight etc. from swamping the PTs.

In an 8 sensor setup, you might wanna use the IR-LEDs in serial strings of two (with a 56 Ohm resistor), as this will bring the total LED current down from ~240mA to ~120mA. The supply for the LED's could be switched on/off by the controller (via a transistor), if the line sensor is only used occasionally.


I just whipped up a sensor to get some numbers and the white values stays between132mV and 193mV, while the black values hovers around 4.1V except when a very bright LED lamp was shone onto the black surface, where it went down to ~200mV - so shading from direct sunlight is mandatory (and remember that some black may look white to IR).
I might get around to post a photo of it tomorrow, to show you how I ensured the conformity of the testing distance and how simple I did the temporary screening.

Done - Click image to open the photo album with the rest of the pics.
(http://that.homepage.dk/ls/ls1.jpg) (http://lse.im26y.com)
Title: Re: About I.R. sensors.......
Post by: RITESH29 on January 23, 2012, 08:55:53 AM
Hi,

Quote
I've drawn and attached a simple circuit that will give you the widest possible tolerance under the tested conditions (tell me if you need it a bit larger).

Yes sure..!!

And i don't understand the circuit it is totally different as it uses both Comparator and gain block..
as how to choose it value??
and below it what the 3 op-amp are doing..!!
Title: Re: About I.R. sensors.......
Post by: newInRobotics on January 23, 2012, 09:01:16 AM
Circuit diagram above uses only one op-amp. 3 other op-amps below are simply there because LM324 comes in packages of 4 op-amps.

R5 is there to create hysteresis.
Title: Re: About I.R. sensors.......
Post by: RITESH29 on January 23, 2012, 09:09:52 AM
Quote
3 other op-amps below are simply there because LM324 comes in packages of 4 op-amps.
But why, the + and - ve terminal of op-amp are connected from gnd and other across IR LED..?
Title: Re: About I.R. sensors.......
Post by: Soeren on January 23, 2012, 09:27:06 AM
Hi,

Quote
3 other op-amps below are simply there because LM324 comes in packages of 4 op-amps.
But why, the + and - ve terminal of op-amp are connected from gnd and other across IR LED..?
I'll have to post a larger schemmy later (have a meeting to attend in a short while).

The terminals on the lower 3 op-amps (which isn't used as gain blocks here) is just shown like you'd connect them if you have an LM324 but just build one IR circuit for experimenting. That way the op-amps are tied down and won't oscillate, wreaking havoc on the one used. The reason they connect t above the LED is just to get a potential that's above ground and since this point is, it will do fine.
In actual use, with four IR-circuits they each use an op-amp as shown with the one already connected up.
Title: Re: About I.R. sensors.......
Post by: RITESH29 on January 23, 2012, 09:35:00 AM
Quote
The terminals on the lower 3 op-amps (which isn't used as gain blocks here) is just shown like you'd connect them if you have an LM324 but just build one IR circuit for experimenting. That way the op-amps are tied down and won't oscillate, wreaking havoc on the one used.


can you explain me that please....
Title: Re: About I.R. sensors.......
Post by: newInRobotics on January 23, 2012, 11:13:29 AM
can you explain me that please....
He did explain  ;D

That way the op-amps are tied down and won't oscillate [...]

In other words: op-amps are very sensitive to static electric energy and might oscillate from rail to rail if inverting input is not connected to negative end of battery and non-inverting input - to positive end of battery.
Title: Re: About I.R. sensors.......
Post by: Soeren on January 23, 2012, 02:27:29 PM
Hi,

Here's a larger schematic:
(http://That.Homepage.dk/Img/LineSensorComp.png) (http://That.Homepage.dk/Img/LineSensorComp.png)
(Click for full resolution)
The notes on it (which I enlarged a bit as well) should clear your doubts.

It doesn't matter which of the terminals are coupled to 0V and which to a higher potential, but the way I did it, the outputs are low. They could be strapped for output high as well, by reversing the inputs - I just usually strap things to make outputs low, that way they won't be hurt by shorting to ground (and it's fairly easy to think of unconnected op-amps as not being there and thus short them with a wire end or similar).
Title: Re: About I.R. sensors.......
Post by: RITESH29 on January 23, 2012, 10:15:24 PM
Hi,

So if we use only one op-amp we will pull out the other op-amp output to zero.....so, to remove hysteresis, is that true??
but if we are not connecting other op-am will that cause any effect on other working too??
and i am not getting how R_hys are chosen as what is V_thr_low/high  ??
Title: Re: About I.R. sensors.......
Post by: Soeren on January 23, 2012, 11:05:41 PM
Hi,

So if we use only one op-amp we will pull out the other op-amp output to zero.....so, to remove hysteresis, is that true??
No. The other op-amps, when not used is tied to known steady voltages to make sure they don't oscillate. It has got nothing to do with hysteresis.


but if we are not connecting other op-am will that cause any effect on other working too??
Not if you connect the unused op-amps as shown.


and i am not getting how R_hys are chosen as what is V_thr_low/high  ??
Whenever you don't get something, try Googling the subject a little before asking.

V_thr_low is a short form of "Low threshold voltage" ( substitute with high where relevant). The output will change when the input voltage is getting lower than the threshold.

Say, if you have a lower threshold of 1.2V an an upper threshold of 1.4V.
When the input is eg. 0.5V initially and gradually rises, the output won't change until the input reaches a shade above 1.4V and when the input voltage falls again, it won't change the output until the input gets under 1.2V - The difference between the two threshold voltages is called the hysteresis voltage and it keeps the output from going crazy when you have the input at eg. 1.3V, whereas, without the hysteresis, it might constantly shift at the max. frequency it could handle, when being at the shifting point (which in this example could be 1.3V and this would lead to wrong readings (and if interrupt controlled, might bog down the controller completely).

Just use 100k for R5 as a starting point.
And if the 3 tied down op-amps worry you, just make 4 identical circuits in one go.
Title: Re: About I.R. sensors.......
Post by: RITESH29 on January 30, 2012, 10:58:39 PM
Hi,

how to decide which op-amp to be used in this ckt..??
here are some pic of my Bot ...
Title: Re: About I.R. sensors.......
Post by: Soeren on January 31, 2012, 10:29:12 AM
Hi,

how to decide which op-amp to be used in this ckt..??
Looking at the schematic might help ;)
Title: Re: About I.R. sensors.......
Post by: RITESH29 on February 01, 2012, 11:15:59 AM
Quote
Looking at the schematic might help

Hi,

I have seen that but my question is how to decide which chip will be better to use there are many lm339,etc...
Title: Re: About I.R. sensors.......
Post by: Soeren on February 01, 2012, 01:10:38 PM
Hi,

I have seen that but my question is how to decide which chip will be better to use there are many lm339,etc...
The one it was designed for will always be the best choice.
LM324 is a quad op-amp that you can get almost anywhere in the world (cheap old chip, but still very much in use), which is why I used that one.

You won't get better results with other chips and some won't work or work marginally, since I didn't design for anything but the LM324.
The LM339 won't work at all in that circuit.

Just go with the LM324 and get it over with - you won't ever finish if you constantly try to "improve" on what already works.
Title: Re: About I.R. sensors.......
Post by: RITESH29 on February 09, 2012, 10:58:02 PM
Hi,
I have build this circuit it is working fine.
but i want to know what the use of R_hys 100K as i was not using it!!
and you said there are more which work on bright sunlight with automatic changing the resistance, please tell how to build that?
Title: Re: About I.R. sensors.......
Post by: Soeren on February 10, 2012, 08:57:57 AM
Hi,

I have build this circuit it is working fine.
Good to hear :)


but i want to know what the use of R_hys 100K as i was not using it!!
Please go back over the posts, I already explained it the first time you asked the very same question!

Not using it means that at a certain light level, the circuit will start to oscillate like mad. If it happens to just one of the op-amps in a package, chances are that it will "blind" the other 3 op-amps.
Why, why, why don't you just use it as described? It's very disappointing to spend time telling you something when you clearly don't care to pay attention.


and you said there are more which work on bright sunlight with automatic changing the resistance, please tell how to build that?
With your current "track record" I estimate a lot of PITA (for me) if I start explaining those concepts and it seems you don't really need them either, as your circuit only need the hysteresis resistor to work flawless under the various conditions of light likely (assuming a shade if it sees direct sunlight), so I think I'll have to pass on that opportunity :)

Start using it as is and get some experience on the circuit, then in a year or so, you may be ready for an "upgrade".
Title: Re: About I.R. sensors.......
Post by: RITESH29 on March 18, 2012, 04:08:31 AM
Hi again,

I will to know the method you calculate the value of Resistance here R2/3/4...??
as now i am using this IR pair from:-
http://robokits.co.in/shop/index.php?main_page=product_info&cPath=11&products_id=222 (http://robokits.co.in/shop/index.php?main_page=product_info&cPath=11&products_id=222)

thanks
Title: Re: About I.R. sensors.......
Post by: Soeren on March 18, 2012, 08:10:56 AM
Hi,

I will to know the method you calculate the value of Resistance here R2/3/4...??
as now i am using this IR pair from:-
Just go over the entire thread once more and make all the measurements again, to find the best value for R2.

Then you calculate the percentile mean between the lowest "high"-value and the highest "low"-value and calculate a voltage divider (R3 and R4) with a total resistance of say 5k to 50k.

Don't forget Google :)
Title: Re: About I.R. sensors.......
Post by: RITESH29 on March 25, 2012, 09:21:06 AM
Hi,

As my sensor is working fine I need to couple sensor with L293 without uC for testing purpose.
So, i have connected the L293 as shown in image. i have changed the pin 8 to 5V then 12V
the output of LM234 is connected to LED with 570ohms. which is working fine. after this the pin 1 of LM324 is given to pin 2 of L293.

I am not understanding the motor with sensor is not working??, the H-BRIDGES are working fine!!
Title: Re: About I.R. sensors.......
Post by: Soeren on March 25, 2012, 02:46:34 PM
Hi,

As my sensor is working fine I need to couple sensor with L293 without uC for testing purpose.
So, i have connected the L293 as shown in image. i have changed the pin 8 to 5V then 12V
the output of LM234 is connected to LED with 570ohms. which is working fine. after this the pin 1 of LM324 is given to pin 2 of L293.

I am not understanding the motor with sensor is not working??, the H-BRIDGES are working fine!!
Are you saying that the L293 drives the motor if you set pin 2 high and low manually, but not when the LM324 drives it?
What's with the LED and resistor (that you claim to be 570 Ohm??)?
Is that still on when you connect it to the L293?
Title: Re: About I.R. sensors.......
Post by: RITESH29 on March 25, 2012, 11:27:31 PM
Quote
Are you saying that the L293 drives the motor if you set pin 2 high and low manually

Yes!!
Quote
but not when the LM324 drives it?
yes!!
Quote
What's with the LED and resistor (that you claim to be 570 Ohm??)?
at the output of LM324 pin 1...
Quote
Is that still on when you connect it to the L293?
yes and the LED then go off.

Note:-i am using 5V from 7805...!!
Title: Re: About I.R. sensors.......
Post by: Soeren on March 26, 2012, 07:20:39 AM
Hi,

Quote
Is that still on when you connect it to the L293?
yes and the LED then go off.

Note:-i am using 5V from 7805...!!
OK.
Your resistor is most definitely not 570 Ohm and why do I care? - Because it troubles me that you may get other things wrong and it's hard to troubleshoot on false assumptions, so please be precise.

Your first step (as always when something don't work) is to measure, to get a view of what's going on, so measure the input of the L293 (with the LM324 connected) - what voltages do you see (dark/light)?
Title: Re: About I.R. sensors.......
Post by: RITESH29 on March 26, 2012, 07:30:51 AM
Hi again,
Quote
Your first step (as always when something don't work) is to measure, to get a view of what's going on, so measure the input of the L293 (with the LM324 connected) - what voltages do you see (dark/light)?

I have used L298 before it input sensitivity is very very cool, even when i use few k resistance to input side it work fine!!
But here in L293 it does not work with single 1K Resistance so, i think that must be the problem.
Anyway the low output of l324 is ~.2v and to 4.5V max.
Title: Re: About I.R. sensors.......
Post by: Soeren on March 26, 2012, 04:37:46 PM
Hi,

But here in L293 it does not work with single 1K Resistance so, i think that must be the problem.
Anyway the low output of l324 is ~.2v and to 4.5V max.
Is the LED plus resistor connected between the output of the LM324 and positive supply?

Anyway, after you measured that, you looked in the datasheet (of course) and read that the input to the L293 must be max. 1.5V to be read as a low and at least 2.3V to e read as high - then you cooked up a get-me-by solution, with a diode between the output of the LM324 (anode) and the input of the L293 (cathode) and added a resistor of 10k..100k from that input to ground, to get your input to be ~1.3V to ~3.8V and thus within specs for the L293. Good job ;D
Title: Re: About I.R. sensors.......
Post by: RITESH29 on March 26, 2012, 07:55:16 PM
Will 5V supply will work fine with both sensors and L293?? from 7805!!
as at 12V the RPM of more increases!
Title: Re: About I.R. sensors.......
Post by: Soeren on March 26, 2012, 09:58:48 PM
Will 5V supply will work fine with both sensors and L293?? from 7805!!
as at 12V the RPM of more increases!
You really dislike experiments, I gather  ::)

If you just read the datasheets, all would be clear!
Use 12V only at the motor voltage pin and only if you want 12V. Since you don't, just hook it up with 5V and test.

Next time you wanna ask something, do take a glance at the datasheet and/or give Google a spin first. I don't mind helping, but I don't even spoon-feed my grandson (as it shows in the attached pic from his 1 year birthday some years ago :)), as that is no way to learn (messy in the beginning perhaps, but it gives faster and better results).
Title: Re: About I.R. sensors.......
Post by: RITESH29 on March 27, 2012, 11:11:58 AM
Hi again,

There is some problem the out put of 7805 fall to ~2.2V while connecting it to L293, some times.
and when it was  ~4.8V the L293 was working fine with sensors.without any diode and pull down Resistance!!
Title: Re: About I.R. sensors.......
Post by: Soeren on March 27, 2012, 08:31:18 PM
Hi,

There is some problem the out put of 7805 fall to ~2.2V while connecting it to L293, some times.
and when it was  ~4.8V the L293 was working fine with sensors.without any diode and pull down Resistance!!
Would that "some times" be when you connect a motor, or is it entirely random?
The motor may be loading either your regulator or your power source too much.
So...
Find when it's happening and if it's (only) when the motor is connected, measure input and output of your regulator when it happens.

What power source do you use in front of the regulator, a mains supply or battery and i the latter, which type, capacity and state of charge.

When something acts up, your best friend is pen, paper and a voltmeter. Making systematic measurements will tell you where the problem is.


If this turns out to be a simple case of a flat battery, one of us should have red ears (and it isn't me :))
Title: Re: About I.R. sensors.......
Post by: RITESH29 on March 28, 2012, 02:39:00 AM
Quote
What power source do you use in front of the regulator, a mains supply or battery and i the latter, which type, capacity and state of charge.

Hi,

I am using 12V 2Amps adapter!!
Title: Re: About I.R. sensors.......
Post by: Soeren on March 28, 2012, 07:01:07 AM
Quote
What power source do you use in front of the regulator, a mains supply or battery and i the latter, which type, capacity and state of charge.

Hi,

I am using 12V 2Amps adapter!!
OK and what do you measure on each side of the regulator?

Please measure the motor draw as well?

Does the motor run for a short time before the problem appear, or is it right from the start?

I wonder if the regulator is entering thermal shut down. With 12V in, you drop 7V over the regulator. If the motor takes eg. 500mA, the regulator has to dissipate 3.5W of heat, which means you need to mount it on a small heat sink.
If it gets too hot internal, it shuts down and with a large current draw and a large voltage drop, this can happen while the outside is only slightly warm.
Measure, measure measure - the only way to find out what's causing the problem.