loading

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:

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!

<p>You should enter this in the tech contest and the microcontroller contest! <a href="https://www.instructables.com/contest/tech2014/">https://www.instructables.com/contest/tech2014/</a></p><p><a href="https://www.instructables.com/contest/micro2014/">https://www.instructables.com/contest/micro2014/</a></p>
<p>Interesting. Thanks for sharing this.</p>

About This Instructable

783views

12favorites

License:

More by Djando:Chameleon Lamp Your Baby is under control with Linino 
Add instructable to: