Giter Site home page Giter Site logo

himalayanelixir / alexa-pi-furniture-control Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 2.04 MB

๐ŸŽค Use Alexa & Raspberry Pi to control convertible furniture

License: MIT License

Python 100.00%
alexa raspberry-pi motor-controller furniture

alexa-pi-furniture-control's Introduction

Alexa Pi Furniture Control

Summary

This demo moves convertible furniture up and down using Alexa, a Raspberry Pi, and a motor driver. With a few small modifications you could control anything using GPIO on the Raspberry Pi.

Diagram

Entire system

Setup

Alexa

Use skills JSON in alexa/ to create skills for your use case. Endpoints should be the ones from ngrok.

ngrok

Use ngrok to serve as a message passer between the Alexa service and the Raspberry Pi.

You will need to subscribe to get reserved endpoint addresses. Follow the instructions on the website to setup the endpoints, and to connect it to the Raspberry Pi.

Raspberry Pi

This is an extremely manual process because I was in a rush when I initially wrote this up. It can be put into a simple bash script to run on firstboot. Sorry.

sudo apt-get update -y && sudo apt-get upgrade -y
sudo apt-get install rpi.gpio -y
sudo apt-get install python3-pip -y
wget -q https://raw.githubusercontent.com/himalayanelixir/alexa-pi-furniture-control/master/raspberry-pi/requirements.txt /home/pi/
pip3 install -r /home/pi/requirements.txt
wget https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-arm.zip
unzip /path/to/ngrok.zip
./ngrok authtoken <YOUR_AUTH_TOKEN>
# change port depending on what you setup flask-ask with
./ngrok http 80 (other port)
# create services (copied and pasted from raspberry-pi/services/)
sudo nano /etc/systemd/system/alexamotor.service
sudo nano /etc/systemd/system/ngrok.service
sudo systemctl start alexamotor.service
sudo systemctl enable alexamotor.service
sudo systemctl start ngrok.service
sudo systemctl enable ngrok.service
sudo systemctl daemon-reload
# make sure services are enabled
sudo systemctl list-unit-files | grep enabled
wget -q https://raw.githubusercontent.com/himalayanelixir/alexa-pi-furniture-control/master/raspberry-pi/motor_control.py /home/pi/
sudo chmod +x /home/pi/motor-control.py

Motor Driver

To control the furniture you will just need a driver to communicate with from the Raspberry Pi to the motor. I used a simple Pololu G2 High-Power Motor Driver 24v13. If you are using a different one, just modify the GPIO pins that are turned on and off in raspberry-pi/motor-control.py.

Example

Got this code working with a convertible bed. The full video can be found here: https://youtu.be/vljLdq9bu4k.

alexa-pi-furniture-control's People

Contributors

himalayanelixir avatar

Watchers

 avatar

alexa-pi-furniture-control's Issues

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.