Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Design of Amplifier stage in between a photodiode out and PIC uc

Status
Not open for further replies.

Akhil Mohan

Member level 2
Joined
May 13, 2011
Messages
53
Helped
2
Reputation
4
Reaction score
2
Trophy points
1,288
Activity points
1,731
Design of Amplifier stage in between a phototransistor out and PIC uc

Hello,

Please help me to design an an inverting amplifier that is attached. The output from a photo transistor(not photo diode as given in figure) is to be amplified and I have drawn the schematic. The output of the amplifier is connected to the PIC to detect a high on a particular pin.

R3 and R4 are used to minimize output offset voltage.

At what cases coupling capacitors are needed and in the above circuit is it necessary and if so where to connect and how to design the capacitor values.

output impedance of photo diode stage is 3.3K

Thanks in advance
 

Attachments

  • Amp.bmp
    487.8 KB · Views: 77
Last edited:

Re: Design of Amplifier stage in between a phototransistor out and PIC uc

But it is 10mV amplitude... right?
Do you know the period? I mean is it too short?
 

Re: Design of Amplifier stage in between a phototransistor out and PIC uc

yes it is 10mV and frequency can be in the range 1-10kHz (Say 5kHZ)
 

Let us assume it is 10mV and we like it to be... say about 5V. If it is my project I would prefer a simple comparator instead as 1 of 4 of LM339 (very popular). What do you think?

Edited:
But if you have only LM358 ... I think we can do it too

---------- Post added at 21:01 ---------- Previous post was at 20:49 ----------

I think you got the idea I tried to tell you... good luck.
 

I will check the availability of LM339 in the electronic shops.
Anyway please explain in both ways. If it is not there I have to proceed with the LM358. :)
 

A phototransistor operates by reducing its internal resistance in response to light.

It may put out a miniscule voltage, but that's not its most sensitive performance.

With a phototransistor it's necessary to connect it in series with a resistor which in turn is connected to supply + or supply -.

You have a choice how to orient the phototransistor (as to emitter and collector), that is, which terminal should be connected to the supply rail and which terminal goes to the resistor.

Your output will be tapped between the phototransistor and resistor.

You're bound to get a much wider voltage swing this way. This configuration is typical of transistor amplifiers.

To find greatest sensitivity you must test all 8 ways you can hook up the phototransistor and resistor, and how to connect them to the supply rails. And to achieve the operation you want.
 

I will check the availability of LM339 in the electronic shops.
Anyway please explain in both ways. If it is not there I have to proceed with the LM358. :)

Ok... We will use one opamp of LM358 as if it is a comparator. In this case there will be no need for a negative feedback (like RF1).
Since we don't like to invert the signal, it will be connected to the IN+.
I am not sure if 3K3 is the output resistance in both high and low state or just when high (as in case of an open collector output).
Let us assume it is so in both states. In this case we connect a 3K3 resistor between IN- and ground (as close as possible to the signal ground).
Due to the high open loop gain of the opamp, the output will be as high as possible during the pulse. If the IC is supplied by 5V it may reach about 3.6V. If a higher voltage is needed a pullup resistor at the opamp output could be added (value about 1K to 4K7).
The difference between a real comparator and using an opamp as a comparator is the fast response (the comparator is relatively faster). Therefore, the lower the frequency is, the closer their responses are.

May I ask how you can test your circuit.

Kerim

Edited:
Please note that what 'BradtheRad' replied you earlier is important which is indeed the key to make a good interface.
In my answers, I just took your words as grant like 10mV and 3K3. So if they are just assumed values and not real, please forget what I wrote you.
 
Last edited:

@ BradtheRad I have attached my Transmitter and Receiver circuit and please go through it and can you explain little bit more.I didn't understand the thing you mentioned.

output across the resistor is what i mentioned 10mV
 

Attachments

  • Tx and Rx New.bmp
    360.2 KB · Views: 86
Last edited:

@Kerim the baseline is not always a constant (Due to noise),it can clamp to a second level, so how does the comparator works in this case.
3K3 is when it is ON
 
Last edited:

@Kerim the baseline is not always a constant (Due to noise),it can clamp to a second level, so how does the comparator works in this case.
3K3 i9s when it is ON

I think your main problem is the way you try to send your data (or pulses).
The phototransistor is ready to receive any light belonging to its spectrum and not only what you try to send to it.
Usually in this case, we send the data on a carrier. A standard frequency for most remotes is 38KHz. So to send a pulse, we send instead a few pulses of 38KHz (the more the better). By this way, the receiver can easily filter all undesired lights and keep the amplitude of the carrier (like in AM detection)... Got it so far?

Edited:
I am not sure if your phototransitor is fast enough to deal properly with 38KHz. Uusally a photodiode is better for relatively high frequency pulses.
 
Last edited:

k Is it a good way to design a Low pass filter and a subtraction circuit so that the noise effect can be avoided, is works or any other suggestions
After this stage the output can be amplified by the comparator circuit. Am I right ?
 

k Is it a good way to design a Low pass filter and a subtraction circuit so that the noise effect can be avoided, is works or any other suggestions
After this stage the output can be amplified by the comparator circuit. Am I right ?

Sorry, the word 'noise' is too broad, to me in the least, without further clarification (based on tests). In other words I can't give any sure solution just by guessing the characteristics of your noise in term of amplitude, frequency... etc...

Edited:
Please note that your interface is more digital than analogue which means we need to know if the received signal is 1 or 0 only. To detect a binary signal, a comparator with hysteresis is usually used as long the noise is not relatively too strong. For instance using a low pass filter will affect your pulse as well if sent without a carrier... unless you meant high pass filter.

Edited:
Now I got your idea... substracting the noise we get at the low pass filter output from the received signal... good idea but you have to work on it... I usually design something and make tests... from the results I repeat the loop... redesign... retest ... till I get what I am looking for ... like charging a capacitor... it takes time.

Added:
You may like to know, when I have needed to send and receive data by light (about 15 years ago) I spent a long time in designing the TX and RX. But all my designs were based on sending just pulses, the way we do with cables (low frequency). I tried all sort of filters in the receiver side and I bought many matched pairs (working on the same wavelength, IR or normal light). The detection distance was always too short than what I expect. So I was always wondering how the remote units of many sets (like the sat receivers) can be received even at 10 to 15 meters (if not more)! So I had the courage to examine how this could be achieved... As I told you by turning on and off a stream of pulses at 38KHz. Fortunately complete IR receivers (most look as a BD transistor with an eye and 3 pins) are easily available in the market. The small device includes the photodiode, bandpass filter, amplitude detector and the output comparator (its ouput is an open collector that needs a pullup resisistor). Since then I just buy an IR receiver and add a resistor (pullup) and connect the output to the MCU pin. (Actually I sypply it from Vcc through 220R and 220uF to better filter its V+ but this may not be necessary in most situations). At the output we get the raw data (pulses) only... no 38KHz.

Added_2:
At the transmitter side, the MCU could be programmed to send pulses of 38KHz, say for 500us then stay off for another 500us (let us assume this means 0) then another 500us of pulses followed by 1000us (or 1500us) off state (this would be as 1). At the end of a predetermined number of bits (usually 8, 16, 24 etc) the last 500us of pulses is sent. Usually a special long bit is sent at the start like 8500us on followed by 1500us off (the exact periods are not critical, you can make your own protocol if you like). Of course one may use 555 IC for the 38KHz and as a driver for the IR LED then let the MCU turn off and on the oscillation of the 555 IC.
 
Last edited:

@ BradtheRad I have attached my Transmitter and Receiver circuit and please go through it and can you explain little bit more.

Your method is almost correct. Try switching positions of the phototransistor and the 3.3K resistor.

That way you will achieve maximum sensitivity. The emitter must have a clear path to ground.

In the schematic you posted, base current (photons striking the base) goes down the emitter of the phototransistor, and then must go through a resistor to ground. This reduces sensitivity.

Although a 3.3K resistor is a reasonable value to use, you should try different values to see which gives you maximum voltage swing in your light/dark conditions.

Did you test both orientations of the transistor? Only one way will give you maximum sensitivity.
 

The amplifier circuit in post #1 doesn't work as shown. The +ve input is biased to GND (that's in fact possible with LM358) and a positive voltage of 10 mV is given to the -ve input. To amplify this voltage, the output would need to take on a voltage of -100 mV wich is impossible in single supply operation. The comparator idea would work (with a suitable threshold). LM358 would be most likely too slow as a comparator. If designing a multistage amplifier, calculate the bias voltages and in- and output voltages of each stage correctly.

In the schematic you posted, base current (photons striking the base) goes down the emitter of the phototransistor, and then must go through a resistor to ground. This reduces sensitivity.
Do you want to suggest, that a phototransistor with ground referred emitter and a 3.3K collector resistor will be more sensitive? Please think about the nature of a two-terminal device and reconsider.

P.S.: I didn't yet pay attention to purpose of the circuit, which is obviously detection of a distant modulated light source. The basic principle of modulated light is sense the difference rather than absolute intensity, which can be e.g. affected by ambient light. The appropriate signal processing for modulated light is however an AC amplifier and possibly a band filter, which is only sensitive to a particular modulation frequency. Both principles are implemented in the 38 kHz RC receivers mentioned by KerimF.
 
Last edited:

I used the Rx side in the CE configuration, so that a HIGH indicates the beam is blocked. I will also consider the CC config where a LOW means the beam is blocked. This is the only way that I know for the Rx side. If any improved design is there, please specify.
@FvM why did you say that the amplifier doesn't work, it is a basic inverting amplifier design that I have seen in text books. The comparator seems to be a good solution, and I will check what can be a good threshold value for that. What is the importance of thee value 38kHz. Normally it should work in the region of 1-40KHz.
@ Karim and BradtheRad, Thanks for your suggestions and after my testing I will tell which is best!!!
 

it is a basic inverting amplifier design that I have seen in text books
Look sharp for the power supply configuration in the respective text book examples. I clearly stated, it doesn't work for single supply, which is your configuration, unfortunately.

Try your circuit in a simulation or a real setup. And try to understand the explantion about negative output voltage by calculating the expectable voltage levels.
What is the importance of thee value 38 kHz.
I didn't suggest 38 kHz, it has been introduced up by KerimF, because it's a standard in IR remote control. I think however, that a few kHz will be more easy to process.

The most important point in my post has been the AC amplification and filtering aspect, I think. It's possibly beyond your scope at present.
 

What is the importance of thee value 38kHz. Normally it should work in the region of 1-40KHz.

I forgot to clarify in depth that the rate of the modulating signal should be much less than of the carrier (like 38 KHz). That is why I said 500us/500us as on/off of the 38KHz pulses. In this case it is 1 KHz (actually this could be increased to 2 KHz as the fastest bit, but one can always experiment other possibilities). In my designs, I used to prefer less speed than less reliability :wink:
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top