PillowPi

Sleep Tight, Sleep Right, Wake Bright

What is the Pillow Pi?

The Pillow Pi is a device that allows users to get a better nights sleep by monitoring room conditions such as brightness and temperature. The core component of the Pillow Pi is the Rasberry Pi computer. The Pillow Pi was developed as an entry for PA Consulting's Raspberry Pi Competition.

Get a good night's sleep

A good nights sleep is vital as part of a healthy lifestyle. The PillowPi helps you to get to sleep quickly and comfortably

Learn basic electronics

The PillowPi relies on input from electronic 'breadboards'. Learning how to set these up can better help you to understand how everyday appliances work

Learn basic programming

Setting up the PillowPi will require some basic programming. This can help you to think about things logically, and could even give you a new hobby

PillowPi is standalone

The PillowPi's code is standalone and the electronics require only a few GPIO pins, meaning that it should be easy to intergrate into your existing projects

Easy to customise

Written in Python and hosted on GitHub, the PillowPi can be forked or customised by users. Users wanting to share their changes can submit a pull request

Introduction to Linux

The Raspberry Pi runs on linux distributions (excluding Windows 10 for RPi 2). Using these will help you to understand how operating systems work

Features

Get Started

Updating the Pi

When you first boot up your Pi you will need to update it. You can do this by entering the following commands into the terminal:


    pi@raspberry:~$ sudo apt-get update
    pi@raspberry:~$ sudo apt-get upgrade
    pi@raspberry:~$ sudo rpi-update
                     

Downloading the code

To use the PillowPi you will need to download the code. To do this you should enter the following commands into the terminal. The commands will download and unzip the code to the current directory.

    
   pi@raspberry:~$ wget http://github.com/sedders123/PillowPi/archive/master.zip
   pi@raspberry:~$ unzip master.zip
    

Audio Playback

To allow mp3 playback you will need to install the mpg321 drivers. Just enter the command below into the terminal and you'll be ready to go!

    
   pi@raspberry:~$ sudo apt-get -y install mpg321
    

OPTIONAL: Enable USB Speakers/Headphones

If you want to use USB speakers or headphones with the PillowPi you will need to edit a configuration file. To do this you will need to enter the following command into the terminal

    
   pi@raspberry:~$ sudo apt-get -y install mpg321
    

Then look for the following line

    
   options snd-usb-audio index=-2
    

To enable USB audio just comment out this line by prefixing it with a # as shown below

    
   # options snd-usb-audio index=-2
    

Press Ctrl + O and then Enter ↵ to save your changes then Ctrl + X to quit. Restart the Pi and audio should now come out of the speakers

OPTIONAL: Set up web interface

Setting up the web interface means that you can access information on sleeping conditions from any device that connects to the internet

To get started download apache2

    
   pi@raspberry:~$ sudo apt-get install apache2
    

When the installation has finished enable cgi scripts with the following command

    
   pi@raspberry:~$ sudo a2enmod cgi
    

Next you will need to edit your site file. Open it with the following command

    
   pi@raspberry:~$ sudo nano /etc/apache2/sites-available/000-default.conf
    

Next you will need to edit your site file. Open it with the following command

    
   pi@raspberry:~$ sudo nano /etc/apache2/sites-available/000-default.conf
    

Press Ctrl + O and then enter to save your changes then Ctrl + X to quit. Restart the Pi and audio should now come out of the speakers

Full Build Guide

To build your own PillowPi you will need the full instructions, including an electronic components guide, which can be found on our blog. If you have any issues or problems feel free to contact us with the links found in the contact section

Visit Blog

Video

Here is a video of an early version of the PillowPi in action

License

The PillowPi code was created by James Seden Smith and is 100% FREE under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0))

Contact

We hope you find the Pillow Pi useful
Feel free to get in touch if you have any questions or suggestions.