A smart factory produces various products and these products are stored in the warehouse. In order to monitor how many products are stored in the warehouse, the easiest approach is to record each product and its container in a system, so that the added products can be tracked by this system. In this study, our focus is to figure out how many products are available in a container without recording them in the system but by utilizing the load sensors instead. Basically, the load sensor measures the total load once a product is added in the container. Assuming that all products are the same in terms of the weight and form, we will be able to detect the number of the products in the container in the end of this study.
1. HX711 Sensor Implementation:
The integration of HX711 sensor can be performed with the following approaches. The code integration code relies main on two parts. The first describes the HX711 sensor with a class and this code communicates with the hardware. In the second part, we see the execution of this class, in other words, a simple test-case to understand whether the weight sensor functions.
2. Involving WebSocket Communication Protocol:
The aim of this task is to convey the measured data from the sensor to a web application, which will be presented in the next section. Websocket establishes two communications between two entities, however, only one direction from the sensor to the web-app will be implemented. This task has two folds: (1) Implementing the websocket communication on the sensor side, (2) Implementing the web socket communication on the web side.
3. Visualizing Data via Web Application:
The visualization of the incoming data is implemented with a simple index.html file, in which the socket communication is written. The index.html file includes all required libraries to be able to establish the socket communication, whereas HTML file reflects what is seen when the 127.0.0.1:10001 URL address is called on the web browser. .js file is responsible for receiving data from the connected channel and then update the HTML item when a new data is available.
Visit http://localhost:5000 to see the updating numbers.