go away spammer

Author Topic: IR Detector resistance/Multimeter readings  (Read 6919 times)

0 Members and 1 Guest are viewing this topic.

Offline newInRoboticsTopic starter

  • Supreme Robot
  • *****
  • Posts: 1,015
  • Helpful? 48
  • N.I.R.
IR Detector resistance/Multimeter readings
« on: March 30, 2011, 07:37:48 PM »
I am currently working on IR shaft encoder by following SCHEMATICS - INFRARED EMITTER DETECTOR tutorial.
The problem is I don't quite understand readings from my multimeter when measuring resistance of the detector: when multimeter is set to 200k it shows 44.3, when it's set to 20k it shows 10.17;
(Everything is fine when I measure a resistor)
"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

Offline waltr

  • Supreme Robot
  • *****
  • Posts: 1,944
  • Helpful? 99
Re: IR Detector resistance/Multimeter readings
« Reply #1 on: March 30, 2011, 08:04:35 PM »
What exactly are you measuring?
Is it the 'out' to 'gnd' in the first diagram in the link?

Offline newInRoboticsTopic starter

  • Supreme Robot
  • *****
  • Posts: 1,015
  • Helpful? 48
  • N.I.R.
Re: IR Detector resistance/Multimeter readings
« Reply #2 on: March 30, 2011, 08:13:34 PM »
What exactly are you measuring?
Is it the 'out' to 'gnd' in the first diagram in the link?
No, I measure resistance between pins 1 and 2 of IR Detector (T1 in the diagram).
« Last Edit: March 30, 2011, 08:14:58 PM by newInRobotics »
"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

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: IR Detector resistance/Multimeter readings
« Reply #3 on: March 30, 2011, 08:53:44 PM »
Hi,

The problem is I don't quite understand readings from my multimeter when measuring resistance of the detector: when multimeter is set to 200k it shows 44.3, when it's set to 20k it shows 10.17;
(Everything is fine when I measure a resistor)
Everything is still fine, the different readings is due to different magnitudes of bias current on the different ranges. If you try with the meter on the 2M range, it will probably shoot up to some 100..200k or more.
The most precise result, you'll get from building the circuit as shown and then measure voltages, as it is then loaded and biased as it will be in its application (since it is).

You can get a similar "misreading" when testing a transistor, as the hFE is only valid at the c-e current the meter use and it is usually not the magnitude you need  :-\  Especially if you test power transistors, you'll get very optimistic gain figures compared to a real application.
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

Offline Fr0stAngel

  • Full Member
  • ***
  • Posts: 96
  • Helpful? 3
  • [O_O] what??
Re: IR Detector resistance/Multimeter readings
« Reply #4 on: March 31, 2011, 01:51:54 AM »
Ohmmeters work by passing a small current through the component and measuring the voltage produced.
it does not function with a circuit connected to a power supply. If you want to measure the resistance of a particular component, you must take it out of the circuit altogether and test it separately

so measure the resistance before soldering it. that way it'll give correct readings,  :)
« Last Edit: March 31, 2011, 01:57:48 AM by Fr0stAngel »
'crazy' is the new hype! =)

Offline newInRoboticsTopic starter

  • Supreme Robot
  • *****
  • Posts: 1,015
  • Helpful? 48
  • N.I.R.
Re: IR Detector resistance/Multimeter readings
« Reply #5 on: March 31, 2011, 08:31:25 AM »
so measure the resistance before soldering it. that way it'll give correct readings,  :)
Hence I measure it while it is not plugged into the board :)

The most precise result, you'll get from building the circuit as shown and then measure voltages, as it is then loaded and biased as it will be in its application (since it is).
I have my circuit already built on the breadboard to test it out, and still readings do not match:
  • 2M   --> 0.357
  • 200k --> 46.5
  • 20k  --> 10.37
  • 2k    --> 0.637
As they don't match, how can I decide upon which size resistor to use in order to read voltage?

Edited: On 2M setting of multimeter, with IR Emitter ON - resistance of detector changes from 680kohm (reflection from white surface) to 520kohm (reflection from black surface)

Edited 2nd time: When I connect IR Detector to the circuit, Collector pin goes to V+ and Emitter pin to GND? ...this way I get better voltage readings... I've always thought that longer pin (Emitter) is always positive...
« Last Edit: March 31, 2011, 09:56:48 AM by newInRobotics »
"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

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: IR Detector resistance/Multimeter readings
« Reply #6 on: March 31, 2011, 10:59:50 AM »
Hi,

I have my circuit already built on the breadboard to test it out, and still readings do not match:
  • 2M   --> 0.357
  • 200k --> 46.5
  • 20k  --> 10.37
  • 2k    --> 0.637
As they don't match, how can I decide upon which size resistor to use in order to read voltage?
Empirically (a posh word for trying stuff more or less at random  ;D).

Start with eg. 100k to 470k for R2.
Measure the output voltage (between R2 and the photo transistor) with the average dark and light conditions that you expect to see.

While output is too far from what you want it
   If the output is low, decrease R2 to say 70% of what it is and test again.
   If the output is high, increase R2 by some 30% and test.
EndWhile

If the dark reading is very low, or the light reading is very high, change R2 by a larger percentage.


Edited 2nd time: When I connect IR Detector to the circuit, Collector pin goes to V+ and Emitter pin to GND? ...this way I get better voltage readings... I've always thought that longer pin (Emitter) is always positive...
Not exactly sure what you mean here?
You shouldn't short your supply through the a phototransistor, it will die when enough light shines on it.
Are you talking about a two pin photo transistor (in an "LED house")?
Have you got the exact type number or a link to a datasheet?
IF it's an NPN photo transistor, the emitter (where the arrow is) should go to ground.
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

Offline newInRoboticsTopic starter

  • Supreme Robot
  • *****
  • Posts: 1,015
  • Helpful? 48
  • N.I.R.
Re: IR Detector resistance/Multimeter readings
« Reply #7 on: March 31, 2011, 12:39:18 PM »
OK, I've got it working ;D diagram is below.

When IR is reflected from black surface it gives ~0.8V, when IR is reflected from white surface it gives ~1.8V.

Are you talking about a two pin photo transistor (in an "LED house")?
Yes.

IF it's an NPN photo transistor, the emitter (where the arrow is) should go to ground.
It is NPN type.
That probably was the problem, because I was plugging it in the wrong way around, hence I was getting wrong voltage readings. I had wrong impression that longer pin (Emitter) had to be on a V+ side and shorter pin (Collector) on the GND side.
"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

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: IR Detector resistance/Multimeter readings
« Reply #8 on: March 31, 2011, 02:32:49 PM »
Hi,

OK, I've got it working ;D diagram is below.
Great!
I thought it was the one on top of the page, so my explanations might have sounded odd  :P


When IR is reflected from black surface it gives ~0.8V, when IR is reflected from white surface it gives ~1.8V.
Sounds fine for a 3.3V app. There is, however, a few things that could be improved, so here's a schematic if you're interested

Using it like a comparator (with max. gain) and adding a bit of positive feedback (R5) will lead to a well defined shift, which a reduced gain (negative feedback) cannot handle as well, and when the lightning is just at the shifting point, the output will easily go into oscillations
.
A trimmer potentiometer could be inserted between R3 and R4, so it can be trimmed for different amount of ambient lightning.
R5 should be very large, at least 50 times R3//R4 (the parallel value of R3 and R4).
IC1B is just shown with its inputs tied to keep it in check.

The 464 Ohm resistors could be upsized to reduce current drain.
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

Offline newInRoboticsTopic starter

  • Supreme Robot
  • *****
  • Posts: 1,015
  • Helpful? 48
  • N.I.R.
Re: IR Detector resistance/Multimeter readings
« Reply #9 on: April 01, 2011, 07:46:31 AM »
There is, however, a few things that could be improved [...]
Good idea for improvement, however wouldn't it be easier to set threshold voltage using software in uC rather than using resistors?
"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

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: IR Detector resistance/Multimeter readings
« Reply #10 on: April 01, 2011, 10:29:02 AM »
Hi,

[...] wouldn't it be easier to set threshold voltage using software in uC rather than using resistors?
Easier? Put a quarter in the swear jar immediately  :P

Then you would need to use A/D-C for the input (slower) and if you did that, there's no reason to use an op-amp in the first place, since a carefully selected resistor will do.

Yes, you can compensate for a lot of hardware flaws and design errors in software (and it happens way too often in commercial stuff).
But... Imagine a circuit designed and built optimally well. The software, starting from a stable base, can then almost make the circuit reach the stars ;D
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

Offline newInRoboticsTopic starter

  • Supreme Robot
  • *****
  • Posts: 1,015
  • Helpful? 48
  • N.I.R.
Re: IR Detector resistance/Multimeter readings
« Reply #11 on: April 01, 2011, 01:13:11 PM »
The software, starting from a stable base, can then almost make the circuit reach the stars ;D
Ha ha  ;D Roboticist with a touch of a poet...

Then you would need to use A/D-C for the input (slower) [...]
I thought that I need to use ADC in order to get readings from analog sensor, hence count clicks when motor shaft is spinning. However, I suspect now that it's better to have 2 state sensor giving on/off only and attach it to a pin of uC without using ADC.

[...] there's no reason to use an op-amp in the first place, since a carefully selected resistor will do.
That's the problem, as I do not yet have many different components I try to build stuff using things that I have at hand.  ;D
"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

Offline newInRoboticsTopic starter

  • Supreme Robot
  • *****
  • Posts: 1,015
  • Helpful? 48
  • N.I.R.
Re: IR Detector resistance/Multimeter readings
« Reply #12 on: April 01, 2011, 02:32:01 PM »
Aha, remade my circuit the way Soeren has offered (apart from feedback resistor, because I don't have any resistors of that size  ;D). What does feedback resistor do?

Anyway, now circuit works giving ~2V while IR is reflected from black and giving 0V when IR is reflected from white.

Edited: Is 2V enough for uC to understand that its input pin is HIGH? (uC uses 3.3V as operation voltage)
« Last Edit: April 01, 2011, 04:28:17 PM by newInRobotics »
"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

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: IR Detector resistance/Multimeter readings
« Reply #13 on: April 01, 2011, 05:18:41 PM »
Hi,

I thought that I need to use ADC in order to get readings from analog sensor, hence count clicks when motor shaft is spinning. However, I suspect now that it's better to have 2 state sensor giving on/off only and attach it to a pin of uC without using ADC.
Ah, it's for measuring rotation - I had an idea that you wanted to make a line detector - don't know why that got into my head.
In that case yes, you absolutely should use it with a digital input. This will be the most precise and if you use inputs that can give off interrupts, you can have it all running in the background. You could even make rotational speed measurements on each transition, if the encoder disk is made with care (i.e each black and white section is identical in physical size (or, more accurate, the degrees covered).

The other op-amp in the LM358 can be used for the other detector of course and it's possible that you can get away with just one IR-LED for both.

That's the problem, as I do not yet have many different components I try to build stuff using things that I have at hand.  ;D
We all do and just you wait, at some point in the future you'll be drowning in excess electronics  :o


Aha, remade my circuit the way Soeren has offered (apart from feedback resistor, because I don't have any resistors of that size  ;D). What does feedback resistor do?
If you imagine the output being low, it pulls the non-inverting input (pin 3) slightly lower than what R3 and R4 sets it to. this means that the inverting input (pin 2) must go lower than that, for the output to go high. When it does, the small amount of feedback (from the now high output) will make pin 3 a little higher and thus reinforcing the difference and make it switch a little faster, but most important, pin 2 will now have to go a little higher than before to switch back.
This happens on both transitions (low and high) and removes the situation where a certain light level would otherwise make it toggle back and forth at high speed, since it now has to move a little further to get the action.
Another name for it is hysteresis or "Schmitt trigger action".

A very similar phenomenon is found naturally in magnets by the way.


Anyway, now circuit works giving ~2V while IR is reflected from black and giving 0V when IR is reflected from white.
Yes, as the LM358 is not a rail-rail op-amp, it cannot saturate to the positive rail (supply).
If you want to use it with a microcontroller running 5V, then just feed it 5V.
A transistor and two resistors could be used to get it closer to the positive rail if needed.
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

 


Get Your Ad Here

data_list