0
\$\begingroup\$

My circuit roughly looks like this: schematic

I want to send a signal to uC and turn on a LED when there is light shining on phototransistor Q3. Currently I'm using stm32f4 (discovery board) as a signal receiver, but I would like to be able to replace it with an atmega at any time.

My problem is that base of Q1 is taking almost all of the current coming from Q3 and emitter-ground voltage after Q2 is too low for a uC to recognize it as a logical high.

I know I can add a resistor just before the base of Q1, but I don't know what is a resistance of the input of the uC (because it may be replaced with a different one)

How can I make sure that both the LED and the signal to uC have enough voltage to work properly?

\$\endgroup\$
  • \$\begingroup\$ Please arrange your schematic that all 3V3 are at the top and GND at the bottom. \$\endgroup\$ – Oldfart Aug 10 '18 at 22:22
  • \$\begingroup\$ It is also customary to arrange schematics so that signals flow from left to right - Q3 should be at the left to follow that custom. \$\endgroup\$ – Peter Bennett Aug 10 '18 at 22:37
1
\$\begingroup\$

Why all the complexity, you only need Q1 and the light sensitive detector.

schematic

simulate this circuit – Schematic created using CircuitLab

The datasheet for the TEPT4400 shows that you are unlikely to get more than 200uA of current unless you have an extreme light intensity from a tungsten light source. Read the CIE A definition here.

The Q1 10K Ohm base Emitter resistor will result in a threshold value of around 70uA, you may need to increase this to get sufficient base current for the light level you want to detect.

enter image description here

| improve this answer | |
\$\endgroup\$
4
\$\begingroup\$

Ground the emitter of Q2, and take the signal from its collector. Leave R2 there, but increase its value to 3 - 5K. This will invert the signal, but that is easily fixed in software.

You should probably have 1K or so resistors between Q1 base and Q3 emitter, and between Q2 base and Q3 emitter, to make Q1 and Q2 a bit more independent of each other.

As you show it, Q2 is used as an emitter follower, so its emitter can never be higher than about 0.7 volts below its base - and its base is held at about 0.7 volts by Q1's emitter/base junction.

| improve this answer | |
\$\endgroup\$
-1
\$\begingroup\$

move R3 to the into the base lead of Q1

enter image description here

the emitter follower Q2 will not steal more current than it needs leaving the remainder to drive the Q1. you probably don't need R2, unless you need the signal outuput to be short-circuit resistant.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ This will not work, the base current provided by the phototransistor is simply to low. You will get no 'Signal'. \$\endgroup\$ – Jack Creasey Aug 11 '18 at 3:48
  • \$\begingroup\$ yeah R3 is too low, I not going to re-draft a schematic from a screenshot. \$\endgroup\$ – Jasen Aug 11 '18 at 8:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.