I will say this DF2301 is a smart sensor, not because it has some AI or Internet models working inside. Because this sensor is capable of giving you the essence of new generation Machine learning models. Running on a small microcontroller it is able to convert the speech signals into text by recognizing them. This module can be trained to do different tasks, as the tutorial will proceed I will tell how to train the module. I think this is the best piece of electronics and computer engineering, having a lot of features. This offline speech recognition sensor is built around an offline voice recognition chip, which can be directly used without an internet connection. It comes with 121 built-in fixed command words and supports the addition of 17 custom command words.

This small sensor can be interfaced with any microcontroller board and then different actions can be performed over voice. It will be the same as Alexa but with much more restricted commands and answers. Because overall it is a small ML model working on a little microcontroller. Some popular applications are such as various smart home appliances, toys, lighting fixtures, and robotics projects, among others.

Being a huge fan of Marvel and Iron Man it is very interesting to rename the voice assistant model as “JARVIS”. Now the Jarvis has power to ON/OFF the home appliances without any connection to the internet. 


  • Self-learning function: Learn command words by the voice
  • Support I2C and UART
  • Compatible with 3.3V/5V
  • Built-in with 121 commonly-used fixed command words
  • The module has a built-in speaker and an interface for an external speaker,
  • Equipped with power indicator (red) and recognition status indicator (blue)
  • Dual microphones provide better noise resistance
  • Compatible with Arduino, Raspberry Pi and ESP32


  • Operating Voltage: 3.3 - 5V
  • Maximum Operating Current: ≤370 mA (5V)
  • Communication: I2C/UART
  • I2C Address: 0x64
  • Fixed Command: 121
  • Fixed Wake-up Command: 2
  • Custom Command: 17

The same module can be used for smart home configuration, making a solid state relay interface with module and microcontroller on a single PCB. This tutorial is sponsored by NextPCB, China Best PCB manufacturer providing PCB, PCBA, Stencil, SMT and BOM services. Try free PCB assembly prototyping on first 5 pieces of PCB.

Check the requirements of PCB, Free shipping of electronics components, And it is always fun to use free DFM Gerber Viewer to inspect the PCB details.

How the algorithm works:

Voice recognition is a computer technology that recognizes and converts speech signals into editable text or operational commands through analysis. It allows people to interact with computers by speaking without using a mouse, keyboard, or other input devices. Voice recognition technology has been widely used in applications such as voice assistants, smart homes, voice search, and voice recognition notebooks.

What are Fixed/learned Command words and wake-up words:

I will try to keep it as simple as possible, I will divide all the words in 3 sections as per action. See the block diagram given below.

1) Wake-Up words: The wake-up word refers to the word that switches a product from standby mode to operational mode. It is the first command which is given to wake the module. It is similar to saying “Alexa” ,“Hey Siri” ,“OK Google”. Same as that here the default wake up word is “Hello Robot” and it is the default one. We can also add one more wake work which is demonstrated below as “JARVIS”

2) Command words: Fixed command words refers to the designated vocabulary used by users to issue specific instructions. Here these words are essential because, after all, this is an offline module and does not have external data/server from the internet to process. So these are the already processed, trained words which are stored in the memory of the...

Read more »