General

SEN0539 Voice Recognition Module getting strange characters returned in Arduino IDE

userHead SquareZones 2024-02-22 05:04:22 552 Views5 Replies

Hi, I connected the Voice Recognization Module over I2C and used the example program provided but it returned some strange characters, has anyone seen this and know how to fix it or did I get a bad module? I appreciate your help in advance!!

 

Below is the output I see in the Serial Monitor in the Arduino IDE…

 

 

Begin ok!

��� UBegin ok!

wak

�E� Begin ok!

= 15

CMDID = 23

E�   Begin ok!

= 15

CMDID = 23

�KQ��2�

2024-02-24 21:39:09

EXAMPLE CODE I used for ARDUINO for I2C communication and YES I do have the toggle switch on the voice recognization module set to I2C

I cut out some code comments as this blog post only supports 9999 characters. 

 

#include "DFRobot_DF2301Q.h"

//I2C communication

DFRobot_DF2301Q_I2C DF2301Q;


 

void setup()

{

  Serial.begin(115200);

  // Init the sensor


 

  while( !( DF2301Q.begin() ) ) {


 

    Serial.println("Communication with device failed, please check connection");


 

    delay(3000);

  }


 

  Serial.println("Begin ok!");


 

  DF2301Q.setVolume(7);


 

  DF2301Q.setMuteMode(0);


 

  DF2301Q.setWakeTime(15);


 

  uint8_t wakeTime = 0;


 

  wakeTime = DF2301Q.getWakeTime();


 

  Serial.print("wakeTime = ");


 

  Serial.println(wakeTime);


 

  DF2301Q.playByCMDID(23);   // Common word ID

}


 

void loop()

{

  uint8_t CMDID = 0;

  CMDID = DF2301Q.getCMDID();

  if(0 != CMDID) {

    Serial.print("CMDID = ");

    Serial.println(CMDID);

  }

  delay(3000);

}

userHeadPic SquareZones
2024-02-24 21:31:56

Thank you for your response. Yes, the baud rate of your serial monitor is set to 115200 as that is what was set in the example code. Do I need to make changes other than the code shown below or make changes to the Arduino? 

 

Setup for Voice Recognition Module > Arduino Mega:

VCC > 5V

GND > GND 

C/R > SCL 21

D/T > SDA 20

 

Since the connector is supplied with the voice recognition module and does not directly plug into the Arduino I have to use a jumper/extender where the jumper wire is pointly on both ends one end goes into the supplied wire connecter and the other end goes to the Arduino. I do not yet know if that is causing the problem but can't think of a different way to hook it up. (new to Arduino). 

 

After this, I compile the code and push it to the Arduino, and upon receiving it the TX and RX lights blink rapidly on the Arduino Mega and the voice control module says “Done” but says it more quietly than if only power and ground are supplied and I set the volume to 7 (see below code) 

 

I also just ordered another SEN0539 Voice Recognition Module that just arrived today (ordered from Amazon for both of them) and hooked up the second one to the Arduino and same result. 

 

Second SEN0539 Voice Recognition Module OUTPUT: 

U�Begin ok!

= 15

CMDID = 23

U_� ��

 

Code for Arduino: 

Will put the example code in the next post as this post only allows so many characters. 

 

MY NEXT STPS: 

Learn Python and try the experiment on Raspberry PI. This should be extremely straightforward, not sure what is going on. If anyone has step-by-step info on how to run this on Raspberry PI 4B that would be great, otherwise I'll try to figure it out. 

 

ANY help to get those characters to show up correctly would be GREATLY appreciated!!

userHeadPic SquareZones
2024-02-22 10:37:52

Is the baud rate of your serial monitor set to 115200? incorrect characters could be due to a baud rate mismatch.

userHeadPic Yeez_B
SquareZones wrote:

Yeez_B you were correct, I had the misconception of believing that I was setting the baud rate inside the code it called:

 

{void setup()

 

  Serial.begin(115200);

}

 

It needed to be set on the pull-down menu of the serial monitor itself. HAHA I'm new to Arduinolive and learning. Worse correctly after doing so. 

 

PS

One strange thing I noticed was the serial monitor sometimes doesn't pick back up and has to be closed and reopened (after a long pause in usage or if I close my laptop) if you know of any work around please let me know.  

 

 

Thank you again for your comment took me a minute to understand it after I came across the drop-down menu it certainly helped!!

2024-03-03 03:23:52
SquareZones wrote:

Yeez_B you were correct, I had the misconception of believing that I was setting the baud rate inside the code it called (I had thought because I pass it in the code it will pass it downstream to anything that needs it, well I was wrong about it in this IDE):

 

{void setup()

 

  Serial.begin(115200);

}

 

It needed to be set on the pull-down menu of the serial monitor itself. HAHA, I'm new to Arduino, live and learn. Works correctly after doing so. 

 

PS

One strange thing I noticed was the serial monitor sometimes doesn't pick back up and has to be closed and reopened (after a long pause in usage or if I close my laptop) if you know of any workaround please let me know.  

 

 

Thank you again for your comment took me a minute to understand it after I came across the drop-down menu it certainly helped!!

 

2024-03-03 03:29:00
2 Replies