Go Down

Topic: Choosing an appropriate operational amplifier or transistor (Read 8232 times) previous topic - next topic

Candice

Hi all,

I have a Vishay Reflective Optical Sensor (TCRT5000L) which I would like to use to measure the RPM of a rotating shaft.  The Datasheet for the TCRT5000(L) is here, and an "application" document is here.  In the application document, there is a simple circuit diagram on page 11 that looks like it'll suit my purposes, but it uses an "operational amplifier".  It doesn't really specify the exact component, and I'm not clever enough to work which op amp it is from the description, which says:
"Special attention must also be made to the downstream logic gate. Only components with a low input offset current may be used. In the case of the TTL gate and the LS-TTL gate, the I LH current can be applied to the sensor output in the low condition. At -1.6 mA or -400 ?A, this is above the signal current of the sensor. A transistor or an operational amplifier should be connected at the output of the sensor when TTL or LS-TTL components are used. A gate from the 74HCTxx family is used."  So after my initial excitement of finding a circuit diagram to follow, I am now stuck.

Would anybody be able to point me in the direction of what kind of transistors or op amps would be suitable for this circuit?

Also, in case it helps in some small way, on page 14 of the application document there are more circuit diagrams but these are for 10V circuits using op amps or transistors.

Many thanks in advance for any advice you can offer this newbie.
Candice

Magician

Are you going to connect your sensor to arduino? If so, than don't worry, use basic scenario from page 11, arduino is CMOS - not TTL

Candice

Hi Magician,

Thanks for your response.  Just so I get it through my thick head, I would just have my interrupt input going straight to arduino pin 2 (or 3) without an op amp or a (pnp?) transister inbetween?

Thanks again,
Candice

Chagrin

What I'd suggest doing is rigging up your reflective disc and sensor to see what kind of readings you can get from your sensor. Set it up so you can adjust both the current through the IR emitter (~200R) and the pull down through the receiver (~5K) and mess with it a bit. You will find it difficult to get things tweaked well when you're doing reflectance because of ambient light -- always easier to use a photointerrupter where the IR light passes through holes in a disc.

If you can't get could reflectivity difference then the next step would be a op amp "difference amplifier" circuit. There's no need for any exotic parts here; you're only going to need about a 10x gain so any cheap op amp (LM358) is fine. This is what they're showing in Fig 18. of your application note sheet; I'm not that well versed in op amps and don't quite understand the advantage of the TLC271.

Magician

Quote
Just so I get it through my thick head, I would just have my interrupt input going straight to arduino pin 2 (or 3) without an op amp or a (pnp?) transister inbetween?

Yes, that's true. See resistor RE = 15 k? Value 'd define sensitivity, you may changed it up or down depends on ambient lighting conditions, you may need to switch off internal arduino pull-up resistor (read http://arduino.cc/en/Tutorial/DigitalPins) for RE >= 15 k.

Candice

#5
May 06, 2013, 06:27 pm Last Edit: May 07, 2013, 05:47 pm by Candice Reason: 1
Thanks Magician and Chagrin for your very helpful replies.

This is what I have as my circuit now:



And here is some simple code that I used to test the sensor by passing some striped black and white paper over it:

Code: [Select]

/*
Purpose: A simple test of the TCRT5000(L) circuit
*/

int ledPin = 13;      // Just use the inbuilt LED on arduino pin 13
int collectorPin = 2; // The sensor's emitter connects to pin 2
int pinState = 0;     // variable to store the state of pin 2

void setup()
{
 pinMode (ledPin, OUTPUT); // set pin 13 as output
 pinMode (collectorPin, INPUT);   // set pin 2 as input
}

void loop()
{
 pinState = digitalRead(collectorPin); // read state of pin 2
 
 if (pinState == LOW)
   digitalWrite (ledPin, LOW); // Turns off LED    
 
 else
   digitalWrite(ledPin, HIGH); // Turn on LED  
}


The paper is being sensed at about 3cm, which is so much better than I expected! Maybe it will have to be closer during measuring though.

Thanks again guys for your help!

Candice

MarkT

If you do use an external logic gate then a schmitt-trigger (such as 74HC14 inverter) will increase the amount of
hysteresis over that provided by an Arduino input.

Note that 74HC series logic have very approximately mid-rail input switching point, whereas the 74HCT series, being
TTL-compatible have a switching point between 0.8V and 2.4V.  The Arduino inputs are roughly mid-rail IIRC.

Another interface method is to use a comparator - you can adjust the switching point with a pot and also select
how much hysteresis via a feedback resistor.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

Candice

Quote
If you do use an external logic gate then a schmitt-trigger (such as 74HC14 inverter) will increase the amount of
hysteresis over that provided by an Arduino input.

Note that 74HC series logic have very approximately mid-rail input switching point, whereas the 74HCT series, being
TTL-compatible have a switching point between 0.8V and 2.4V.  The Arduino inputs are roughly mid-rail IIRC.


Thanks so much for your suggestion of the 74HC14 inverter MarkT!  Does this mean that there is (or can be) a lot of noise in the input from the sensor?   I'd really like to get nice clear HIGHs and LOWs for the pulse counts in my interrupts, so I'm very interested in what you have said.  Also, would I then need a capacitor before the Schmitt trigger? (Apologies if these are a dumb questions!)

Candice

MarkT

No, a perceptive question.... Yes you can add capacitance (filter out noise spikes), since a schmitt-trigger input gate is
happy with slowly varying input voltages (ordinary gates are not).

The downside to the 74HC14 is that it has a fixed amount of hysteresis so you can't change it, hence the suggestion of
the comparator.  If your optical signal is low-contrast you might not have enough voltage range to encompass the
hysteresis region of the 74HC14, but if you have it will definitely clean it up.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

Go Up