Git Product home page Git Product logo

pskowronek / home-air-quality-and-assistant Goto Github PK

View Code? Open in Web Editor NEW
4.0 2.0 1.0 4.09 MB

Home Air Quality monitor and Voice Assistant running on Raspberry Pi zero

License: Apache License 2.0

Shell 29.27% Python 21.19% Makefile 0.22% HTML 7.05% CSS 20.93% JavaScript 21.35%
raspberry-pi lcd-display brightness-control wttrin pocketsphinx voice-assistant pms5003 pms7003 air-quality humidity-sensor

home-air-quality-and-assistant's Introduction

Language versions:
EN PL DE FR ES

Home Air Quality plus Voice Assistant Build Status

This project is a result of Covid-19 lockdown :) Some references you can find on top of the final assembly (like the police hunting people going outside :>). Basically, the project is to display in-door air quality metrics plus to give you a possibility to interact with the device using voice, akin to Alexa or Google Home - but offline :)

I'm not saying that it is any better than Alexa or Google Home - it isn't, but it is DIY :) The language model is very simple, the CPU of Raspberry Pi Zero ain't a king - it does what it can to understand the voice. The most important factor is a quality of USB soundcard and microphone.

So, to recap - I've started with a simple monitoring tool to display indoor air quality using PMS5003ST or PMS7003 sensors and Raspberry Pi Zero with Waveshare 3.5inch display... then things started to evolve :)

Finally the project includes three modules (services): visualizer, brightness and assistant.

BTW, it was a quite nice journey through electronics & soldering, bash scripting on beloved Linux, plus java (pm-home-station) & python.

Visualizer

To visualize the sensor's air quality readings I used this project that I'm also a co-author: pm-home-station. It uses alpha build that supports small displays, Kiosk mode and PMS5003ST sensor that is able to measure formaldehyde concentration, humidity and temperature on top of pm2.5 and pm10 particles.

The visualizer displays:

  • PM 1.0/2.5/10 readings + charts (PMS7003 and PMS5003ST)
  • formaldehyde, humidity & temperature readings + charts (PMS5003ST)

Brightness

To control Waveshare 3.5" display brightness I wrote a simple script to constantly adjust the brightness based on light sensor readings. The only trouble was that this LCD display does not support this functionality OOB :) See project's wiki how I hacked my way to add this functionality.

Assistant

To display more information on this device I integrated a simple voice controlled assistant. It works offline even on RPi thanks to PocketSphinx.

Currently the assistant can be used to do the following things:

  • show weather and Moon details (thanks to wttr.in - awesome project btw)
  • tell some old jokes (using 'fortune' linux command)
  • display stocks value
  • display uptime
  • initiate reboot

The assistant itself can be easily reconfigured to understand additional commands - one must edit config.yaml and specialized bash scripts can be written to execute those commands. A default configuration tries to react for two invocation sentences: Hey Cybill and Hey Bruce (we've got their posters on the wall behind, hence the idea for invocation words). This can also be easily reconfigured. Each of the invocation words can have their voice adjusted, for example Cybill answers with a female voice, whereas Bruce with a male voice.

Some sample commands that are available out of the box:

  • Hey Bruce (...wait for ack sound...) what is the weather like?
  • Hey Cybill (...) what is the weather tomorrow?
  • Hey Bruce (...) how is the Moon today?
  • Hey Cybill (...) show my stocks
  • Hey Bruce (...) show me calendar
  • Hey Cybill (...) tell me a joke
  • Hey Bruce (...) show me uptime
  • Hey Cybill (...) reboot now

Of course voice recognition isn't perfect - a lot depends on soundcard & mike quality. Also, there are a lot of false positives for the invocation words (it wakes up while somebody is talking) - WiP :)

Screenshots / Photos

Screenshots

Some animated screenshots how it works when interacting with voice commands:

Screenshots

Photos

Assembled

More photos of how it was enclosed in a custom-built LEGO™ housing are here.

BTW, these LEGO bricks are almost 30 years old (!)

Hardware Requirements

See wiki -> Hardware Requirements page.

Installation

See wiki -> Installation page.

Tech details

See wiki -> Scheme page.

License

This project is covered by Apache 2 license.

Authors

home-air-quality-and-assistant's People

Contributors

pskowronek avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

vman45

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.