WARNING

This is a unstable version! I added an experimental Alarm function and changed many other things. I do not give any warranty that it will work. Also it might have broken other functions!
Please let me know when you find a bug.

Documentation:

SleepAnalyser

About SleepAnalyser:

Sleep Analyser records your movement during your sleep.
It is able to visualise it on a graph to show how much you move during your sleep. This can help to indicate how you sleep.
It also has an alarm function. You can set the alarm and a time window (ex. 30 minutes). The Alarm will then go off sometimes during the time window (as soon as you move more), but latest at the set alarm.
Old records can be visualised and you can load records from your friends. SleepAnalyser also has a test function. It will record and visualise much faster. Also it will make a beep when ever your movement goes over the trigger level.

How to start:

To start, just click on "Start Recording" or "Set Alarm" and lay the phone beside your pillow onto the mattress. It will record all your movements and visualise it.
SleepAnalyser has also a test function (Button "Test"). It will record and visualise much faster. Also it will make a beep when ever your movement goes over the trigger level.
Old records can be visualised with a click on the "View a Record" button. In there you can also delete old records.

Recording:

After you clicked on "Start Recording", the Recording window will open. The recording is delayed for several seconds, so you have enought time to put the phone beside your pillow. A record is stopped when you click on "Stop Recording" or close the Recording window.

During or after the recording you can add a note, change the zoom and trigger level. It is useful to add a comment of how your sleep really was. In that way it is later on easier to understand the graph.

Set Alarm:

If you click on "Set Alarm", you can set an alarm and a time window to wake you up.
The Alarm will then go off sometimes during the time window (as soon as you move more), but latest at the set alarm.
SleepAnalyser uses the built in alarm functions. So even in the unlikely case that SleepAnalyser would crash, the alarm will go off.

After you set the alarm, it will show the normal Recording Window.

View old Records:

If you click on "View a Record", you can load previously recorded Records. Normaly it opens the last recorded file, but you can open any record on your phone and you can also select a specific date. It then will show a graph with your movements.

Settings

In the settings window (Button "Settings") you can change some parameters:

More options might get added in later versions.
More parameters are stored in the file ~/SleepAnalyser/SleepAnalyser.conf. How ever you should only touch them if you know what you do! Normally they don't have to be adjusted.

Record files

During recording, the data is also written to a file. For every record a new file is created. The files are saved in "~/MyDocs/SleepAnalyser". You can share them with other people by just copy them.

Graph:

In the Recording or View Window you will se a graph with your movements and other details: Graph
Movements are shown yellow. If the movements are stronger, the bars go higher.

At the bottom of the graph you can see horizontal bars in different colors. They represent the time without movements:

The white line in the graph shows the trigger level for the bars. There is also a white number on the right side indicating the trigger level. You can lower/raise it with the up/down buttons. You will have to experiment with it as it is different for everybody depending how soft your mattress is and how far away you put the phone. Those conditions will have an affects how the phone records your movement.

The white number on the left top corner shows the Y scale (always 1).

If you have set an alarm, you will see an orange bar in the graph with the set time window for the alarm.
If the alarm goes off, it will be marked with a red point:

Graph

Notes:

The application will drain the battery around 20..40% per night. It is suggested to put the phone onto the charger while using SleepAnalyser for a longer time.

Make sure the phone is not covered with your pillow, so it will not overheat.

If you don't feel confident to have a phone close beside hour head for the whole night, activate the option "Offline Mode" in the settings window. It then will automatically change into Offline Mode while it records.

How it works:

SleepAnalyser uses the built in acceleration sensor to detect your movements. Every second it measures how the phone lies and calculates your movements. To make it more accurate, it always merges the values of 10 seconds together. If the movement is over the set trigger point, it can set off the alarm and will visualise it in the graph.

Disclaimer:

This application is distributed under the GPL. You may redistribute and modify it freely, as long as you follow the rules of the GPL. I will not give any warranty for any harm on people, environment or the phone.

Copyright:

Copyright 2010 by George Ruinelli (george@ruinelli.ch).
For more information, please visit https://garage.maemo.org/projects/sleepanalyser/.

The icons are from KDE Nuvola theme made by Theme by David Vignoni (icon-king.com) 2003-2004 and KDE Oxygen theme made by Oxygen Team