Interesting, thanks Jon, I hadn't seen a switched emitter before.
I'd still like to do this with only one transistor, though. I'm wondering if
something like this would work:
When the IC output was 0, the piezo would draw current through R2. When the
IC output was high, the transistor would conduct, pulling down the voltage
at the collector.
Dunno if that might work, though. It'd depend on if R2 would be small
enough to still allow enough current through the piezo, while not burning
out the transistor, but still big enough to pull down the collector enough
to shut down the piezo (~3 volts).
I don't think so.
Assume the piezo requires Ip=15mA and Vp=? volts, for now.
When the piezo is sounding at 15mA, your R2 must be <=
(18-Vp)/Ip or [1200-(200/3)*Vp]. Of course, if Vp is 18 then
R2=0 and you are obviously in trouble. So you need to get by
on less than Vp=18V with the buzzer. I suspect you can. But
let's continue on a different path.
Now assume the piezo is off and Q1 is turned on. At this
point you've got to cause Q1's collector to drop below some
voltage required for the buzzer to work. The arrangement you
have above doesn't really allow you to do anything but treat
the BJT as a switch, so you need to figure that there will be
18V across R2 in order to turn off the piezo, so Ic*R2=18.
I haven't looked up your output capability when high, but I
recall reading Sylvia saying you are guaranteed 440uA for HI.
Assume it is for now. You can plan on say beta=30 for the
BJT.
Then Ic can be as much as 30*440uA or 13.2mA. But also
recall that Ic*R2=18. So from this we compute R2=18/13.2mA
or 1364 ohms.
Which is a problem because 1364 ohms * the piezo's 15mA is
more than 18V drop across R2. Which means the piezo will be
off either way. It just won't work.
Even if you assumed that beta=100, R2 would be about 410 ohms
and 410 * 15mA = 6.15V. Which means your piezo would have to
work okay with less than 12V. Assuming it still drew 15mA,
then. Likely, it draws maybe a little less meaning the
voltage across it is a little higher and it finds the balance
point at something less than 15mA and something more than 12V
to work with.
You could try it, I suppose. Maybe try R2=390 or 450?
Jon