Git Product home page Git Product logo

voice-controlled-lamp's Introduction

Voice controlled lamp

A voice controlled lamp using the continuous speech recognition engine julius and a ESP8266.

Hardware requirements

  • personal computer (your average workstation should be sufficient)
  • microphone
  • ESP8266 (preferably a developement board like the NodeMCU)
  • 5V relay module (those having externel circuitry onboard so they can be driven by a 3.3V signal)
  • lamp of your choice, I used 12V high power LEDs, please do yourself a favor and avoid mains!

Installation

First you need to clone this directory and install julius.

git clone https://github.com/julianschuler/Voice-controlled-lamp.git
cd Voice-controlled-lamp
git submodule update --init
sudo apt install build-essential zlib1g-dev libsdl2-dev libasound2-dev
cd julius
./configure --enable-words-int
make -j4

Now you need to download the english DNN language model and unzip it.

cd ..
wget https://sourceforge.net/projects/juliusmodels/files/ENVR-v5.4.Dnn.Bin.zip
unzip ENVR-v5.4.Dnn.Bin.zip

Optionally, you can now remove the zip archive, since it is not needed anymore.

rm ENVR-v5.4.Dnn.Bin.zip

Make the scripts executeable.

chmod +x mic-test.sh voice-control.py./mic-test.sh

Now, test if your microphone and the voice detection works by talking to the microphone after starting the script.

./mic-test.sh

To use the python script, the package pyjulius is needed, it can be installed using pip (setuptools is needed by pyjulius):

pip install setuptools 
pip install pyjulius

ESP8266 setup and wiring

Change STA_SSID and STA_PSK in the file lamp-code.ino to the WLAN credentials of your home network (important: The PC has to be connected to the same network) und save the modified file. Use the Arduino IDE and the ESP8266 core to upload it to the ESP8266. The relay module should have three pins on the input side, labeled "IN", "VCC" and "GND" or similar. Connect "IN" to GPIO14 (D5 for NodeMCU), "VCC" to 5V and "GND" to GND respectively. On the output side search for the normally open (NO) relay contacts, cut one of the power delivering wires of your lamp and hookup the contacts in between.

Usage

After everything is set up, execute the main script.

./voice-control.py

Wait a few seconds until the startup sequence is done, afterwards the lamp should turn on when saying lumos and off when saying nox. Note that the first input will be used for normalisation und thus always be discarded.

License

This project is licensed under the MIT license, see LICENSE.txt for further information.

voice-controlled-lamp's People

Contributors

julianschuler avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.