Giter VIP home page Giter VIP logo

smartlight's Introduction

SmartLight

This project takes place as part of our lecture "Integrationsseminar" at DHBW Mannheim.

The Team Members of this Project are:

  • Ann-Kathrin Kälberer
  • Canberk Alkan
  • Dominic Viola

Matriculation numbers in no specific order: 3275561, 1044258, 5799502

Description

This project focuses on the creation of a light alarm clock. It will integrate with pre-existing devices like a smartphone with a alarm clock capability. The purpose of the light alarm clock is to wake users naturally by first using ambient light and then ringing the alarm.

The alarm clock functionality is applicable via two different applications. If you are using an iPhone the idea was to use the app "Shortcuts" (z. Dt. Kurzbefehle) for the alarm clock implementation. Another way of accessing the clock is via the web. So both Apple and Android devices are capable of using this functionality. For the web application any browser can be used.

The following list consists of the used tools to realize this platform.

  • Raspberry Pi 4
  • LED strip
  • Adapter
  • Power supply
  • Jumper
  • Plug-in board

The following software packages were used:

  • Raspberry Pi OS -> Operating System of the Raspberry Pi 4. Used for development environment to directly communicate with the Raspberry Pi.
  • Python -> This programming language is used to implement the logic for the GPIO Pins
  • Flask -> Is used for the backend programming of the web server
  • Shortcuts -> Is used to have an implementation of this platform in the form of a smartphone app (Apple devices only)

To measure the performance of the platform, functional and non-functional requirements were defined.

Functional Requirements Non-Functional Requirements
At a defined time, the light should turn on Usability / Functionality
Turn on/off the light Effectiveness (Brightness of the light)
Set alarm clock time Extensibility (Set many different alarms)
Control via smartphone Security

Tasks can be devided in

  • Flask Webserver implementation: Ann-Kathrin Kälberer, Dominic Viola
  • Logic of LED and GPIO Pins: Dominic Viola, Canberk Alkan
  • Presentation and Documentation: Canberk Alkan

Implementation

We use a Raspberry Pi 4 to controll a LED strip. (Any other Raspberry Pi model or an Arduino would also work, if you install a network antenna.) The Raspberry Pi hosts a REST API Server that exposes controlls for the LED Strip to the LAN.

The alarm clock application of a Smartphone will serve as a trigger, that sends an HTTP request to the REST server.

architecture

Developer Notes

Folders and Files

  1. Folder: Smart Light

Contains the flask webserver app.py, that also exposes a REST API to set alarms through POST requests. It also contains the database wecker.db that stores alarms persistently. The logic to control the LED strip through the Raspberry Pi's GPIO pins is implemented in the file led.py.

NOTE: You should change the line rgb_pins = (17, 22, 24) to the R, G, B GPIO-Pins that you connect your LED strip to.

  1. File: Wecker.shortcut

This file can be imported to Apple iPhone and iPad to use it with the Shortcuts app. Just download the file to one of those devices and open it. It will enable you to set your devices alarm clock to a specific time and it will also send a HTTP request to the API Server. Your devices alarm will ring together with the light alarm.

NOTE: You need to change the IP-address inside the shortcut to the IP-address of the Raspberry Pi in your local network. (Run $ifconfig on your Raspberry Pi to get the IP-address.)

  1. Folder: Backend

The files to setup and modify a Flask REST server with user authentification.

The subfolder /backend/scripts contains python scripts that help to debug the API server.

The assets folder is meant for pictures and other materials that are included in this README.

NOTE: This server is not used. We didn't integrate it into the main server, because the functional requirements had higher priority.


Setup for the backend

Install the dependencies:

pip install -r requirements.txt

Start the server:

python smart_light/app.py

This should start the server that serves the website, control the LED strip, handle database interactions and check the database regularly for alarms that should be triggered.

smartlight's People

Contributors

akk-dhbw avatar patchframework avatar

Stargazers

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