{"id":31124173,"url":"https://github.com/mkaczmarski07/raspberry-iot","last_synced_at":"2026-05-11T07:19:04.248Z","repository":{"id":227155840,"uuid":"759943468","full_name":"MKaczmarski07/Raspberry-IoT","owner":"MKaczmarski07","description":" Raspberry Pi-based Client-Server environment allowing for interactive management of sensors and actuators via a mobile application.","archived":false,"fork":false,"pushed_at":"2025-09-14T08:50:25.000Z","size":1423,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-14T10:25:50.958Z","etag":null,"topics":["embedded-systems","home-automation","ionic","python-script","raspberry-pi-4","rest-api"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MKaczmarski07.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-02-19T16:18:15.000Z","updated_at":"2025-09-14T08:50:28.000Z","dependencies_parsed_at":"2024-03-11T22:49:14.980Z","dependency_job_id":"66602595-6ae8-46b8-93f5-b1c022a129bc","html_url":"https://github.com/MKaczmarski07/Raspberry-IoT","commit_stats":{"total_commits":33,"total_committers":2,"mean_commits":16.5,"dds":"0.24242424242424243","last_synced_commit":"28f4b445d2396de6c57cf0e69c3edf53d42714c8"},"previous_names":["mkaczmarski07/smart-home","mkaczmarski07/raspberry-iot"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MKaczmarski07/Raspberry-IoT","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MKaczmarski07%2FRaspberry-IoT","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MKaczmarski07%2FRaspberry-IoT/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MKaczmarski07%2FRaspberry-IoT/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MKaczmarski07%2FRaspberry-IoT/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MKaczmarski07","download_url":"https://codeload.github.com/MKaczmarski07/Raspberry-IoT/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MKaczmarski07%2FRaspberry-IoT/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":275650063,"owners_count":25503216,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-17T02:00:09.119Z","response_time":84,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["embedded-systems","home-automation","ionic","python-script","raspberry-pi-4","rest-api"],"created_at":"2025-09-17T19:38:08.461Z","updated_at":"2025-09-17T19:38:13.915Z","avatar_url":"https://github.com/MKaczmarski07.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# About The Project\n\u003ci\u003eThis project was developed as part of my Engineering Thesis defended in 2025 at Lublin University of Technology, Faculty of Electrical Engineering and Computer Science, Department of Electrical Engineering and Intelligent Technologies.\u003c/i\u003e\n\n### Main Concepts and Learning Objectives\n- The primary objective was to explore the fundamental components of modern smart buildings and develop a simple system in real life using available resources. \u003cbr/\u003e\n- Apart from my theoretical research on the subject, I built a Raspberry Pi-based system that enables remote control of sensors and actuators via a mobile application. \u003cbr/\u003e\n- The communication between user interface and hardware components is achieved with client-server model utilizing HTTP protocol and REST API. \u003cbr/\u003e\n- A web server hosted on the Raspberry Pi executes Python scripts to manage GPIO pins and establish connectivity with the external world \u003cbr/\u003e\n\n### Live Demo\n[Raspberry-IoT Demo Video](https://www.youtube.com/watch?v=RefyAJ8AFuA)\n\n### Used Technologies\n[![My Skills](https://skillicons.dev/icons?i=python,raspberrypi,ubuntu,flask,typescript,angular,sass,sqlite)](https://skillicons.dev)\n\n### System Features\n🛡️ Controlling operation of the motion sensor and detecting intrusions. \u003c/br\u003e\n🔔 Sending notifications and turning on the alarm when an intrusion is detected. \u003c/br\u003e\n📈 Measuring current temperature and humidity in a room and displaying data in the application. \u003c/br\u003e\n⚙️ Controlling operation of the servomechanism representing automatic blinds. \u003c/br\u003e\n💡 RGB lighting with the ability to set any color and brightness from the application. \u003c/br\u003e\n🌈 Various lighting scenes. \u003c/br\u003e\n🌦️ Displaying current weather data based on the API calls. \u003c/br\u003e\n\n\n# Table of contents\n1. [Hardware Components](#hardware-components)\n2. [Hardware Architecture](#hardware-architecture)\n3. [Software Architecture](#software-architecture)\n4. [Full list of software technologies](#used-technologies)\n5. [Network Communication](#network)\n6. [Mobile Application](#ionic)\n7. [Setup the Raspberry Pi](#setup-the-raspberry-pi)\n8. [Setup Flask Web Server](#setup-flask)\n9. [Expansion Possibilities](#expansion-possibilities)\n\n\u003ca name=\"hardware-components\"\u003e\u003c/a\u003e\n# Hardware Components\n\n| Name  | Anmount | Description |\n| ------------- | ------------- | ------------- |\n| Raspberry Pi 4 model B | 1 | Microcomputer |\n| JustPi LT-4B03 | 1 | Cooling case for Raspberry Pi 4B  |\n| JustPi USB C 5V/3A  | 1 | Power supply for Raspberry Pi 4B  |\n| DHT11 | 1 | Temperature and humidity sensor |\n| Active buzzer 5V 12mm | 1 | Small sound generator |\n| PIR HC-SR501 | 1 | Motion sensor  |\n| MicroSerwo SG-90 | 1 | Precisely controlled rotation mechanism |\n| MB102 Power supply | 1 | Power supply module for the breadboard |\n| JustPi - 830 breadboard | 1 | Tool used to build circuits without soldering |\n| RGB LED diode, co-cathode | 2 | - |\n| Resistor 220 Ω  | 6 | - |\n| Resistor 1 kΩ  | 1 | - |\n\n\u003ca name=\"hardware-architecture\"\u003e\u003c/a\u003e\n\n# Hardware Architecture\n![scheme](https://github.com/user-attachments/assets/979696b2-025e-485b-8386-d008075ac5f7)\n\n\u003e [!CAUTION]\n\u003e NEVER connect LEDs up to the GPIO pins without a resistor. The Raspberry Pi GPIO pins can only supply a small current (about 60mA). The LEDs will want to draw more, and if allowed to they may damage your Raspberry Pi or the pins used.\n\n\u003e [!WARNING]\n\u003e Low-current components like sensors and Buzzers / LEDs should be grounded directly to the Raspberry Pi to avoid incorrect current flow. However, it is not recommended to power and ground high-current components such as motors directly from the board pins, as too high current may permamently damage the pins or the Raspberry Pi itself.\n\n\u003ca name=\"software-architecture\"\u003e\u003c/a\u003e\n# Software Architecture\n![software architecture](https://github.com/MKaczmarski07/smart-home/assets/95142305/5c28e503-e384-4ae9-9a3b-06f5e70e3058)\n\n\u003ca name=\"used-technologies\"\u003e\u003c/a\u003e\n# Full list of software technologies\n\n### Programming Languages\n[TypeScript 🔗](https://typescriptlang.org)\u003cbr\u003e\n[Python 3 🔗](https://www.python.org)\u003cbr\u003e\n\n### Frameworks \u0026 Extensions\n[Ionic 🔗](https://ionicframework.com)\u003cbr\u003e\n[Angular 17 🔗](https://angular.dev)\u003cbr\u003e\n[Sass 🔗](https://sass-lang.com)\u003cbr\u003e\n[Flask 🔗](https://flask.palletsprojects.com/en/3.0.x/)\u003cbr\u003e\n\n### Libraries\n[Iro.Js 🔗](https://iro.js.org)\u003cbr\u003e\n[Flask CORS 🔗](https://flask-cors.readthedocs.io/en/latest/)\u003cbr\u003e\n[Adafruit CircuitPython DHT 🔗](https://docs.circuitpython.org/projects/dht/en/latest/)\u003cbr\u003e\n\n### Databases\n[SQLite 🔗](https://www.sqlite.org)\u003cbr\u003e\n\n\u003ca name=\"network\"\u003e\u003c/a\u003e\n# Network Communication\nCommunication between the user's application and the server (Raspberry PI) takes place in the local network (LAN). Local network ensures reliable and secure communication, as devices can communicate with each other without the need for an internet connection.\u003cbr/\u003e\n\nRemote communication with the system via the Internet is also possible, e.g. by port forwarding configured on the router. However, this solution requires an additional layer of security, including user authentication and protection against various types of malicious behaviors.\n\n\u003ca name=\"ionic\"\u003e\u003c/a\u003e\n# Mobile Application\n\n### User Interface\n![Mockup](https://github.com/user-attachments/assets/be52269e-f8ee-4582-b493-0c3fa09b6f28)\n\n### Core Architecture\nFor this project, I decided to use Angular 17 as the main framework with the modular architecture. The Angular based web application can be compiled into native-like mobile application using Ionic Framework \u0026 Capacitor runtime. Ionic itself is not only allowing for cross-platform development, but also provides a collection of customisable UI Components and building tools.\u003c/br\u003e\n\nBreaking the application into modules allows for significant reduction of loading time. Additionally, main routing strategy uses [Ionic tabs](https://ionicframework.com/docs/api/tabs) architecture, which also increases performance of the native application.\n\n### Ionic Setup Guide\nBefore you begin, make sure you have the following installed on your machine:\n\n- Node.js (version 18.13 or later) \n- npm package manager (version 9.0 or later)\n\nTo install all required dependencies, move to the app main workspace (frontend folder) and run:\n\n    npm i\n\nTo create a localhost port type:\n\n    ionic serve\n\nYour application is ready at port 8100.\n\n    http://localhost:8100/\n\n# \u003ca name=\"raspi\"\u003e\u003c/a\u003e\n# Setup the Raspberry Pi\n\n### First steps\nThe first step is to upload the Raspberry Pi OS image to the SD card. This can be easily done using the [Raspberry Pi Imager](https://www.raspberrypi.com/software/) tool available on the official website. \u003c/br\u003e\n\nAfter installing the system, you can either access the Raspberry Pi OS using keyboard and monitor connected directly to the computer, or remotely via SSH.\n\nTo access the device via SSH, enter the following in the terminal:\n\n```\n  ssh username@ipAddress\n  password\n```\nThe default SSH user is \"pi\" and the default password is \"raspberry\".\n\n### Safe shutdown\n\u003e [!WARNING]\n\u003e The raspberrypi microcomputer should not be turned off by immediately disconnecting the power supply, as this may damage the system or the SD card. \n\nTo safely turn off the device, enter the following the the Raspberry Pi OS terminal:\n```\n  sudo shutdown -h now\n```\nAnd wait until the green LED on the raspberry stops blinking.\n\n\u003ca name=\"setup-flask\"\u003e\u003c/a\u003e\n# Setup Flask Web Server on the Raspberry Pi\nFirst, install the required dependencies for this project:\n\n```\nsudo apt update\nsudo apt upgrade\n\nsudo apt install python3-pip\n\npip install Flask\npip install Flask-Cors\npip install adafruit-circuitpython-dht\n```\nThen, go to the backend folder and run the server.py file\n```\npython server.py\n```\n\n\u003ca name=\"expansion-possibilities\"\u003e\u003c/a\u003e\n## Expansion Possibilities\n- Due to the low availability of hardware components, the communication between Raspberry Pi and sensors \u0026 actuators is achieved via wired connections. In a full-scale building automation system, communication could take place wirelessly, e.g. via the ZigBee, Bluetooth, LoRa or MQTT. However, that would require additional hardware components and different software architecture decisions.\n- RGB LEDs can be replaced with a regular light bulb or an RGB bulb powered directly from the power grid. Such light source can be controlled via a wireless relay. The good example would be ESP8266.\n- The same rule can be applied to other hardware elements, such as motors. The servomechanism used in the project is controlled via PWM signal modulation, which is widely used control technique in the industrial world. \n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkaczmarski07%2Fraspberry-iot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmkaczmarski07%2Fraspberry-iot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmkaczmarski07%2Fraspberry-iot/lists"}