{"id":18553862,"url":"https://github.com/marcobendinelli/smart-building-control-system","last_synced_at":"2025-05-15T11:34:31.043Z","repository":{"id":236278633,"uuid":"792279765","full_name":"MarcoBendinelli/Smart-Building-Control-System","owner":"MarcoBendinelli","description":"System that manages sensors and actuators in multiple buildings across different neighborhoods, orchestrating control loops within each room while analyzing environmental data","archived":false,"fork":false,"pushed_at":"2024-04-26T11:04:54.000Z","size":525,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-17T11:12:33.157Z","etag":null,"topics":["actuators","contiki-ng","hvac","kafka","sensors"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MarcoBendinelli.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}},"created_at":"2024-04-26T10:44:11.000Z","updated_at":"2024-04-26T11:04:57.000Z","dependencies_parsed_at":"2024-04-26T12:25:17.400Z","dependency_job_id":"c921eedb-8cf2-4a17-8cda-6710bcdb2bcf","html_url":"https://github.com/MarcoBendinelli/Smart-Building-Control-System","commit_stats":null,"previous_names":["marcobendinelli/smart-building-control-system"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcoBendinelli%2FSmart-Building-Control-System","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcoBendinelli%2FSmart-Building-Control-System/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcoBendinelli%2FSmart-Building-Control-System/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MarcoBendinelli%2FSmart-Building-Control-System/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MarcoBendinelli","download_url":"https://codeload.github.com/MarcoBendinelli/Smart-Building-Control-System/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254331197,"owners_count":22053129,"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","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":["actuators","contiki-ng","hvac","kafka","sensors"],"created_at":"2024-11-06T21:18:38.749Z","updated_at":"2025-05-15T11:34:31.017Z","avatar_url":"https://github.com/MarcoBendinelli.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Smart Building Control System :house:\n\nThe system is designed to manage **sensors** and **actuators** deployed in multiple buildings across different neighborhoods. It orchestrates simple control loops within each room of a building while collecting and analyzing long-term environmental data from available sensors. Inspiration for the data model is drawn from open datasets such as _sensor.community_.\n\nSensors installed in rooms monitor environmental data like temperature and humidity, using this information to activate commands on nearby actuators. For instance, if the temperature or humidity deviates from a comfortable range, an HVAC controller in the room is activated until the data returns to the desired range. Sensors are IoT devices, while actuators are more powerful devices capable of running a full-fledged operating system.\n\nCheck out the full report [here](Report.pdf)!\n\n## Implementation\n\nFor inter-room communication, **Kafka** was chosen, while the sensor-actuator messaging system is implemented using **MQTT**. It is assumed that there is a single sensor for every actuator in the room, considering two possible types of actuators: one for temperature and one for humidity management.\n\nThe system functions as both a _producer_ and _consumer_: it consumes MQTT messages sent by sensors and produces Kafka events for the **Analyzer**. This system acts as a Kafka consumer, receiving every message from every room of the entire system and storing it for long-term analysis.\n\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/MarcoBendinelli/Smart-Building-Control-System/assets/79930488/3d517fb3-c8bb-4d98-817b-94b4f46e5694\" alt=\"Architecture Diagram\" width=\"800\"\u003e\n\u003c/p\u003e\n\n## Design Choices\n\nDue to sensors being unable to run a full-fledged operating system, **Contiki-NG** and **MQTT** were chosen for communication between sensors and actuators. Conversely, **Kafka** was selected for communication between actuators and a central server collecting all data. In the proposed version, only one broker and one partition are used, serving as a central processing unit for every building. In case of massive data, the project can be easily scaled to include more brokers and computing units.\n\n## Team members\n| Name and Surname | Github |\n:---: | :---: \n| Matteo Beltrante | [@Beltrante](https://github.com/Beltrante) |\n| Marco Bendinelli | [@MarcoBendinelli](https://github.com/MarcoBendinelli) |\n| Simone Berasi | [@SimoneBerasi](https://github.com/SimoneBerasi) |\n\n## Guide\n\n### IoT device\n\n#### First Mosquitto setup\nIn your Client machine (VM - Ubuntu) modify the Mosquitto configuration file:\n```shell\ncd /etc/mosquitto\n```\n```shell\nsudo nano mosquitto.conf\n```\nAnd add the following lines in the bottom of the file:\n```shell\n  connection bridge-01\n  address mqtt.neslab.it:3200\n  topic # out 0\n  topic # in 0\n```\nSave, Exit and Restart your machine.\n\n#### Start your IoT device\nGo in the correct folder\nCompile your code:\n```shell\nmake TARGET=native\n```\nRun your code:\n```shell\nsudo ./IoT-device.native\n```\n- Note1: The sudo command is necessary to run the code inside your network.\n- Note2: The mote publishes a reading every 10 seconds, if you want to change such behaviour, change the number at line 86: `#define DEFAULT_PUBLISH_INTERVAL    (10 * CLOCK_SECOND)`\n- Note3: Look at the project-conf.h file for changing the publish topic\n  \n#### Simulation with Cooja\nUse the Border-Router to communicate with the Broker outside Cooja\n\n### More info\n - The IoT device will start to publish to a public broker, in order to receive the readings you must connect to such broker and you must subscribe to the correct topic. \nMore about topics is well written here: http://www.steves-internet-guide.com/understanding-mqtt-topics/\n- Thanks the bridge mode, the IoT devices publish to the local broker inside your machine and the local broker automatically forwards the messages to the public one.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcobendinelli%2Fsmart-building-control-system","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarcobendinelli%2Fsmart-building-control-system","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarcobendinelli%2Fsmart-building-control-system/lists"}