MathSweeter

I wanted to do something with Voice-Recognition on the Raspberry Pi. And i had this issue with learning math and training which was always a pain for me and my kids – both sides i gues…

So what would be more obvious than a sweet dispenser controlled by the PI that only gives sweets after successful completion of some math-questions? Here you go:

The Voice-Recognition works with Sphinx, an Open Source Toolkit for Speech Recognition that is supported by the PI quite well. I would not say it is easy to set-up and configure, but finally it worked – even with python (you have to compile it yourself and if you take care it will compile the python module automatically as well). Like always with open-source tools it’s quite a hazzle to really get it up and running and doing what you want it to do. So i had to create my own dictionary, figure out some weird stuff about phonetic translation etc. but i won’t complain, finally it worked. Sphinx especially seems to be ok for a closed vocabulary scenario where the Computer has to work on a limited set of sentences like “shut down light in kitchen” etc. – all my tries with open speech recognition were somewhat dissapointing, but i also cannot say that i tried the maximum… It’s interesting to note that you will find a couple of easy looking examples on the Google Speech API which all didn’t really work for me – because Google does not really want to have developers working with this and they are constantly changing it or shutting it down for external access etc. – which is quite a pity as the Google Speech-Recognition is really awesome and by far better than what you can get with Sphinx…

For the Sweeting-Part i ordered a simple Sweet-Dispenser from amazon which you can find here. The good thing about it (besides the really ok quality as such and the good price) is that it is already electronically powered, both for the extraction of sweets and for the recognition part. So you only have to hack the PI into it. After a few tries i decided to just take the 3.3v from the LED of the sweeter and connect it with the PI so that he can recognize someone holding his/her hand under. And i obviously interrupted the power-source of the motor and connected it to a simple Relay-switch from Sainsmart which you can find in many places (also on Sparkfun and Adafruit etc.).

A little python program is listening on the LED-power (which is triggered by a distance sensor already built in) and triggers the main python program. This one uses the pocketsphinx-python-library to translate the answers and espeak to say something. My kids are loving it.

 

 

About holadiho

stephannoller.eu
This entry was posted in Allgemein and tagged , . Bookmark the permalink.

1 Response to MathSweeter

  1. Pingback: Spark Core switching a Mosfet | Making connected stuff

Leave a comment