Idea
This project is done by 2 fellow students (Armend Racaj & Sander Vangampelaere) and I. We were asked to design a scale for measuring the weight of babies. The scale had to be connected to a computer/tablet/smartphone where the weight and other parameters could be shown (with evolution graphs etc.) I took the communication between the scale and the website for my account. The others built the website (using Silex, MySQL, Chart.js and a tool for converting a webpage to pdf)
I used a Raspberry pi for simulating an intelligent scale. A varistor was connected to the Raspberry pi with an ADC converter in between. (Which converts analog values to digital values by the lack of a analog input at the Raspberry pi). On the Raspberry pi there is a Python script running which wait's for an incoming connection from a browser. When the connection between the Raspberry pi, a NodeJS server (which routes connections between browsers and scales) and the browser is made, the raspberry pi starts sending the weight measured periodically to the server which then sends the measurement to the browser.
The image below shows how the communication between the browser (=client), scale and websocket server goes.
The image below shows the scale built with a raspberry pi, varistor and ADC converter.