Giter Site home page Giter Site logo

nightlightpi's Introduction

Night Light Pi - An MQTT enabled, temperature sensing night light for the Raspberry Pi

This project was created in order to replicate commercially available night light products which change colour based on the temperature, but with the added functionality of being able to report the sensor data to remote locations. The lightweight MQTT protocol has been used to achieve this aim along with APA102 neopixels which can easily be run from a Raspberry Pi.

Night Light House Example

An example of an enclosure to make a night light. This was re-purposed from a christmas decoration form a supermarket which had a battery powered tea light in it.

Hardware

In my setup I use the following:

  • Raspberry Pi Zero with USB Wifi Dongle (you could just use a Raspberry Pi Zero W)
  • Strip of 10 APA102 RGB LEDs
  • DHT22 or AM2302 Temperature and Humidity sensor
  • SSD1306 OLED Display
  • 74AHCT125 or 74AHC125 level shifter
  • 2 momentary push to make buttons

I have also used a ProtoZero board to keep all the soldering and connections neat.

Night Light House Insides

The pin outs on the Raspberry Pi GPIO are as follows:

  • The APA102 strip is connected to the Raspberry Pi via the level shifter as per the instructions in the APA102_Pi library (pins 10 (MOSI) and 11 (SCLK)). Power-wise I calculated that with only 10 LEDs there would be enough available to power the strip, but this needs checking for your setup - this page from Adafruit is useful.
  • The DHT22 data pin is connected to Pi pin 22.
  • The OLED is connected with SDA to Pi pin 2 and SCL to Pi pin 3.
  • The two buttons use pins 23 and 24 with their other side connected to GND.

License

Distributed under the MIT license. See LICENSE for more information.

Contributing

I'd love for this project to be expanded and improved - in particular the code was started as somewhat of a hack and could do with some proper clean up and refactoring!

  1. Fork it (https://github.com/jmb/NightLightPi/fork)
  2. Create your feature branch (git checkout -b feature/fooBar)
  3. Commit your changes (git commit -am 'Add some fooBar')
  4. Push to the branch (git push origin feature/fooBar)
  5. Create a new Pull Request

nightlightpi's People

Contributors

jmb 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.