Hi, I am attempting to create a voice activated baby swing, but I'm having an error with the Speak Up click. First, the speak up Click doesnt process my commands right away. Takes me a few tries till it reads my command.
Second, once it does catch the command it doesn't process the code that i set up to read?
Is there any advice you can give me?
Attached is a photo of my wiring. Im using a Elegoo mega2560
Whatever you used to test the motors standalone. From the serial output it looks like the voice command was recognized, so the issue is that the motors don't run. I'm suggesting that for debugging purposes you try the old code that you know works to figure out whether your wiring/power are still ok.
When i use this code the big motor spins
//L293D
//Swing Motor (Big motor)
const int motorPin1 = 5; // Pin 14 of L293
const int motorPin2 = 6; // Pin 10 of L293
//Toy Motor (Small Motor)
const int motorPin3 = 10; // Pin 7 of L293
const int motorPin4 = 9; // Pin 2 of L293
//This will run only one time.
void setup(){
//Set pins as outputs
pinMode(motorPin1, OUTPUT);
pinMode(motorPin2, OUTPUT);
pinMode(motorPin3, OUTPUT);
pinMode(motorPin4, OUTPUT);
//Motor Control - Motor A: motorPin1,motorpin2 & Motor B: motorpin3,motorpin4
//This code will turn Motor A clockwise for 2 sec.
digitalWrite(motorPin1, HIGH);
digitalWrite(motorPin2, LOW);
digitalWrite(motorPin3, LOW);
digitalWrite(motorPin4, LOW);
delay(10000);
Is it possible you can figure it out from the photo of my wiring.
Also, now it keeps reading different commands. Like if I say toys off, it says power off
Try putting that in your "Swing on" section. Right now, you have it the other way round.
As to the commands being wrong, I suspect it's because voice recognition is hard and thirty bucks doesn't get you much. It hears "something off" and struggles to tell whether that something was toys or power. You may want to consider changing the command set to use phrases that are more different.
The high low doesn't matter it just controls the direction of clockwise or counterclockwise. But i have seen many videos where they use similar commands and it processes it. But it takes commands that don't even sound alike and switches them.
My point is that the motor isn't working and you need to figure out why. I would use the working code to try and eliminate possible causes.
The voice recognition is a separate issue: it may be that it has trouble with your accent. Perhaps there's background noise (I assume that there's a baby around) or you're not facing the microphone.
Also, I wouldn't be surprised to learn that the videos you saw were each the best of fifteen attempts. If Alexa, with her millions of dollars worth of cloud computers, AI and machine learning algorithms can't understand me, I don't expect that little thing to be foolproof.
It depends. If you intend to use this with an actual baby, you may want to think about whether it's reasonable to use VR at all - it just isn't all that reliable. An IR remote might be a better choice.
If you're building something for fun or as a demo for school, it looks like the VR works some of the time and commands get through to the Arduino. So you need to spend some quality time debugging to find out why the motor doesn't spin up. Divide and conquer would be a useful way to go there. But it will never be flawless - you could find that the best thing you can do is to train yourself to speak more clearly when giving commands.
There are Arduino projects on-line using Alexa as the VR component and I expect there's stuff for the Google version too. Those would likely get you better accuracy, but I still expect you'll find yourself repeating what you said, sometimes multiple times. I certainly did before I turned Alexa off.
Whatever route you choose, there's going to be debugging though. If you're expecting it to be plug and play, I suspect you'll be disappointed.
I know it won't be like that. Its just for my senior project. And its all online so i need just one video of it all working and thats all
What option would you say is my best bet?