Arduino Talk to As!
In this project I present a simple idea, how to send voice commands to the Arduino and have it execute them based on an unlocking procedure and a password, at the same time confirming vocally all the operations performed
Supplies
1.Arduino Nano
2.MP3 DF Player module
3.HC-05 bluetooth module
4.Relay module
5.1k resistor
6.4x330...470 ohm resistors
7.4xLED's
8.Any microSD card (empty)
9.Visuino software
10.Breadboard and jumper wires
11.Arduino IDE
Schematic Diagram
- The connection diagram is relatively easy. Attention when uploading the code to the Arduino, this is done with the RX pin of the Arduino disconnected from the HC-05 module, or without the module being connected, this is done after uploading.
- If you get confused in the serial pins of the MP3 mode or if the Arduino does not respond vocally, reverse the connections to its RX-TX pins.
The Principle of Operation, Files
The operating principle is simple "The operator transmits a voice command set in advance in a mobile application installed on a mobile terminal (phone), it transmits to the Google voice recognition server and it retransmits the voice data in text format to the terminal. In turn, the terminal transmits via bluetooth to the Arduino a text value set by the operator for each individual voice command.
The microcontroller code recognizes the text value and executes or not the command if the procedure conditions and the password are correct. If the procedure is not followed, Arduino will warn you vocally about this. Likewise for the execution, ON-OFF or reset commands.
Download and install the application "Bluetooth Control Application" from the play store. Unfortunately for IoS I have not found an alternative to this application other than the paid one. In the voice commands section you can set any voice commands you want. The important thing is the text value sent to the Arduino, in the SEND section DATA. You can watch in the video how easily the voice commands can be changed.
Record the MP3 files that will be played by the Arduino with any sound recording program. You can record the operating system narrator or even your voice.
Save the file in MP3 format and rename them starting with the number 1 in ascending order to be easily recreated by the Arduino code. If you don't want to change the audio files from the tutorial, you can skip this step and copy the ones in the attachment to the microSD card.
The Code
The code is compiled in Visuino. After loading the code from the attachment, we see 10 "Compare text value" components that have inputs connected to the serial port. In other words, when the text value in the "properties" field of the component is identical to the text value received via Serial via Bluetooth, it changes its output state from "false" to "true" and orders one of the MP3 files on the SDcard. If all the conditions are met, unlocking procedure, password, time limit, Arduino will execute the received command.
If the conditions are not met, the Arduino communicates this vocally. Also, any command it executes, it communicates vocally.
The "Delay" component (marked with the red arrow in the image) has a value of 60 seconds. If, after a valid command of the procedure, the next valid command is not given, the system is reset and the procedure restarts from 0.
Set the Arduino Nano board, Old bootloader and the correct port and the code is loaded into the Arduino
Downloads
Start the Device
power the device through the USB port or from the batteries on the Vin pin of the Arduino board. We connect the mobile terminal to the HC-05 bluetooth . Open the "Arduino Bluetooth Control" application, connect the application to the HC-05 module and execute a voice command.The Arduino should immediately respond to the command or communicate if the procedure is correct.
- Enjoy!