1. Arduino Uno (2) 2. PIR Motion Sensor Module 3. Nerf Walkie Talkies (5$US on eBay) 4. IR LED Transmitter 5. IR Receiver (Salvaged) 6. 47 R 7. 2.2K R 8. TIP120 9. 330 R 10. 5V Relay 11. 4001 D (Optional) Adafruit NeoPixel LED Strip, 1Knf C and 47 R
// Motion Mute
// Sensor Code
// pkvi
int pir = 3;
int beep = 4;
int state = 0;
voidsetup()
{
pinMode(pir, INPUT);
pinMode(beep, OUTPUT);
}
voidloop()
{
state = digitalRead(pir);
if (state == 1) {
digitalWrite(beep, HIGH);
delay(2000);
digitalWrite(beep, LOW);
} else {
digitalWrite(beep, LOW);
}
delay(100);
}
Mute Code
// Motion Mute
// Mute Code
// pkvi
// IRLED pin 3
#include<IRremote.h>
IRsend irsend;
// Neopixel
#include<Adafruit_NeoPixel.h>
#define PINSTRIP 9
Adafruit_NeoPixel strip = Adafruit_NeoPixel(3,
PINSTRIP, NEO_GRB + NEO_KHZ800);
int rec = 0;
int recpin = A0;
voidsetup()
{
Serial.begin(9600);
// Load Neopixel
strip.begin();
strip.show();
// Loading Alert
colorWipe(strip.Color(0, 255, 0), 100);
colorWipe(strip.Color(0, 0, 0), 70);
}
voidloop()
{
// Read Speaker
rec = analogRead(recpin);
// 0 to 1023
if (rec > 25) {
// Send Mute Signal
for (int i = 0; i < 3; i++) {
// Designated by IRRecDemo
// Mute for Samsung
irsend.sendSony(0xF0A01BE, 12);
delay(40);
}
// Red Alert
colorWipe(strip.Color(255, 0, 0), 100);
colorWipe(strip.Color(0, 0, 0), 100);
// Reduce Redundancy
delay(3000);
} else {
// Light Blue
colorWipe(strip.Color(0, 0, 10), 100);
}
delay(100);
}
voidcolorWipe(uint32_t c, uint8_t wait){
for (uint16_t i = 0; i < strip.numPixels(); i++) {