Emic2 & I2C
jeffro Posts: 4
I have an EMIC2 attached to an Arduino mega 2560 and also have a OLED screen attached on I2C. When the Emic2 talks my screen blanks out and the Arduino freezes and I have to restart it. If I comment out the lines where the Emic2 talks it runs with no issues. Has anyone else had issues similar to this or can anyone assist me with this issue. Thank you
How are you communicating with the Emic2? Are you using an UART on the Arduino?
How are you powering your system? Is it possible the Emic2 causes a power spike which brownouts the Arduino?
If you post your code I'd take a look at it.
Per Duane, sounds like a power supply issue. More current needed. Higher capacity battery, fatter wiring, filter & decoupling caps all around.
I was using a 5v 1000 mAH battery pack and that was the issue. Moved up to using a 7.4v 3000 mAH and the problem went away. Now I have a new question in regards to the Emic2.
Based on the example sketch that is provided with the Emic2.
I would like to know how to detect when the speech is complete. I was told that it will send a colon when it is complete.
I do not see how to address this as I would normally with a serial.
This is how I would do it normally, how do I do it with the emic.
Personally, I'd set up a state machine.
This would keep track of which activity to perform in each loop. Once the message has been sent to the Emic, I'd have the program monitor the input buffer to see if the message is complete.
I'm not sure I have an Arduino Mega in working order but I have an ESP32 which should be similar for this purpose. I'll try to write up an example of how I'd do in the next couple of days (hopefully today).
The whole reason for this is so that when the speech starts I can turn off the Microphone and then when the speech is complete I can turn it back on.
I think I found what I was looking for.
After looking at the code designed to be used with a SD card I saw this.
// The speak method fetches a file from the SD card
// and creates one message per line of the file that gets sent to the Emic 2 module
// Only the filename needs to be provided (file is inside the emic2 folder)
emic.ready(); // Waits until playback finishes
The emic.ready(); I think is what will do it.
Which should mean that before the phrase is spoke I can turn off the microphone and say the phrase and then turn the microphone back on.
Please correct me if I am wrong.