This project helps caretakers save time spent manually checking toilet paper, especially in a large building where there are a lot of toilets. Caretakers just need to sit down in the chair and check toilet paper status via smart phone.
A distance sensor is used to measure the distance from the sensor to the surface of toilet paper roll. The current thickness of paper is calculated as follows:
thickness = max_distance – distance
Where max_distance is distance between the sensor and surface of the axle in the paper holder (without paper roll). When knowing the thickness, we can visualize it on canvas.
The server side program (task0.php) gets the distance from the distance sensor and sends this distance to the client side program (index.php) in a web browser via WebSocket. The calculation of thickness and scaling is performed in the client side program.