Have you ever been curious about knowing if you are going to pass a test? If you are going to become a millionaire? If your beloved one notices you are around?
The future cannot to be seen or known; the oracle tricky is, but let us have fun with the possibilities.
This time we will show you how to create a fortune teller that will play games with your emotions by telling you your future.
How does it work?Simply asking for it! "Fortune Cat, tell me my future". These are the magic words.
Fortune Cat is a small box containing a screen that will show the keyphrase once you have said the words. The master behind the actions is an Arduino Nano 33 BLE Sense board, using a speech recognition system that decodes the words you speak aloud and executes the algorithm that selects and writes the sentence.
Let's begin!The Arduino Integrated Development Environment - or Arduino Software (IDE) - contains a text editor for writing code, a message area, a text console, a toolbar with buttons for common functions, and a series of menus. It connects to different boards’ hardware to upload programs and communicate with them.
Go to the official Arduino website and download the latest version of Arduino IDE, then install it on your PC. Once installed, launch the application.
On the toolbar, go to Tools > Board > Boards Manager and look for Arduino Mbed OS Nano Boards. Download and install the latest version of the core. Allow the installation of any additional drivers.
Then, go to Tools > Manage Libraries and look for DSpotterSDK_Maker_33BLE. Download and install the latest version of the library. This library will help you with the speech recognition process.
Before proceeding with the coding process, you will need to create the Model with the customized commands to trigger the action of selecting the phrase and showing it on the screen. In this case, we will be using a Free Trial Model Configuration. You will need the serial number of your board to create your model.
Connect the Arduino Nano 33 BLE Sense to your PC, and ensure you select the right COM port and board in the Tools section. Then, go to Tools > Get Board Info and save the serial number.
We are using the speech recognition tool from Cyberon. Cyberon Corporation is a leading speech solution provider. Its speech recognition and text-to-speech technologies have been widely adopted by IoT devices, home appliances, wearable devices, smart toys, automotive equipment, and enterprise customers.
Open the Tool Cyberon website, the following screen will be shown:
Fill in the blanks with the required information and select the right board; read and accept the User License Agreement, and click on the "Next" button.
On the "Create New Project" square, select the language that better fits your application.
Type your Input Trigger Word. Take in mind the advice shown on the left chart to obtain a good model.
And follow the same process for your Command Word or words.
The last step will be to confirm the information for your model, your e-mail, language, board, and serial number. Confirm everything is ok.
Once finished, the website will confirm your model was sent to your e-mail.
You should receive four files:
- CybLicense_xxxxxxxxxx.h: this is the license that allows your board to use the speech recognition engine. You must know that this license is not transferable, which means that it will not work on other boards.
- Model_xxxxxxxxxx.h: this is the file containing the model information (your trigger and command words).
- Model_xxxxxxxxxx_Arduino_33ble.dsproj: this file contains the complete information of your project and could be used if you want to modify your project in the future. To modify your project, you must use the "Import Project File" option in step 2 when creating the model on the Cyberon website.
- Info_xxxxxxxxxx.txt: is a text file containing the information of your project, such as creation date and time, license type, language, board, serial number, Trigger word, and Command word (or words).
Now, open your Arduino IDE and go to File > New Sketch; save your new sketch. Copy and paste into the project folder all the four files you received by e-mail.
Copy and paste the code "FortuneCat" that you will find in the "Attachments" section in your sketch. Notice that you should see the additional tabs that match the.h file name of your license and your model.
It is important to include the header files, exactly the same name as the files you received (lines 6 and 7 in the following picture):
We included an extra header file, "images.h" to display our logo when starting up Fortune Cat. This is optional, but if you want to create your own introduction logo, this website may help: XBM File Creator. Remember to copy and paste this additional header file into the project folder, to prevent compilation errors.
Try writing your own phrases on the const char* selectPhrase() routine. Compile the sketch to verify there are no errors.
Connect the board with the OLED display this way:
Connect your board to your PC, select the right COM port, and select the board Arduino Nano 33 BLE Sense; upload the sketch to your Arduino Nano 33 BLE Sense board.
We used a 3D-printer to print our case. Below we share pictures of the drawings.
Once printed and all the things assembled, we've got this:
Here are some points to have in mind while testing the application:
- Speaking: pronunciation is really important. Ensure to speak loud and clear, and to say the complete word or words you use for trigger and command status.
- Waitingtime: since we are using a Free Trial, there are some limitations. Every time the application changes to the "trigger mode" status, it is necessary to wait for 20 seconds before speak aloud again the trigger word. Otherwise, it won't be detected.
- Recognitiontimes: since we are using a Free Trial, the application will be able to execute only 50 recognitions. For more information about Cyberon Licenses, you can reach the Arduino Store website.
1.- Power on your board, connecting the USB cable. You can use your PC as your power supply or any other 5V power supply.
2.- You will see the logo and "Fortune Cat" label on the screen. Wait until it changes to "Your future I can see... just ask". This is the moment when the speech recognition is waiting for the trigger word.
3.- Speak loud! "Fortune Cat" is our trigger word. If the text shown on the screen changes to "Yes?", it means the speech recognition is waiting for the command word. If not, try again.
4.- "Tell me my future" is the command word. Say it loud and clear. If recognized, your future is written on the screen. If not, try again.
5.- You can say "Tell me my future" as long as the screen does not show "Your future I can see... just ask" label again. Otherwise, you will need to repeat the steps 3 and 4, after waiting for 20 seconds.
Tell me my future!Now is your turn! Use your own tricky and funny future possibilities.
Happy spooky season! 🎃
From Electronic Cats.🐱🐈⬛
Comments