Introduction: Your Baby Is Under Control With Linino
We imagined a system for controlling the sleep of an infant, through the use of a number of sensors that now describe.
A flex sensor place in the cradle, monitors the movements and an sound sensor measures the intensity of the cries. Everything is kept under control from a web page which will alert us with a sound or video messages.
Step 1: What to Use:
- Linino One (Linino)
- Flex Sensor (Spectra Symbol)
- Sound Sensor (Seeed Studio)
Step 2: Coding
Javascript file only used to create the server, all the various functions to interface with the sensors are HTML side.
Install the module node-static to create the server.
Javascript file:
var linino = require('ideino-linino-lib'), board = new linino.Board(), html = new linino.Htmlboard(); var static = require('node-static'); var file = new static.Server('./'); board.connect(function() { require('http').createServer(function(request, response) { request.addListener('end', function() { file.serve(request, response); }).resume(); }).listen(1337); });
HTML file: http://pastebin.com/JTdebvqY
NB. You should substitute the IP address in the example with that of your board.
Step 3: Fritzing Sketch
Connect the Flex Sensor to pin A0 and the Sound Sensor to pin A1.
Step 4: Conclusions
Now, through a Web page, you can keep an eye on the situation. The bars are colored red, exceeded a certain value and an alarm will be started.
Run app.js, connected to the address of your board (eg http://10.0.0.13:1337/) and click on Start.
Your Baby is under control!