Pages: [1]   Go Down
Author Topic: PIR activated speaker advice  (Read 944 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Karma: 0
Posts: 1
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I'm trying to turn a speaker off when a PIR sensor detects motion, but have been having some trouble.
I'm guessing the best route is to have the PIR sensor activate a relay that is between the speaker and amplifier, no?
I have had some success activating a relay with my Arduino, but so far, I'm struggling to get the code right this time.
Anyone able to help me with the code by chance? It seems like it should be simple. Perhaps I'm just missing something...
If anyone has an existing bit of code to accomplish this, please help!

Manchester (England England)
Offline Offline
Brattain Member
Karma: 636
Posts: 34579
Solder is electric glue
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Perhaps I'm just missing something
We will never know unless you post the code, please use the #icon when posting code.

Offline Offline
Jr. Member
Karma: 0
Posts: 61
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

get a relay board thet take a 5v signal low some high to activate. i would use it to turn the amp off.

if(pirSensor == HIGH) // most standalone sensors will give this keep in mind they usualy need                                // to stabilise  to the enviroment.
   digitalWrite( relayPin, LOW);
thats all u really need arduino vin gnd and signal to relay is all you need

Pages: [1]   Go Up
Jump to: