I'm out of pins in my (now infamous) Alarm Clock project, and I'd like to
wedge in one more input pin. So now it's time to resort to a trick. Will
this work? My concern is damaging the BS2.
I have an output pin that goes through a 1k resistor, to an input on a
ULN2003A (Darlington pair base). The Darlington's output is a speaker, and
the output pin is used for occasional FREQOUT purposes. (The 1k resistor
reflects my obsessive fear of hurting pins - the darlington already has a
built in 2.2k resistor).
Periodically, I'd like to redeclare this BS2 pin as an input, and test it.
I'm assuming that base-emitter current from the darlington (through 1k
resistor) would make the pin appear low, without damaging the BS2. Now
assume +5v is applied, through a separate 1K resistor, to that same BS2 pin.
This would presumably drive the pin high (and also turn the darlington on,
but that will just make the speaker click and would be harmless.)
It's certainly possible that the +5v could be applied to the pin while it is
in an output state, during a FREQOUT or otherwise. This means an output pin
is connected through 1k to +5v. The output might be low or high (during a
FREQOUT). Any harm in that?
BS2 pin (sometimes in, sometimes out)