Grawr! It’s a mimic monster! What did you say? Grawr! It’s the mimic monster!
Having landed on Earth, this little alien needs you to teach it how to speak. Speak into its audio antenna and it will repeat your words back. Press a button and change its pitch.In this tutorial, you will learn in more detail, how to work with a USB sound card, a microphone, and a speaker.
This means that your Intel® Edison:
- has updated firmware
- is connected to the local wireless network
- can connect to ssh/scp through microUSB or WiFi
Here is a video of the completed project.
This tutorial was originally published on Intel Communities here.
Step 1: Needed Components
- Intel® Edison and Arduino expansion board
- 1 Intel® Edison power supply
- 1 Microphone 1 USB sound card (with audio in and out connections)
- 1 Battery operated speaker with mini jack connector
- Nuts and bolts
- Spray glue or adhesive tape
Step 2: Sort the Lasercut Pieces for Easier Construction
Sort the pieces according to the image.
Step 3: Solder the Electronics
Step 4: Assembly
- Attach Parts A7 and A8 to Part A1
- Attach color printout
- Use spray adhesive or double sided tape to adhere the color printouts to Parts A1, A2, and A3
- Place buttons into designated holes on Part A1
- Note: Make sure the order of the buttons matches that of the LEDs
- Place LEDs into designated holes on Part A1
- Note: Make sure the order of the LEDs matches the of the buttons
- Attach the Arduino Expansion Board onto Part A4
- Connect sound components
- Connect the sound card
- Connect the microphone
- Connect the speaker
- Attach the electronics assembly onto the Arduino Expansion Board
- Attach Parts A5 and A6 to Part A1
- Slip the microphone through the top hole and the cables through the bottom hole
- Insert Parts A2 and A3 into Parts A7 and A8, using a rubberband to hold them in place
- Attach Part A4 to close the assembly, being careful of the wires
Note: It is best to test the electronics prior to closing to ensure that the connections are correct.
Step 5: Configure the Sound Card
If you have the latest system image for Intel® Edison, chances are you won’t need to install any drivers for the sound card. Plug in the USB sound card and move the switch towards it. If you haven’t plugged in a power source, make sure you do it before moving the switch. Otherwise, the Intel® Edison will not power up.
Use the utility alsamixer to check if the sound card is working properly and to control the volume.
Type “alsamixer” in console to bring up the interface. Press F6 and choose the sound card. In our case, it’s C-Media USB Headphone Set. Set the volume low for your output so it isn’t too loud. You will need to adjust this to find the right volume. Install python libraries.
Update setuptools, which is a Python utility for installing new packages. Make sure you have internet access and type the following into the console:
wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py -O - | python
Download pyaudio, which is the Python library we will use for handling sound input/output. Type the following into the console:
wget people.csail.mit.edu/hubert/pyaudio/packages/pyaudio-0.2.8.tar.gz -o ./pyaudio.tar.gz
Unzip it by typing into the console:
tar -x pyaudio.tar.gz
Install pyaudio. Navigate into the folder of pyaudio and type the following into the console:
python setup.py install
Install portaudio, which is the Linux utility for working with audio devices. Type the following into the console:
opkg install libportaudio2
Install numpy, which is a Python library for working with data. It is needed for the actual process of audio manipulation. Type the following into the console:
opkg install python-numpy
Move script to Intel® Edison
Download the python script from the attachment, and copy it over to Intel® Edison with scp.
Type the following into the console:
scp Mimic.py root@your-edison-ip:~/
Start the Mimic Monster code typing in the console:
Speak clearly and loudly into the microphone. The Mimic Monster will repeat your words in a funny voice depending on the preset button you pick.