Smart-Pillows which can ease the conversation between any two people or couples. These Smart-Pillows have LEDs which glow when opposite person places his/her head on their pillow. The pressure/touch sensors will measure if anyone is using the pillow. The Pillow will also have a small vibrator motor which shakes pillow when other user bumps his head on the pillow.
Users set alarms for the opposite person using mobile or desktop on the same network. The Smart Pillows will also perform a daily sleep analysis for sleep hours, snoring, disturbances and wake up the user when there is continuous disturbance for e.g coughing for a long time , violent sounds etc.
Step 1: Parts
We will be making a prototyope of the smart pillows, which will include touch sensor for sensing if pillow is being used
Parts for these products is very simple. Below are the parts required for one pillow, it is advisable to make 2 to show communication between two.
a) Intel® Edison with Arduino Breakout board
b) Vibration Motor
d) Sound Sensor
e) Touch Sensor
g) Grove Base Shield v2
h) Jumper wires
k)One Laptop(Ubuntu preffered) on the same network to act as Server
a)Intel XDK IoT Edition
PACKAGES REQUIRED FOR EDISON:
Step 2: Node.js Server Deployment
Before this step you must assign a static IP to your system e.g. 192.168.1.45
Run the following steps on Ubuntu Terminal to install Node.js if you don't have it
$ tar -xzf node-v0.4.4.tar.gz
$ cd node-v0.4.4.tar.gz
$ ./configure $ sudo make install
$ apt-get -y install build-essential
Install Sockets.io using the following commands on terminal
$ sudo npm install -g n
$ sudo n 0.8.15
$ sudo npm install socket.io
Now, Create a directory and paste the files from the attatched zip folder into that directory.
Go to Terminal and change directory to directory that contains server files that you copied using
$ cd your-directory
Now, fire up the server using:
$ node main.js
To test if it is running, enter the static IP address of your system in the browser or any device's browser on the network.
Step 3: Assembly
Connect to Edison using Serial Connection using PuTTy
- Check the Serial Port Number in Device Manager
- Open PuTTy and enter the Port e.g(COM7, COM9 etc)
- Enter speed = 115200
Enter Login Credentials and run the following command to connect Edison to wifi
$ configure_edison --wifi
Connect to network on which server was deployed.
a) Connect the Touch Sensor to Digital pin D2.
b)Connect the LED to Digital pin D6.
c)Connect the Motor to Digital pin D13 using a Breadboard and a resistor.
d)Connect the Buzzer to Digital pin D5.
e)Connect the Sound Sensor to Analog pin A4.
Step 4: Build, Upload and Run (Alarm + Notifications + Vibration )
Create a Blank XDK project and connect to Intel Edison using Serial or ssh.
Download the required libraries for edison using ssh as
sudo npm install socket.io-client
sudo npm install mraa
Now paste the code from the attatched zip folder into the main.js file.
Change IP address, port for Socket.io and pins accordingly.
Build the Code and Upload it.
Now if you set an alarm from any of your device, the buzzer will start buzzing at that time.
If you touch the sensor on one end the LED will blink on other end until other user touches his sensor.
After Link has been established if one user now touches the sensor the vibration motor on other end vibrates.