Mimic Monster

Version 2

    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.

    Before you begin, make sure you’ve followed through Intel® Edison Getting Started guide, and our previous tutorial, the Intel® Edison mini-breakout Getting Started Guide. This means that your Intel® Edison:

     

    Here is a video of the completed project.



     

     

    MimicMonster1.png

     

    has updated firmware

    is connected to the local wireless network

    can connect to ssh/scp through microUSB or WiFi

     

     

     

    Here is a list of items you’ll need to make this project:

    Intel® Edison and Arduino expansion board.

    1 Intel® Edison power supply

    1 Microphone

    1 USB sound card (with audio in and out connections)

     

    Material1.jpg

     

    1 Battery operated speaker with mini jack connector

    Nuts and bolts

    Spray glue or adhesive tape

     

    Material2.png

     

     

    Assemble the Mimic Monster

     

     

    Sort the lasercut pieces for easier construction.

     

    Step1 2.jpg

     

    Solder the electronics assembly per the schematic.

     

    Step2.png

     

    Attach Parts A7 and A8 to Part A1.

     

    Step3.jpg

     

    Attach color printout.

    Use spray adhesive or double sided tape to adhere the color printouts to Parts A1, A2, and A3.

     

    Step4.jpg

     

     

    Place buttons into designated holes on Part A1.

    Note: Make sure the order of the buttons matches that of the LEDs.

     

    Step5.jpg

     

    Place LEDs into designated holes on Part A1.

    Note: Make sure the order of the LEDs matches the of the buttons.

     

    Step6.jpg

     

    Attach the Arduino Expansion Board onto Part A4.

     

    Step7.jpg

     

    Connect sound components.

    Connect the sound card.

    Connect the microphone.

    Connect the speaker.

     

     

    Step8.jpg

     

     

     

    Attach the electronics assembly onto the Arduino Expansion Board.

     

    Step9.jpg

     

    Attach Parts A5 and A6 to Part A1.

     

     

     

    Slip the microphone through the top hole and the cables through the bottom hole.

     

    Step11.jpg

     

    Insert Parts A2 and A3 into Parts A7 and A8, using a rubberband to hold them in place.

     

    Step12.jpg

     

    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.

     

    Step13.jpg

     

    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.

     

    USB-Switch.jpg

     

    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”

    This command should install setuptool automatically for you.

    Download pyaudio, which is the Python library we will use for handling sound input/output. Type the following into the console:

     

     

    “wget http://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” to install it.

    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” to install it.

    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

     

     

    Type the following into the console:

     

     

    “python ~/Mimic.py”

     

     

    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.