Using a window sensor (reed switch) to control audio system speakers using a relay

Thread Starter

JohnnyDough

Joined Aug 5, 2018
3
Hi,
I want to control an audio system with 2 speakers, with a window sensor, as follows.

Audio system has 2 speakers connected (mono, not stereo, for this matter).
The window sensor (wired) attached to a window (a real physical window at my house)
When window is opened, speaker #1 is connected, and speaker #2 is disconnected to audio system.
When window is closed, speaker #2 is connected, and speaker #1 is disconnected to audio system.

I have no experience with relays, sensors, etc.
I thought about using relay to control this. the window-sensor will give the signal, and re-route which cable of speakers is connected.

So my questions are:
1) Is it possible at all, or that I'm far away ?
2) Do I need to a micro-controller, or use just the sensor and relay ?
3) Do I need 2 relays, because I want to control 2 speakers or that its possible to have a common input,
and direct output to A or B ?

Thanks a lot for any help.
JD
 

AnalogKid

Joined Aug 1, 2013
11,044
There are two types of audio power amplifiers, switching (class D) and linear, One DPDT (double-pole double-throw) relay will work with either. You are on the right track. You need one relay with a 12 V DC coil, one window switch, and a 12 Vdc power source, sometimes called a wall wart.

How loud are you running the speakers? This sets the power level being switched by the relay, and that sets the size of the relay.

ak
 

Thread Starter

JohnnyDough

Joined Aug 5, 2018
3
There are two types of audio power amplifiers, switching (class D) and linear, One DPDT (double-pole double-throw) relay will work with either. You are on the right track. You need one relay with a 12 V DC coil, one window switch, and a 12 Vdc power source, sometimes called a wall wart.

How loud are you running the speakers? This sets the power level being switched by the relay, and that sets the size of the relay.

ak
Thanks a lot for your help !
The speakers are mini, not loud. it's just for a prototype/proof-of-concept.
I've found relays as you've described, some even with application diagram similar to my purpose.
They seem to have 2 versions, 5v and 12v.
You've mentioned 12v, but It would be easier for my purpose to use 5v, since I can get the power from USB adapter which are very common now. So any special reason why 12v and not 5v ?
This is the one I've found (url below) just for confirmation, it's ok - right ?
JD

https://www.aliexpress.com/item/DR2...odule-for-Stereo-Audio-Motor/32787834681.html
 

AnalogKid

Joined Aug 1, 2013
11,044
For the same amount of contact pressure, a 12 V relay takes less than 1/2 the current of a 5 V relay. This is much better for thr switch contacts.

BUT - the module you found hhas a driver transistor on board, so switch current is not an issue. Looks like a good part for thr job.

ak
 

crutschow

Joined Mar 14, 2008
34,450
Yes, typical window sensors are small reed relays and can reliably carry only a small current, so a relay with a driver to limit the sensor current should be used, as the one you selected.

Using a 5V relay module with driver instead of a 12V is also okay.
 

Thread Starter

JohnnyDough

Joined Aug 5, 2018
3
Yes, typical window sensors are small reed relays and can reliably carry only a small current, so a relay with a driver to limit the sensor current should be used, as the one you selected.

Using a 5V relay module with driver instead of a 12V is also okay.
Ok, thanks a lot for your help !
Much appreciated.
 
Top