Adding voice recognition
Now that your robot is mobile, it is time to allow your robot to speak and respond to voice commands as well. This will make your R2D2 more interactive. To do this, you'll need to add some hardware. This project requires a USB microphone and a speaker adapter. The Raspberry Pi has an audio output, but does not have an audio input, so you'll need the following three pieces of hardware:
A USB device that supports microphone in and speaker out:
A microphone that can plug into the USB device:
A powered speaker that can plug into the USB device. In particular, you'll want one that has an internal battery that can connect to a USB port for charging, like this:
Fortunately, these devices are very inexpensive and widely available.
Tip
Make sure the speaker is powered because your board will generally not be able to drive a passive speaker with enough power for your applications.
Now, on to allowing the Raspberry Pi access to these devices. You can execute all of the following...