Motion activated sound system for droids and other uses

Sdílet
Vložit
  • čas přidán 27. 08. 2024
  • This systems uses an arduino nano, a DY-SV5W audio player and a RCWL-0516 microwave motion detector board to play random droid sounds when motion is detected.

Komentáře • 8

  • @jamesdennis2877
    @jamesdennis2877 Před 2 měsíci +1

    This is amazing, I was talking about doing a C-3P0 head with a motion trigger earlier today. I'll be dropping you an email about this once I finish my current R2 project.

  • @BenjaminHartley-zf3jl
    @BenjaminHartley-zf3jl Před 2 měsíci +1

    This is awesome! I’ve been looking for a video like this for ages! Still learning script tho and i don’t think I’d be able to manage from scratch aha

    • @ImperialLightandMagic
      @ImperialLightandMagic  Před 2 měsíci +1

      Worth looking at AI to get you started with writing code, ChatGPT (whilst purists will shudder) can get you off to a really great start and can get you very close with just a few prompts.

    • @BenjaminHartley-zf3jl
      @BenjaminHartley-zf3jl Před 2 měsíci

      ive been at this for 8 hours and cant seem to get it to work ive tried so many different codes through chat gpt, any chance you could share yours?
      i keep getting
      #include
      const int motionSensorPin = 2; // Pin connected to RCWL-0516 OUT
      const int rxPin = 0; // Arduino D0 connected to DY-SV5W TX
      const int txPin = 1; // Arduino D1 connected to DY-SV5W RX
      const int ledPin = 13; // Onboard LED pin for indicating motion detection
      SoftwareSerial voiceModule(rxPin, txPin); // SoftwareSerial instance for voice module
      void setup() {
      Serial.begin(9600); // Initialize serial for debugging
      voiceModule.begin(9600); // Initialize SoftwareSerial for voice module
      pinMode(motionSensorPin, INPUT);
      pinMode(ledPin, OUTPUT);
      // Initialize the DY-SV5W Voice Playback Module
      delay(500); // Delay to allow the module to power up
      sendCommand(0xAA, 0x02); // Command to set module to MP3 mode
      }
      void loop() {
      if (digitalRead(motionSensorPin) == HIGH) {
      Serial.println("Motion detected!");
      digitalWrite(ledPin, HIGH); // Turn onboard LED on
      playRandomTrack();
      delay(2000); // Delay to prevent multiple detections
      digitalWrite(ledPin, LOW); // Turn onboard LED off
      }
      }
      void playRandomTrack() {
      int trackNumber = random(1, 6); // Generate a random track number between 1 and 5
      Serial.print("Playing track number: ");
      Serial.println(trackNumber);
      // Send play command to voice module
      sendCommand(0xAA, 0x03, trackNumber); // Command to play specific track
      }
      void sendCommand(byte cmd, byte para1, byte para2 = 0) {
      voiceModule.write(cmd); // Start byte
      voiceModule.write(para1); // Command or parameter byte
      voiceModule.write(para2); // Data byte (if needed)
      }

  • @BenjaminHartley-zf3jl
    @BenjaminHartley-zf3jl Před měsícem

    can i buy the code off you? i have all the same components

  • @ErnestBegley-nl6sb
    @ErnestBegley-nl6sb Před měsícem

    I have a ID-10 droid . I like to have a motion activated sound and lights. A pit droid sound and lights and a C1 (chopper) droid sound and lights all motion activated. Can you help? Please