element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
    About the element14 Community
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      •  Vietnam
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Pi Chef Design Challenge
  • Challenges & Projects
  • Design Challenges
  • Pi Chef Design Challenge
  • More
  • Cancel
Pi Chef Design Challenge
Blog Cracked pepper sir? (Voice recognition) Pi Chef Challenge Blog post #2
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Events
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: crackedpepper
  • Date Created: 21 Jan 2018 7:47 AM Date Created
  • Views 818 views
  • Likes 8 likes
  • Comments 5 comments
Related
Recommended

Cracked pepper sir? (Voice recognition) Pi Chef Challenge Blog post #2

crackedpepper
crackedpepper
21 Jan 2018

Package arrival!

 

On Friday I received my challenger kit (massive thanks to Element 14 and Raspberry pi foundation).

 

image

 

imageimage

 

I really love the carry bag that came with it image

 

Voice recognition

 

This week i got started on implementing the voice recognition portion of my project. I started this before my challenger kit arrived so i began using the pi i had previously dedicated to running emulation station. Naturally the first step was a clean install of the latest Raspbian image.

 

The devices i started using were an old usb webcam for a mic and a broken bluetooth speaker connected via the 3.5mm audio jack (only the bluetooth is broken).

image

 

I then started looking at what voice recognition software was available for the pi.

 

The following is a list of software I considered:

  • PiAUISuite (by StevenHickson)
  • Jasper
  • Alexa
  • Google assistant

 

I did a bit of reading about each of them. The PiAUISuite uses the google voice api under the hood and the project has been stagnant on GitHub for a while now so decided not too jump into that. The Jasper software looks very promising and i think i may well come back to that as it runs offline (does take up a lot of space though).

 

I installed the Alexa suite and got it up and running, this required me to create an AWS developer account and do the standard OAuth config stuff. The actual installation process was incredibly simple and pretty much consisted of running the script and configuring you user details. I was quite happy with how Alexa ran but examples of interacting with the code were limited at best and everything pushed quite heavily towards custom code being ran as skills on the AWS system. Alexa runs as a node process and the sample app is written in Java. While i could conform to this and run custom code on the Pi i would have to either create a web interface on the pi and push commands from AWS or i would have to poll a message queue on the AWS servers. I didn't like the idea of either of these so i decided to move on and have a play with google assistant.

 

The google assistant installation process was pretty similar again requiring the creation of a developer account for google cloud. The instructions for the install process are in the HACKING.md file and the account setup instructions can be found here , the standard (non hacking) install process assumes you are using this kit and so the device setup was not correct. I made a small change to the install scripts as i wasn't using the directory structure they had listed the diff can be seen in this commit.

 

I had to modify the boot configuration after installing everything (/boot/config.txt)

# Enable audio (loads snd_bcm2835)

dtparam=audio=on

#dtoverlay=i2s-mmap

#dtoverlay=googlevoicehat-soundcard

And i had to reconfigure alsa after the installation this question on super user should give you the details of doing this.

 

All in all it was a pretty simple process. Once you have got everything setup and running you can run the google assistant sample by running the following commands.

source env/bin/activate

googlesamples-assistant-hotword --project_id your_project_id --device_model_id "The Model Id you assigned"

 

Once I ran the standard sample and was satisfied it worked I moved onto running custom code. I started by modifying the assistant_grpc_demo.py I added a code block that triggers when the voice command contains "cracked pepper" (my initial changes can be found here). I then went on to add sound output when the command text doesn't contain "cracked pepper". For the audio output i used the pygame library the updated version can be found here. When i initially added the sound output it caused a lot of static to be played though the speaker i fixed this by adding the following line to the boot config

audio_pwm_mode=2

 

Finally here is a short video of the final python script in action (apologies for the quality I filmed it with a potato while underwater....)

  • Sign in to reply

Top Comments

  • genebren
    genebren over 8 years ago +1
    Adrian, Excellent! Coming along nicely. I like the butler/server voice that you are using. Not sure that I understand the 'potato while underwater' disclaimer, but it did make me smile. Good luck, keep…
  • DAB
    DAB over 8 years ago +1
    Nice start. I like a good reuse of older equipment. DAB
  • e14phil
    e14phil over 8 years ago +1
    Great! What a quick start! I am really looking forward to this project.
  • crackedpepper
    crackedpepper over 8 years ago in reply to bernhardmayer

    I was pleasantly surprised how easy they were to get up and running. Hopefully I've provided enough info so the process is easy to reproduce image

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • bernhardmayer
    bernhardmayer over 8 years ago

    Thanks for the nice introduction into state-of-the-art voice recognition systems.

    Bernhard

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • e14phil
    e14phil over 8 years ago

    Great! What a quick start! I am really looking forward to this project.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • DAB
    DAB over 8 years ago

    Nice start.

     

    I like a good reuse of older equipment.

     

    DAB

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
  • genebren
    genebren over 8 years ago

    Adrian,

    Excellent! Coming along nicely.  I like the butler/server voice that you are using. Not sure that I understand the 'potato while underwater' disclaimer, but it did make me smile.

    Good luck, keep up the good work!

    Gene

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2026 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube