JARVISify Alexa

by PADMALAYA RAWAL in Circuits > Arduino

465 Views, 7 Favorites, 0 Comments

JARVISify Alexa

Instructables Thumbnail- 1200x1000px.png

We all Love Iron Man's JARVIS and might have sometimes tried to build one by ourselves. How do I know? because I also tried that too😂. Building a JARVIS is more like a Software project and I love more hardware than software when I noticed that I already own an Amazon Alexa, I just needed to change its name. After spending weeks, I found that the name could not be changed. So, I thought why not add external hardware that can take a custom command and speak out Alexa at a very low level to activate it!

And that's exactly what I did.

Supplies

Components:

  1. Arduino Nano (you can also use Arduino Uno/mega/pro mini)- Buy here
  2. DF Robot's DF Player mini- Buy here
  3. DF Robot's Offline Voice Recognition Module - Buy here
  4. USB Cable- Buy here
  5. Mini speaker- Bought from local market


Tools:

  1. Soldering Iron
  2. 3D Printer or a friend with a 3D printer

Circuit Diagram

Circuit.png

Please connect the components as per the circuit diagram shown above. Please make sure to connect all the Positive wires and negative wires of the circuit together and use them to power up the project.

Arduino Libraries

To make the project work, you need two libraries one for the "Offline Voice Recognition module" and the other for "DF Player mini". I am unable to upload the zip file of libraries here but you can download the same from here: https://electroboffin.com/curiosity-sparks/jarvisify-your-alexa/

Audio File

You will need an audio file that you will save to the Micro SD Card that will go to DF Player mini. In my case, I have changed the name of my Amazon Echo Dot to "Echo" rather than the default "Alexa" which can also be done by going to the Amazon Alexa mobile app. If you have also changed the name to "Echo" like I did. Otherwise, you can either record an mp3 with your voice saying the wake word (Alexa, Echo, Hey Google, Hey Siri, etc...) or use any online text-to-speech convertor website to achieve the same results.


Make sure to change the name of the audio file to "01.mp3", only then it will work. Please note that if you are thinking of changing the name in the code as per the audio file name, it won't work, DF Player Mini only supports the numerical file names.

Downloads

Code

/*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);


}


Downloads

Custom Wake Up Command

Once you are done uploading the code, now you have to add your custom wake-up word to the DF Robot's Offline Voice Recognition module by following the below steps:

  1. Initiate the voice assistant by employing the default wake-up word which is "Hey, robot"
  2. Utter "Learning wake word"
  3. Speak the designated wake-up word to be acquired: "Hey, JARVIS"
  4. The module will indicate by saying "Learning successfull, please say it again!"
  5. Speak the designated wake-up word to be acquired again which is "Hey, JARVIS"
  6. The module will again indicate by saying "Learning successfull, please say it again!"
  7. Speak the designated wake-up word to be acquired again which is "Hey, JARVIS"
  8. The module will indicate by saying "OK, Learning completed"


Now the electronics part of the project is done.

CAD Model

If you wanna design your 3D Model for an enclosure, you might need the CAD Model that I have used. Here are all the links to CAD Models.

  1. Amazon Alexa Echo Dot Gen 3: https://grabcad.com/library/amazon-alexa-echo-dot-3-0-1
  2. DF Player mini: https://grabcad.com/library/dfplayer-mini-3
  3. Arduino Nano: https://grabcad.com/library/arduino-nano-ch430g-1
  4. DF Robot Offline Voice Recognition module: https://electroboffin.com/product/eb24001/

Slicing

Screenshot 2024-01-07 142644.png

Download the below stl file and by using any of your favorite Slicing software, slice it. I have used Prusa Slicer and the following are the details that you are looking for

  1. Bed Temperature- 60C (Room Temperature- 10C)
  2. Nozzle Temperature- 210C (Room Temperature- 10C)
  3. Support- Yes(Organic)- On build plate only
  4. Infill- 15%
  5. Nozzle- 0.4mm
  6. Layer height- 0.2


If you need to edit the 3D model of the same please comment, and I will share the step file :)

Downloads

3D Printing

Screenshot 2024-01-07 143122.png

3D Print the slice model and here are the details that you might need:

  1. Material- PLA+
  2. Time to Print- 3hr 49min
  3. Material weight- 45.36g

Assembling

P1020257.JPG
Screenshot 2024-01-07 150934.png

The assembly is very straightforward, just follow the circuit diagram and you are good to go. The only thing you have to keep in mind is to connect the Power cable and the speaker at the end by inserting their wires from the circular holes provided. Rectangular holes are for the microphones of the Offline Voice recognition module. There is a slot provided inside on the back of the rectangular holes section and that's for the Gravity connector.

Place your Alexa Echo Dot Gen 3 on the top and stick the speaker on one of the 4 microphones of the Echo Dot as shown above.

Enjoy!!

JARVISify your Alexa || #shorts #ironman #marvel

You are good to go to do wonders with your JARVISified Alexa!!

Happy Tinkering🚀