Differences

This shows you the differences between two versions of the page.

Link to this comparison view

iothings:proiecte:2022:smart_home_bluetooth_system [2023/01/19 19:23]
sergiu.ionescu3107
iothings:proiecte:2022:smart_home_bluetooth_system [2023/01/20 03:43] (current)
sergiu.ionescu3107
Line 77: Line 77:
      * Sending data to the Firebase and receiving it with PICO1. The PICO1 receives 8 bytes from both NANOs.Because the PICO has 2 UART interfaces we can easily connect to HC-05 to it, each speaking to a particular NANO. After the values are received we publish them to the FireBase RealTimeDatabase.      * Sending data to the Firebase and receiving it with PICO1. The PICO1 receives 8 bytes from both NANOs.Because the PICO has 2 UART interfaces we can easily connect to HC-05 to it, each speaking to a particular NANO. After the values are received we publish them to the FireBase RealTimeDatabase.
  
-     * Reading data from the Firebase with the Android App and sending commands. The Android App was made using MIT APP Inventor, and can read the sensor-data values, and also update the control values via the user interface. +     * Reading data from the Firebase with the Android App and sending commands. The Android App was made using MIT APP Inventor, and can read the sensor-data values, and also update the control values via the user interface. ​    
-     ​{{:​iothings:​proiecte:​2022:​android.png?​200|}} ​ {{:​iothings:​proiecte:​2022:​firebase.png?​200|}}\\+
            
      * Reading data from the Firebase with PICO2 and sending commands with PICO2. The PICO2 acts as an observer. It check every 1 second if the control values from the DataBase where changed. If they were changed the PICO will alert the NANO and the NANO will execute the specific commands.      * Reading data from the Firebase with PICO2 and sending commands with PICO2. The PICO2 acts as an observer. It check every 1 second if the control values from the DataBase where changed. If they were changed the PICO will alert the NANO and the NANO will execute the specific commands.
 +     
      * Lighting up when receiveing email with PICO3. I have developed a small program in Python which uses imap to check the number of unread emails from specific persons. The number is then updated in the FireBase. The program is ran from the personal laptop. After that the Pico3 check that number, and it start to blink for number of unread messages. After that it stays on, or off if all the messages were read.      * Lighting up when receiveing email with PICO3. I have developed a small program in Python which uses imap to check the number of unread emails from specific persons. The number is then updated in the FireBase. The program is ran from the personal laptop. After that the Pico3 check that number, and it start to blink for number of unread messages. After that it stays on, or off if all the messages were read.
 +     ​{{:​iothings:​proiecte:​2022:​android.png?​200|}} ​ {{:​iothings:​proiecte:​2022:​firebase.png?​200|}}\\
 +                          fig.3 Android APP structure. RealTimeDataBase Structure
  
 A little description of the protocol used : A little description of the protocol used :
-     * webSockets +     * **webSockets**. With WebSockets, messages can be pushed at any moment without regard to a previous request by both the server and the client. A few drawbacks with HTTP are resolved by WebSocket, including the bi-directional protocol, full-duplex communication (client and server can speak to each other separately at the same time), and a single TCP connection. Firebase databases'​ use of WebSockets has a number of restrictions. ​ First of all, the database is the central concept, with realtime synchronization (messaging) as an add-on feature. Only the updates to your database are published to connected clients. This forces you to permanently store even the transient events that need to be streamed to your users, leading to an unnecessary increase in storage costs. An example of transient messages in a chat app scenario would be indicators that others are typing – events that occur frequently but have zero need for permanent storage. Speaking of scalability,​ you can scale the Firebase databases up to a point. We’ve previously mentioned that an instance of the Firebase Realtime Database has a limit of 200.000 concurrent WebSocket connections. You can scale beyond this limit by sharding your data across multiple instances. However, it’s worth bearing in mind that sharding can become a significant challenge that leads to increased complexity and management overhead.\\ 
-     iMap+
  
 +     * **iMap**. IMAP serves as a middleman between the email server and email client as an incoming email protocol. When users read an email using IMAP, they read them off the server. The email isn't really downloaded or kept on their local device. This means that users can access the email from anywhere in the world using a variety of devices because it is not tied to a particular device.
  
 === 4. Demonstration === === 4. Demonstration ===
 +{{:​iothings:​proiecte:​2022:​general.jpeg?​600|}}\\
 +{{:​iothings:​proiecte:​2022:​server1.jpeg?​300|}} {{:​iothings:​proiecte:​2022:​server2.jpeg?​300|}}\\
 +{{:​iothings:​proiecte:​2022:​nano1.jpeg?​300|}} {{:​iothings:​proiecte:​2022:​nano12.jpeg?​300|}}\\
 +{{:​iothings:​proiecte:​2022:​nano2.jpeg?​300|}} {{:​iothings:​proiecte:​2022:​nano22.jpeg?​300|}} \\
 + 
 A video demonstrating the functionality of this project can be seen in the video from this archive: ​ A video demonstrating the functionality of this project can be seen in the video from this archive: ​
  
 === 5. Difficulties === === 5. Difficulties ===
-It was hard bla bla bla+There were many difficult parts in this project. Firstly I wanted to use NRF24l01 radio modules instead of the HC-05 modules, because they are more versatile. Unfortunately I did not manage to configure them correctly. After that, I had to learn the AT commands and how to configure the HC-05 modules. These was harder than it seemed due to many faulty wire connections I had on my breadboard. There was also some learning curve trying to understand how work with the Picos, APP inventor and the FireBase. I met various connectivity issues and the Picos ran of out RAM. Again I had many problems with my breadboards with many faulty connections and I needed to do various hardware debugs using my multimeter. Moreover, the Picos were not as fast as I expected, and it took them too much time to read or write to the database.
  
 === 6. Overlook and conclusion === === 6. Overlook and conclusion ===
-The proposed project has reached its goal. I understood ​how ESP32 board can be used as a web server, and I employed this functionality for creating an interactive and easy way for a user to control ​multiple ​LEDsIt could be further improved by adding more securityusing a HTTPS connectionMoreover, it could also be scaled up to more complex installations or adding different functionalities such as automatically turning on the LEDs when the light intensity is low and consulting their level of brightness through ​web server+The proposed project has reached its goal mainly. I managed to do an IoT level 5 based system. I learned ​how to design and think such systemhow to work with databases ​and what should ​take into consideration when making ​multiple ​nodes communicating with each otherHoweverthe many difficulties I encountered stopped this project from becoming fully functionalToo many Picos connected ​to the internet means more exposure to hacking, ​and slow performing times sometimes takes from the usefulness. All in all, it was great learning experience and I am looking forward to improve this system in order to be safely used in any home
  
 === 7. Resources === === 7. Resources ===
  
- +https://​www.raspberrypi.com/​documentation/​microcontrollers/​raspberry-pi-pico.html \\ 
- +https://​lastminuteengineers.com/​arduino-sr04-ultrasonic-sensor-tutorial/​ \\ 
- +https://​lastminuteengineers.com/​dht11-dht22-arduino-tutorial/​ \\ 
- +https://​learn.sparkfun.com/​tutorials/​temt6000-ambient-light-sensor-hookup-guide/​all \\ 
 +https://​howtomechatronics.com/​tutorials/​arduino/​how-to-configure-pair-two-hc-05-bluetooth-module-master-slave-commands/​ \\ 
 +http://​helloraspberrypi.blogspot.com/​2021/​02/​pair-hc-05-master-slave-using-raspberry.html \\ 
 +https://​electronicsprojectshub.com/​setup-dht11-sensor-with-arduino/​ \\ 
 +https://​ably.com/​topic/​firebase-vs-websocket \\ 
 +https://​www.techtarget.com/​whatis/​definition/​IMAP-Internet-Message-Access-Protocol \\
  
  
iothings/proiecte/2022/smart_home_bluetooth_system.1674148982.txt.gz · Last modified: 2023/01/19 19:23 by sergiu.ionescu3107
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0