So I have a PTZ camera and a siren. What I'm trying to do is trigger the siren when the camera detects motion.

The camera hooks up via PoE, but the siren just has a 12 volt connection, so it has to be triggered by another device.

The camera has the ability to send out an SNMP trap when it detects motion. I have a raspberry pi set up that listens for that SNMP signal. When the camera tells the pi that motion has been detected, I want to trigger the siren via some intermediary device that the pi can talk to over its GPIO. My problem is that I know nothing about hardware and have no idea what sort of "power switch" device I'm even looking for on amazon.

To recap, I have a camera. When that camera detects motion, a signal is sent to a raspberry pi. When the pi gets that signal, I want it to activate a dumb siren that runs off 12v. What is the device that I need sitting between the pi and the siren to allow power to flow the siren only when a condition is met in a python program running on the pi?

My background is in programming and I know next to nothing about hardware so any info would be helpful!


1 Answer 1


The simplest device you can use will probably be a solid state relay.

Example1, Example2

Most of these will be grossly oversized for your siren, but they're cheap and they solve the problem with only one part. You could use a regular relay, except that the coil draws more power than the pi can supply. An SSR will give you the same effect, but will draw far less current from the pi.

A smaller and cheaper way to drive your siren would be to use a mosfet as a switch. This is how it would be done in a commercial product.


simulate this circuit – Schematic created using CircuitLab

The circuit is simple, but you'll have to carefully choose the mosfet to make sure it will be fully turned on by the raspberry pi's 3.3v. Most common mosfets will not. If you go this route, a mosfet you could try is the IRL2203NPBF.

  • \$\begingroup\$ Awesome, thanks for the help! I just found a relay we had laying around here, so I'm going to give that a shot. It looks a bit different than the solid state relays you linked though.. it's more like this one on amazon: a.co/5JBtKrG. Would something like that work? \$\endgroup\$
    – Adam O.
    Jan 25, 2018 at 15:08
  • \$\begingroup\$ That relay module should work, the opto-isolator will reduce the current required from the pi to 2ma, which it can handle. If I were doing this, I would drive the VCC pin with a separate 5v supply. Mechanical relays are extremely noisy (electrically), so powering it straight from the pi's 5v pins may cause issues. It may work fine, just an fyi. \$\endgroup\$
    – Drew
    Jan 25, 2018 at 19:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.