Giter Club home page Giter Club logo

robipozzi-raspberry-sensors's Introduction

Raspberry sensors project

Introduction

The concept of this project is to use sensors connected to a Raspberry Pi board and continuously get, visualize and manage data from the sensors.

Initially, a DHT11 sensor is used to get Temperature and Humidity data points.

Architecture

The overall architecture design is very simple: a Python program runs on a Raspberry board, reads data from a sensor and continuously sends sensor data to a Kafka topic. A web server, implemented in Node.js, consumes data from the Kafka topic and continuously updates a UI via Web Socket.

The logical architecture is sketched below

These are the macro activities and steps to take to actually implement this logical architecture:

  1. Connect DHT11 sensor to Raspberry Pi board.
  2. Deploy a Kafka cluster (the code in this repository assumes OpenShift as the target infrastructure).
  3. Get the TLS certificate from Kafka and generate PEM files to securely connect to Kafka.
  4. Deploy Python program to Raspberry Pi.
  5. Deploy Node.js server to run Home Automation UI component.

Part 1

In this first part we will concentrate on Kafka setup and how to send data from Raspberry Pi to a Kafka cluster using a Python program; we will go through the following steps:

  • Deploy a Kafka cluster, using Red Hat AMQ Streams Operator available on Red Hat Openshift;
  • Get the TLS certificate from Kafka and generate PEM files to securely connect to Kafka;
  • Deploy a Python program to Raspberry Pi to send data to Kafka (data will be simulated, then in a future article we will build on this and get real data from DHT11).

Go Here for instructions.

Part 2

In this second part we will build on Part 1 and extend it to with the following steps:

  • Connect a DHT11 sensor to Raspberry Pi;
  • Modify sensor.py to read data from the sensor;
  • Run a Node.js web server to render the data with a simple HTML page and Javascript to continuously update Canvas Gauges charts (https://canvas-gauges.com/) that graphically represent the sensor data on the Web Ui interface.

Go Here for instructions.

robipozzi-raspberry-sensors's People

Contributors

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