Before starting to develop an actual full fledged solution, and offer an alternative to the smartwatch market, it was important to develop a mini prototype checking if the different systems/modules, as specified in the last blog post, can be implemented accordingly and will work together.
Moreover, I wanted to increase my knowledge of I2C and SPI protocols, as I was a novice.
The Serial Peripheral Interface is a synchronous serial communication interface specification used for short-distance communication, primarily in embedded systems.
I2C is a serial communication protocol, so data is transferred bit by bit along a single wire (the SDA line). Like SPI, I2C is synchronous, so the output of bits is synchronized to the sampling of bits by a clock signal shared between the master and the slave. The clock signal is always controlled by the master.
The following video demonstrates a device created on a breadboard with an Arduino Pro Mini, a DFPlayer Mini for MP3 sound output, and a Voice Recognition V3 module, capable of 80 different voice commands, all of 2 seconds each, and a maximum of 7 being activated at the same time.
The following code snipper demonstrates the main loop written in C++ in the Arduino IDE for audio output of different files at different volumes(30 is maximum):
#include "SoftwareSerial.h"
#include "DFRobotDFPlayerMini.h"
SoftwareSerial softwareSerial(10, 11);
// Create the Player object
DFRobotDFPlayerMini player;
void setup()
{
softwareSerial.begin(9600);
player.begin(softwareSerial);
}
void loop()
{
player.volume(30);
player.playMp3Folder(1);
delay(5000);
player.playMp3Folder(2);
delay(2000);
}
There have been some issues along the way with audio playback, as seen in this video:
In turns out that although the DFRobot DFPlayer module has a required voltage of 3.3V to 5.0V, it seems that it needs at least 3.7V(even 3.5V can be enough) to output correctly. In my case this is perfectly fine, as the 1cell lipo battery I am using has a minimum voltage of 3.3V when discharged and a maximum voltage of 4.2V when fully charged. The whole Arduino Pro Mini - DFRobot DFPlayer - Voice Recognition Module v3 interaction has been tested at both ends of the voltage spectrum and they operate as needed.
Here is the system working accordingly on loop:
And here is a video demonstrating the prototype device in action, being able to recognise a voice command and play an MP3 file accordingly:
댓글