Electronic – Base resistor in open collector

analogcircuit analysistransistors

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

Best Answer

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.