Author Topic: Finding the right resistor  (Read 3113 times)

0 Members and 1 Guest are viewing this topic.

Offline MadMaxTopic starter

  • Full Member
  • ***
  • Posts: 58
  • Helpful? 0
Finding the right resistor
« on: November 20, 2008, 10:05:25 AM »
To begin: Yes, I've read the photoresistor tutorial, this is a bit more complicated.

I have a tube, a IR LED on one end, a phototransistor one the other end (sensitive to the IR wavelength, offcourse).
When the signal arrives at my PIC chip, it reads the voltage before the 10k resistor, I do not know how high the resistor marked with the '?' should be, and can't figure it out. Is somebody able to help me?


Offline Trumpkin

  • Supreme Robot
  • *****
  • Posts: 1,176
  • Helpful? 5
Re: Finding the right resistor
« Reply #1 on: November 20, 2008, 02:38:03 PM »
Robots are awesome!

Offline MadMaxTopic starter

  • Full Member
  • ***
  • Posts: 58
  • Helpful? 0
Re: Finding the right resistor
« Reply #2 on: November 20, 2008, 03:07:08 PM »
No, the problem I have is that I need a value between (optimal) 0-255 when a voltage reaches my A/D converter in my microchip. So I need a voltage between (optimal) 0V - 5V. I'm not talking about the LED, it is getting 0.02A at the correct voltage, I'm talking about the voltage divider.

Offline Gertlex

  • Supreme Robot
  • *****
  • Posts: 763
  • Helpful? 24
  • Nuclear Engineer ยท Roboticist
    • Index of Oddities
Re: Finding the right resistor
« Reply #3 on: November 20, 2008, 04:56:17 PM »
I'll take a stab.

If the unknown and the 10kohm resistor are truly both connected to the same ground, then the voltage is the same through them and they're in parallel.

I'll call the unknown A, the 10k B, and the phototran (looks more like a photodiode or high resistance photoresistor) P

Thus the voltage out (i.e. what's measured across either resistor) is

Vin * (A||B)/(A||B+P)

It depends largely on what your input voltage Vin is.  It's probably 5V.

Playing a bit with numbers on paper, A||B = 300kOhm seems a nice number.  That gives you 3/4 Vin in dark, and 1/6 Vin in light.

At the same time, theoretically you don't need that 10kOhm resistor, but I don't know what constraints there may be on the actual physical circuit.
I

Offline mbateman

  • Full Member
  • ***
  • Posts: 82
  • Helpful? 0
    • Robotics 4 Fun
Re: Finding the right resistor
« Reply #4 on: November 20, 2008, 05:16:28 PM »
@Gertlex, you just beat me to it. I came to the same conclusion. 300K maximizes your spread between high and low readings.

Offline ArcMan

  • Supreme Robot
  • *****
  • Posts: 519
  • Helpful? 4
  • Mmmm... Plasma
Re: Finding the right resistor
« Reply #5 on: November 20, 2008, 10:02:42 PM »
Actually, I think you have a problem there.  The impedance you're showing for your phototransistor is way too high when it's on.  It should be much lower.  The impedance of your analog input should not exceed about 10 Kohm, or the analog reading will be wonky.  Normally you would put your NPN phototransistor between gnd and analog in.  Then a resistor (try something like 4.7 Kohm) between analog in and Vcc.  That should give you a nice sweep between gnd and Vcc.

Offline MadMaxTopic starter

  • Full Member
  • ***
  • Posts: 58
  • Helpful? 0
Re: Finding the right resistor
« Reply #6 on: November 21, 2008, 12:26:41 PM »
hmm, yes, I've done some calculations in the meantime... And (Vcc * 1 * 10 ^ 3) / (1 * 10 ^ 6 + 1 * 10 ^ 3) = (Vcc * 1000) / (1.001 * 10 ^ 6)... That is a pretty useless voltage devider  ::)... gotta do new calculations, thank you Arcman

 

SMF spam blocked by CleanTalk