Transistor as controlled switch for ulatrasound speaker signal

Hi all,

I have an existing cat repellent device that emits ultrasound when the motion sensor detects a cat.

I want to enhance the device by using an Arduino to temporarily disable the ultrasound when a pin is HIGH (I have detected that a person is actually coming by).

i would rather not switch off the entire repelling unit because I think that it's IR circuitry can take up to 1 minute to initialize itself.

So I am wondering how I can use a transistor to simply open the speaker circuit, and close it back under control of the Arduino. The pb is, transistors only have 3 pins and it seems that the controlled circuit and the controller circuit are correlated - and here I have no idea what kind of signal I see going through the speaker wire... I could imagine / guess, but I am wondering if there is a way to use a transistor as 4 pin remote control switch: 2 pins connected to the Arduino's GND and control pin; and the two other pins inserted inline the circuit I want to control... if a transistor can't be used, is there a cheap alternative that would work?


You could use an npn mosfet... disconnect the negative lead of the speaker, the drain goes to the negative lead of the speaker, the source goes to the trace on the pcb the negative lead of the speaker went too and the gate a 100ohm reisistor and then goes to your arduino.

You would tie the ground of the arduino and cat torture device together as well, outside of the mosfet.

That's my concern, having to connect the grounds of the two devices; also, the negative leaf of the speaker is not necessarily ground is it? Couldn't it be alternating (going from negative to positive)?
And won't the frequency of the speaker signal matter?

I don't completely understand that setup because it seems that the switch control is tied to the signal (voltage between gate and source), when I'd like it to be independent (close switch whenever Arduino pin is high w.r.t. to arduino's ground).

[Edit] to clarify the mental image I have is the speaker wire going from -5v to +5v at very high frequency to generate the sound. So I don't understand how a mosfet triggers by measuring the voltage difference between gate (which I pull at 5v) and that source (alternating) is going to work?
I really wish those transistors & mosfets had 4 pins :slight_smile:

A high volume ultrasound emitter could be a resonant circuit, operating at much larger voltages than
the rest of the circuit or an Arduino, perhaps 30 to 50V. If so then you risk damaging something,
or interfering with the resonance and stopping it working.

A (good) picture of the board of the unit would be very helpful is seeing what sort of circuitry or
drivers are actually used.

[ BTW "npn mosfet" isn't meaningful, mosfets are n-channel or p-channel ]

Thanks I can post a picture, but my question was very general: is there some kind of transistor based circuitry I can create that would create an Arduino pin controlled switch, without depending on or interfering with the circuit being open or closed? I am just looking for the electronic equivalent of a solenoid-activated physical switch...

That's got to be a common concern, and I assume that if it isn't commonly used there must be good reasons why, and I'd like to understand them just out of curiosity :slight_smile:


No, all semiconductor switches interfere with the circuit they switch, although opto-isolated
devices are closest to the imaginary perfect device you are imagining. A switching device has
to handle the voltages, polarity, bandwidth, current etc of the circuit being switching - for instance
for switching RF signals impedance-matching and loss-factor are all-important, for low voltage
DC switching the on-resistance is all-important, for AC-mains being able to handle both half-cycles
is crucial...

Can put a simple SPDT relay in one of the speaker leads. Either leg. Wire up the speaker lead to Common and NC contacts. When Arduino energizes the relay, the circuit opens and the speaker is disabled.

How much current is going to the speaker?
Depending on the coil current selected, a transistor buffer may be needed to sink the coil current.

Thank you all,

The SPDT relay sounds perfect for an electronic dummy like me, I'll look into that. Not sure I can measure the speaker current with my digital multimeter, will it work on AC mode if the signal frequency is in the kHz range? Anyway the device was powered by 4 AA cells so it shouldn't be too high.


"Not sure I can measure the speaker current with my digital multimeter, will it work on AC mode if the signal frequency is in the kHz range?"

No. Not a problem it powered from AA batteries current will be no higher than Vsource/Rload,
6V/8ohm max.

With the relay in the Normally Closed position, will be like having a very low resistance (< 0.1 ohm) in series with the speaker. If the relay is not opened often, then it not be using any battery current either. Just a few tens of mA when you want the speaker disconnected.

Not arguing with you, but Mouser refers to them as N Channel, NPN...