Initial Phase

Brainstorming various communication methods

Doing market research for readily available solutions, such as methods for sending data from sensors to phone, Internet of Things solutions, etc…

Research on how internet communication works:

Internet communication works via Server-Client systems. A server is a computer that is constantly running, listening for requests. A client on the other hand is a computer that sends requests to the server to get the requested information. When a server receives a request, it will, depending on the request, send back data to the client. This constant communication between server and client is handled by Hyper Text Transfer Protocol (HTTP) and is what powers websites and most applications that require internet access. In addition, for a server to be able to communicate with any client, the server must be connected to a Wide Area Network (WAN). Under usual situations, when a device connects to the internet, it is actually connecting to the Local Area Network (LAN) provided by the router. The router acts as a sort of valve, distributing the connection to the various devices connected to the LAN. In addition, the router also prevents external clients (Clients not connected to the same router) from accessing the devices on the local network to prevent malicious hackers from obtaining private information. To allow a server to be accessed via external clients, the router must be configured to broadcast the server onto the internet. This is known as port forwarding.

However, this alone is not sufficient as data needs to be obtained via sensors. A method for obtaining this data and passing it into either a server or client is required. For this, an Arduino can be used. The Arduino can run as either a server or a client, so long as a module that allows for internet connection is provided. On top of this, the Arduino makes it easy to connect sensor apparatus and process the data. There is also an abundance of documentation for various sensors on the Arduino platform making it the ideal choice for this project.

 

Basic Premise:

In summary, the Arduino broadcasts a website which the user can access via browser or an application.

Prototype

Prototype for WiFi module testing:

Circled is the ESP8266 Module. This setup was used to establish internet connection and create the Wide Area Network required for internet communication. Once a stable connection is achieved, sensor apparatus can be added using the additional pins and data can be sent to a client for processing. For testing purposes, Google Chrome was used as a temporary client. Thus, HTML code was sent to the client. Simultaneously, a python client was created to attempt to access the server. Since the client is written via python, there is much greater flexibility in data processing as a typical computer is far more powerful than an Arduino in terms of processing power and memory. A Graphic User Interface could also be added.

Final Product

Below is the final design of the hardware

The application is written in python. The GUI is written via the inbuilt GUI library tkinter. The requests and BeautifulSoup libraries are used to communicate with the server. These are used in conjunction with the Telegram Application Programming Interface (API), provided by Telegram, to send information to users. The matplotlib library is used to produce the graphs.

The sensor is first accessed by its IP address. When the Arduino recognizes a client has connected to it, it will send data to whichever client has connected to it. This data is then parsed by the application and depending on the settings selected, is sent to users via telegram. The data is also temporarily stored and is used to plot a live graph when applicable.