Padmalaya Rawal
Published © CC BY-NC-SA

JARVISify your Alexa

We all need Hey, JARVIS rather than Alexa. Isn't it?

IntermediateFull instructions provided436
JARVISify your Alexa

Things used in this project

Hardware components

DFRobot Arduino Nano (or compatible board)
×1
DFRobot Offline Voice recognition module
×1
DFRobot DF Player mini
×1
DFRobot USB Cable
×1
mini speaker
×1

Software apps and online services

Arduino IDE
Arduino IDE

Hand tools and fabrication machines

Soldering iron (generic)
Soldering iron (generic)
3D Printer (generic)
3D Printer (generic)

Story

Read more

Schematics

Circuit diagram

Code

JARVISify Alexa

Arduino
/*Love the project? Consider Supporting :)
https://www.linktr.ee/padmalaya_rawal */

#include "DFRobot_DF2301Q.h"
#include "SoftwareSerial.h"
#include "DFRobotDFPlayerMini.h"

//I2C communication
DFRobot_DF2301Q_I2C DF2301Q;

// Use pins 2 and 3 to communicate with DFPlayer Mini
static const uint8_t PIN_MP3_TX = 2; // Connects to module's RX 
static const uint8_t PIN_MP3_RX = 3; // Connects to module's TX 
SoftwareSerial softwareSerial(PIN_MP3_RX, PIN_MP3_TX);

// Create the Player object
DFRobotDFPlayerMini player;

void setup() {

  Serial.begin(115200);

  // Init serial port for DFPlayer Mini
  softwareSerial.begin(9600);

  // Start communication with DFPlayer Mini
  if (player.begin(softwareSerial)) {
   Serial.println("OK");

    // Set volume to maximum (0 to 30).
    player.volume(15);
    // Play the first MP3 file on the SD card
    player.play(1);
  } else {
    Serial.println("Connecting to DFPlayer Mini failed!");
  }

// Init the voice reognition module
  while( !( DF2301Q.begin() ) ) {
    Serial.println("Communication with device failed, please check connection");
    delay(3000);
  }
  Serial.println("Begin ok!");
  DF2301Q.setVolume(2);
  DF2301Q.setMuteMode(0);
  DF2301Q.setWakeTime(15);

  uint8_t wakeTime = 0;
  wakeTime = DF2301Q.getWakeTime();
  Serial.print("wakeTime = ");
  Serial.println(wakeTime);

  // DF2301Q.playByCMDID(1);   // Wake-up command
  DF2301Q.playByCMDID(23);   // Common word ID

}

void loop() {
  // Check for CMID from DF2301Q
  uint8_t CMDID = 0;
  CMDID = DF2301Q.getCMDID();

  if (CMDID == 1 ) {
    Serial.println("Specific CMID detected, playing audio file 1.mp3");
    player.play(1);
    // You can add additional logic or commands here as needed
  }
delay(500);

}

Credits

Padmalaya Rawal

Padmalaya Rawal

2 projects โ€ข 1 follower
A hacker trying to build either something useful or funny or may be both ๐Ÿ˜‰

Comments