Arduino Motion Mute


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


  1. // Motion Mute
  2. // Sensor Code
  3. // pkvi
  4. int pir = 3;
  5. int beep = 4;
  6. int state = 0;
  7. void setup()
  8. {
  9. pinMode(pir, INPUT);
  10. pinMode(beep, OUTPUT);
  11. }
  12. void loop()
  13. {
  14. state = digitalRead(pir);
  15. if (state == 1) {
  16. digitalWrite(beep, HIGH);
  17. delay(2000);
  18. digitalWrite(beep, LOW);
  19. } else {
  20. digitalWrite(beep, LOW);
  21. }
  22. delay(100);
  23. }

Mute Code
  1. // Motion Mute
  2. // Mute Code
  3. // pkvi
  4. // IRLED pin 3
  5. #include <IRremote.h>
  6. IRsend irsend;
  7. // Neopixel
  8. #include <Adafruit_NeoPixel.h>
  9. #define PINSTRIP 9
  10. Adafruit_NeoPixel strip = Adafruit_NeoPixel(3,
  11. PINSTRIP, NEO_GRB + NEO_KHZ800);
  12. int rec = 0;
  13. int recpin = A0;
  14. void setup()
  15. {
  16. Serial.begin(9600);
  17. // Load Neopixel
  18. strip.begin();
  19. strip.show();
  20. // Loading Alert
  21. colorWipe(strip.Color(0, 255, 0), 100);
  22. colorWipe(strip.Color(0, 0, 0), 70);
  23. }
  24. void loop()
  25. {
  26. // Read Speaker
  27. rec = analogRead(recpin);
  28. // 0 to 1023
  29. if (rec > 25) {
  30. // Send Mute Signal
  31. for (int i = 0; i < 3; i++) {
  32. // Designated by IRRecDemo
  33. // Mute for Samsung
  34. irsend.sendSony(0xF0A01BE, 12);
  35. delay(40);
  36. }
  37. // Red Alert
  38. colorWipe(strip.Color(255, 0, 0), 100);
  39. colorWipe(strip.Color(0, 0, 0), 100);
  40. // Reduce Redundancy
  41. delay(3000);
  42. } else {
  43. // Light Blue
  44. colorWipe(strip.Color(0, 0, 10), 100);
  45. }
  46. delay(100);
  47. }
  48. void colorWipe(uint32_t c, uint8_t wait) {
  49. for (uint16_t i = 0; i < strip.numPixels(); i++) {
  50. strip.setPixelColor(i, c);
  51. strip.show();
  52. delay(wait);
  53. }
  54. }

Menu
Index
Engineering
Entertainment
Literature
Miscellaneous
Contact
Search
tiktok.com/@pkvi.xyz
Why Ayh?
Miter
Miter
@pkvi
"...may not meet professional standards."
2,364 miters
123 tenons
Subscribe
0.01232