Home \ Help \ Search \ Login RSS

Welcome, Guest. Please Login

This forum is now READ-ONLY! Please visit http://forum.wiring.co/ for the new forum.

Wiring ForumWiring HardwareTangible computing › QRB1134 Phototransistor Noise

Page Index Toggle Pages: 1
QRB1134 Phototransistor Noise (Read 13528 times)
07/09/08 at 15:31:14

Vaccumdiode2   Offline
Full Member
chicago, IL USA

Posts: 120
***
 
Hello,
         I'm Tring to hook up on of these QRB1134 Phototransistor.

Data Sheet
http://www.fairchildsemi.com/ds/QR/QRB1134.pdf

          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 Undecided
 
IP Logged
 
Reply #1 - 07/09/08 at 22:28:04

barragan   Offline
YaBB Administrator

Posts: 939
*****
 
Could you please post a diagram and code? Thx.
 
IP Logged
 
Reply #2 - 07/10/08 at 03:42:06

Vaccumdiode2   Offline
Full Member
chicago, IL USA

Posts: 120
***
 
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.clear();
  myDisplay.home();
  myDisplay.print("Sensor value: ");
  myDisplay.setCursor(12, 0);
  myDisplay.print(rval);
  myDisplay.setCursor(0, 1);
  myDisplay.print("Count up: ");
  myDisplay.setCursor(11, 1);
  myDisplay.print(a);
  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
  delay(250);
 
}
 
IP Logged
 
Reply #3 - 07/14/08 at 15:05:40

Vaccumdiode2   Offline
Full Member
chicago, IL USA

Posts: 120
***
 
Hello,
          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.

Rich
 
IP Logged
 
Reply #4 - 07/14/08 at 20:34:45

barragan   Offline
YaBB Administrator

Posts: 939
*****
 
Ok I got the shcematics, I will check it later today. I have so many tasks in queue Smiley
 
IP Logged
 
Reply #5 - 07/21/08 at 02:29:26

Vaccumdiode2   Offline
Full Member
chicago, IL USA

Posts: 120
***
 
Hello,
           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.

Vaccumdiode
 
IP Logged
 
Page Index Toggle Pages: 1