Pages: [1]   Go Down
Author Topic: PIR activated speaker advice  (Read 920 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
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!
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 627
Posts: 34222
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Utah
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
Logged

Pages: [1]   Go Up
Jump to: