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

Logged

Regards,Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?Please remember...Engineering is based on numbers - not adjectives

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

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!

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.

Logged

Regards,Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?Please remember...Engineering is based on numbers - not adjectives

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

Logged

Regards,Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?Please remember...Engineering is based on numbers - not adjectives

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

Logged

Regards,Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?Please remember...Engineering is based on numbers - not adjectives

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?

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"

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.

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.

Logged

Regards,Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?Please remember...Engineering is based on numbers - not adjectives

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.

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.

Logged

"Computer games don't affect kids; I mean if Pac-Man affected us as kids, we'd all be running around in darkened rooms, munching magic pills and listening to repetitive electronic music." - Kristian W

Here's a larger schematic:(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).

Logged

Regards,Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?Please remember...Engineering is based on numbers - not adjectives

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

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.

Logged

Regards,Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?Please remember...Engineering is based on numbers - not adjectives

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.

Logged

Regards,Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?Please remember...Engineering is based on numbers - not adjectives

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?

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

Logged

Regards,Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?Please remember...Engineering is based on numbers - not adjectives