3
\$\begingroup\$

I want Vout to be logic 0 when Vin is logic 1 (+5V), and Vout to be high impedance otherwise. I designed the circuit like an open collector switch. But how can I design R1 value ? Usually in transistor switches, I calculate the base resistance value by calculating Ic(sat), putting Vce = 0V in the collector circuit. Then I divide it by Beta to find the minimum base current needed to switch on the transistor. Here there is no collector resistance or collector current. So I can't figure out what should be the minimum value of base current to turn on the transistor.

schematic

simulate this circuit – Schematic created using CircuitLab

\$\endgroup\$

4 Answers 4

3
\$\begingroup\$

There is no Vout in your circuit as shown.
You have to supply a pullup resistor to define a Vout and a collector current.
If you are simply taking the collector to an Arduino digital pin as an input, then you'd have to turn on the internal pullup resistor to provide current for the collector.

From the BC547 datasheet: enter image description here

For the Arduino input current on an AtMega328 the DIO pin schematic shows the Pullup resistor on the I/O pin.

The value of the pullup is shown in Table 32-2: enter image description here

So the minimum values is about 20 KOhm, through maximum of 50 kOhm. With a 5 V MCU you will draw about 250 uA maximum, if you are operating at 3.3 V then you'd expect a maximum of about 17 uA.

If you then look at your BC547 datasheet you'll notice that you need 50 uA or less to ensure you could pass the 250 uA collector current.
However there is a tendency to overdrive the Base so I'd suggest using around 250 uA Base current.
That would give a base resistor of about 18 kOhm in your circuit. This would be equivalent to an effective Hfe of 1.

If you use the minimum Hfe of 10 (for overdrive) as suggested by others then you end up with only 25 uA Base current and an R value of about 170 kOhm. There is nothing wrong with this of course, so you decide what overdrive you want to use. My preference is to not use high value resistors in digital circuits if I can avoid it.

\$\endgroup\$
1
  • \$\begingroup\$ Finally understanding the usefulness of data sheets. Got it :-) \$\endgroup\$ Commented Dec 16, 2017 at 19:03
5
\$\begingroup\$

As stated, you can't do it. You must specify both the maximum expected collector current and the minimum required output voltage.

Since open-collector outputs are ordinarily associated with saturated operation, it is usual to assume a beta in the range of 10 to 20, with the exact choice depending on how conservative you want your design to be.

\$\endgroup\$
3
\$\begingroup\$

Max it out. Or decide what the max ICE current should be for your design, then calculate the resistor for saturation at that current. An open collector with an unknown ICE you have to hazard a guess and make a determination of what your design should handle.

\$\endgroup\$
3
  • \$\begingroup\$ Vout will go to a microcontroller (Arduino) digital pin for read purpose. I cant figure out what would be the max Ic current in this case ? If Vin = high, will any current flow from the microcontroller to the ground via the transistor ? \$\endgroup\$ Commented Dec 16, 2017 at 17:11
  • \$\begingroup\$ @Passerby: shouldn't that be "<5mA" (less than...) \$\endgroup\$ Commented Dec 16, 2017 at 18:50
  • \$\begingroup\$ Yes, typo. If it's just for a high impedance input, then the current is typically less than 5 milliamps. A 1k base resistor is more than enough. And yes. The base current does flow through the transistor to ground in this case. So your base resistor must be sized for your micro controller's output limit. \$\endgroup\$
    – Passerby
    Commented Dec 16, 2017 at 19:03
2
\$\begingroup\$

Adding to the answers of others:

Your micro-controller has some internal pull-up inside. So yeah some small current will flow to the ground via the transistor, when Vin is pulled high. Now you can easily design for R1 using that info of collector current.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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