Arduino High-Impedance Output

Hello!

I am trying to make a switch using a NPN referenced to ground, and an ATMEL referenced 3.8V above the ground. If I set the output to low, it will keep the transistor on.

So I am wondering if I set the Attiny's output on Hi-Z, will it cutoff the NPN? I haven't found a reliable source for the Hi-Z value. Is it 100Mohm ?

Ib will be : [3.8V-0.7-(10K*Ib)]/100M => approximately 31nA, in this scenario the transistor will be cutoff. But I've read in others sources that pin leakage is 1uA.

Any ideas if Hi-Z will keep the transistor in cutoff region?

There are ESD protection diodes that prevent the output from going about one diode drop below ground. I think I’d use a PNP in between the ATTiny and the NPN. Emitter of the PNP connected to the 5.6V of the ATTiny’s V+.

All CMOS chips have protection diodes, its pretty fundamental to CMOS design (this is why many chips can be back powered from signal connections (very bad news)).

opto coupler?

BTW the hi-Z impedance at room temperature (between GND and Vcc) is likely 10^10 ohms or more. Across the full temperature range the leakage increases to 1uA or so (150C or so) - basically the leakage is that of reverse-biased pn-junctions which rises exponentially with temperature.

Ok, thanks ! I forgot about those diodes… :blush:

I will use an adequate driver or opto.

Here it is, with an LTSpice simulation file. PNP drives NPN from a 3.8 to 5.6V squarewave, and switches a load from 1.8V to ground.

PNPtoNPNLevelShifter.asc (1.46 KB)

Your 220 ohm resistor is wrong - it should be 10k also, otherwise the transistor will never switch on.

Even with 10k from base to ground there is no question whatsoever that when the MCU pin is high-Z, the transistor will absolutely be switched off - the high-Z impedance is quite inconsequential.

But the base resistor will be at 3.8V - 0.7V = 3.1V when the output is Hi Z. So the transistor would still be on with two 10k resistors.

Oh, I see - didn't catch the bit about the odd voltage reference. Needs two 10k resistors and a couple of red LEDs.

The PNP transistor makes more sense to me.