Wiring Forum
Wiring Hardware >> Tangible computing >> QRB1134 Phototransistor Noise

Message started by Vaccumdiode2 on 07/09/08 at 15:31:14

Title: QRB1134 Phototransistor Noise
Post by Vaccumdiode2 on 07/09/08 at 15:31:14
         I'm Tring to hook up on of these QRB1134 Phototransistor.

Data Sheet

          The problem I am having is that on my analog in I get a lot of nioce and can not seem to get a steady reading.  I'm working a line follower that uses analog info fron two of these sensors and giving proportional info to the drive motors to keep them on the line.  
          I wrote a simple program that would take the analog value and display it on my LCD.  When I run it the value seems to jump al over the place even if I cover the sensor.  I unpluged the sensor and got a value of zero.  I plugged in  a 4"( about 100mm) piece of wire and did not contect the other end.  I think it is interference from my computer.  Does anyone have and input on this or some help how to solve it.

I really would like to get the sensors working.  They are in a nice little package and have the emitter with them.  The best thing of all they cost around $1.44 US from Mouser Electronics and you can find them almost everywhere you look.

Vaccumdiode :-/

Title: Re: QRB1134 Phototransistor Noise
Post by barragan on 07/09/08 at 22:28:04
Could you please post a diagram and code? Thx.

Title: Re: QRB1134 Phototransistor Noise
Post by Vaccumdiode2 on 07/10/08 at 03:42:06
Here is the code.  I'll E-mail the schematic.

LiquidCrystal myDisplay = LiquidCrystal(24,25,26,2);

void setup()
 // nothing for setup

int inpin = 0;
float val= .001;  
int rval = 10;
int a = 1;

void loop()
 myDisplay.print("Sensor value: ");
 myDisplay.setCursor(12, 0);
 myDisplay.setCursor(0, 1);
 myDisplay.print("Count up: ");
 myDisplay.setCursor(11, 1);
 myDisplay.setCursor(1, 2);
 myDisplay.print("Frankie Tank");
 float val = analogRead(2);  // read the value of analog pin 2
 rval = val;
 a = a + 1;  // increase the value of a by 1 per loop

Title: Re: QRB1134 Phototransistor Noise
Post by Vaccumdiode2 on 07/14/08 at 15:05:40
          I tried a larger capacitor, 10uf.  It got rid of the niose.  But, there was such a short range of between black and white.  It was 1006 to 1011.  Not Much Range.  I read an article in Servo Magizine.   It was about this sensor and they used a 470 ohm resistor for the LED and a 47K ohm resistor for the pull up on the signal wire.  I will try that and see if it opens up the range a bit or so.  The articles said that I should get a range of .25 volts to 4.8 volts.  that would work out great.  In the article they were setting it up to be read as a digital sigmal so they need the range to meet the requirements of the voltages need to work as a digital signal.  I will post my findings.


Title: Re: QRB1134 Phototransistor Noise
Post by barragan on 07/14/08 at 20:34:45
Ok I got the shcematics, I will check it later today. I have so many tasks in queue :)

Title: Re: QRB1134 Phototransistor Noise
Post by Vaccumdiode2 on 07/21/08 at 02:29:26
           I tried out the the other resistors.  It gave me great contrast, but the transition is very abrupt.  It goes from 20-50 on a white area to 700-900 on a black area.  If you put it in on place it does stablize and may bounce 1 or 2 point otherwise it is pretty constant.  I believe the larger cap(10uf) I used works pretty good.  If anyone else has any info please post it.  I wiill keep trying different values of resistors and I will post my findings.


Wiring Forum » Powered by YaBB 2.5 AE!
YaBB Forum Software © 2000-2010. All Rights Reserved.