Alexa Ohbot

Introduction: Alexa Ohbot

About: STEM Ambassador, retired software developer, now teaching kids to code, play with Arduinos, Raspberry Pis and build robots at CodeClub, CoderDojo and after-school clubs.

In this tutorial I will show how to combine the abilities Amazon Alexa with the amazing Ohbot,robot head (http://www.ohbot.co.uk/?lang=en)

In a conversation with Alexa, the Ohbot's lips appear to move in sync with the replies from Alexa.

Alexa-Pi is a client for Amazon's Alexa service. It is intended and tested to run on a wide range of platforms, such as Raspberry Pi. The installation instructions can be found here: https://github.com/alexa-pi/AlexaPi/wiki/Installation

You might like to view this video, which helped me, on setting up Alexa on a Raspberry Pi: https://www.youtube.com/watch?v=frH9HaQTFL8

What you will need:

1. An Ohbot, robot head.

2. A power supply for the Ohbot Arduino. I used a 9v battery with a 2.1mm plug for the Arduino breakout board at base of head.

3. An Arduino Uno, nano or pro-mini - most types should work.

4. A power supply for the Arduino Uno. I used a spare USB port from Raspberry Pi.

5. A Raspberry Pi (all models with an audio output jack should work), with an SD card loaded with the latest linux release. (I used Raspbian Jessie Pixel: https://www.raspberrypi.org/blog/introducing-pixel/)

6. A USB microphone, I found one here: http://www.ebay.co.uk/itm/Super-Mini-USB-2-0-Microphone-MIC-Audio-Adapter-for-PC-Notebook-Laptop-UK-/192039338258

7. A mini breadboard or vero board.

8. 1 x 100 nanofarad capacitor

9. 2 x 100k Ohm resistors

10. A 3.5mm headphone plug (I re-used one from some broken earbuds)

11. A 3.5mm headphone jack

12. Some wires and headers to connect it all up

Step 1: Build Instructions

Steps:

1. Install Alexa-Pi on Raspberry Pi. (https://github.com/alexa-pi/AlexaPi/wiki/Installation). Once installed and running, check that Alexa says 'Hello', then shutdown the Pi until step 10 below.

2. Construct a Analog to Digital listener circuit - see attached circuit diagram. This, rather crudely, converts the analog signal from the headphone jack to a digital one the Arduino Uno can process. The audio signal is also passed straight through to an output jack so that you can plug in your headphones or an amplifier and loudspeaker.

3. Download and unzip the Ohbot_Alexa.zip file and upload Ohbot_Alexa.ino to the Arduino Uno. This code contains some references to ug8lib, because I was using an OLED display for debugging - this part of the code is not required and can be commented-out.

4. Add all the connections as per the Fritzing diagram. The Arduino Uno to Ohbot Arduino connection is serial at 19200 baud, using just 3 wires, GND, TX and RX. The RX on one end goes to the TX of the other and vice-versa. The junction of the capacitor and the two resistors goes to the Arduino Uno's A0 pin. The breadboard or vero board is supplied with +5v and GND from the Arduinio Uno. The other side of the capacitor is fed from either the left or right channel from the audio output from the Raspberry Pi. All GNDs are connected together.

5. Plug in the 3.5mm plug into the Pi audio jack

6. Plug in your headphones into the 3.5mm jack from the breadboard or vero board. Better still use a amplifier and loudspeakers, and mount them behind the Ohbot.

7. Plug in the power to the Ohbot.

8. Connect the Raspberry Pi to the internet via a WiFi dongle or the Ethernet socket

9. Plug in the USB cable from the Arduino Uno to a spare USB socket on the Pi.

10. Power-up the Raspberry Pi.

11. Press the reset button on the Arduino break-out board at the base of the Ohbot. This will initialise the Ohbot software and trigger the Arduino Uno's script to be ready.

12. Start Alexa Pi on the Raspberry Pi and when Alexa says 'Hello', the Ohbot's lips should move.

13. If the Ohbot's lips do not move, check your wiring and press the reset button on the Arduino Uno, then the reset button the Arduino break-out board at the base of the Ohbot.

A video of this setup working can be found on YouTube here: https://www.youtube.com/watch?v=nr1kEribFGU

Robotics Contest 2017

Participated in the
Robotics Contest 2017

Be the First to Share

    Recommendations

    • Battery Powered Contest

      Battery Powered Contest
    • Plywood Challenge

      Plywood Challenge
    • Plastic Contest

      Plastic Contest

    10 Discussions

    0
    Rivermonkey1
    Rivermonkey1

    3 months ago

    Hi Martyn,
    Thanks for the reply, I'm using the python version. I was wondering how to make a listener circuit, that uses speech output via speaker jack from an echo dot instead of the
    Rasp. Pi which connects to listener circuit, then finally to ohbrain to activate the ohbot to make it speak?
    Is that possible? Thanks again.
    Regards Simon.

    0
    raspberrypieman
    raspberrypieman

    Reply 3 months ago

    Simon, in theory, it should be possible to do something similar with an audio jack from another device. However, I don't have an Echo dot and do not know the interior circuitry and voltages so I would urge caution especially if it is mains powered, both for your safety and the safety of your Echo dot and Raspberry Pi. I would probably use an opto-isolator circuit that prevents DC connection but allows AC (audio) through. It might be worth tackling this from another angle, I know the Windows Ohbot version has a way to send questions in text to Wikipedia and get the Ohbot to 'speak' the answers. I have used this in exhibitions. There might be an equivalent in the Python version. Have a hunt around in http://community.ohbot.co.uk
    Martyn

    0
    Rivermonkey1
    Rivermonkey1

    Reply 3 months ago

    Thanks Martyn

    0
    Rivermonkey1
    Rivermonkey1

    Question 3 months ago on Step 1

    Hi again, thanks for you help previously. Can I ask where I can download Ohbot_Alexa.zip and Ohbot_Alexa.ino as I couldn't find it on the post. Also is possible to show a link to the ohbot Arduino breakout board as I couldn't find one. The ohbot uses the ohbrain and was wondering if the breakout board had been replaced with this. Is there a way to connect it. Sorry as I'm a noob to this. Regards

    0
    raspberrypieman
    raspberrypieman

    Answer 3 months ago

    Simon,
    My Ohbot is an earlier version which uses an Ardunio Nano to drive the servos directly. I had not heard about the Ohbrain until your post, but from what I have learned, the board can be used either with Ohbot graphical
    programming language for Windows or Python on a
    Raspberry Pi. To try to help you more, please let me know which version you have?
    Martyn

    0
    Rivermonkey1
    Rivermonkey1

    Reply 3 months ago

    Hi Martyn,
    Thanks for the reply, I'm using the python version. I was wondering how to make a listener circuit, that uses speech output via speaker jack from an echo dot instead of the
    Rasp. Pi which connects to listener circuit, then finally to ohbrain to activate the ohbot to make it speak?
    Is that possible? Thanks again.
    Regards Simon.

    0
    raspberrypieman
    raspberrypieman

    Reply 3 months ago

    Simon,
    It should be possible to tap into the output from the Echo dot, but I don't have one and have no idea what the voltage is. I would not like to advise you on this and you need to be careful if it is mains. Also when you connect to another device you have to take care to protect your equipment at both ends. This would probably involve using an opto-isolator to isolate the Echo dot circuit from the Raspberry PI and Ohbrain, at at DC level, but allowing the AC audio to pass through.
    On another tack, in the Windows version, there is a way to get the Ohbot to 'speak' answers, sent back from Wikipedia, from questions sent in text. I don't know if there is a version of this for the Python/Raspberry pi version of the Ohbot.
    I would recommend http://community.ohbot.co.uk/Explore/About and failing that try emailing info@ohbot.co.uk direct
    Regards, Martyn

    0
    Rivermonkey1
    Rivermonkey1

    Question 3 months ago on Introduction

    Hi, great project btw. I'm a beginner hobbyist, can I ask about the capacitor and resistor? I'm trying to order parts and looking at eBay to find them, I found some but they seem to vary, example I found 100 nf capacitor (100v) on eBay and a 100k ohm resistor (2 watts) there are lots of variations to the watts and volts so I'm not sure what I need? Can you clarify the correct wattage is for the resistor and volts for the capacitor that you used please? Thanks very much.

    0
    raspberrypieman
    raspberrypieman

    Answer 3 months ago

    Hi Rivermonkey1, the circuit is very low voltage, 5v max for both components. It is very low current, as its just the signal from the audio jack, 2 watts would do but you only need, say, 1/4 watt resistors, something like these: www.ebay.co.uk/itm/100-x-Resistors-100K-Ohms-OHM-1...

    0
    Rivermonkey1
    Rivermonkey1

    Reply 3 months ago

    Thanks for the reply!! Kind regards Simon