Sunday, August 19, 2012

Sleep Positions: Model X16-1C Accelerometer

I wear the Model X16-1C accelerometer at night, Velcro'ed to the top of my Quattro FX head gear.  The mask head gear is conveniently made to accommodate Velcro because that is how the head gear is adjusted.  I put the accelerometer on the top of my head because there's a strap there to attach to and it's out of the way of my nightly movements.  The accelerometer records X, Y, and Z positions into text files from moment to moment, which I capture and record into a database.

I "calibrated" the meaning of the X, Y, and Z values by putting my head and body into known positions for a while and then looked at the values.  The chart below shows last night's data with some notations about sleeping position.

From this data I can tell what sleeping position I'm in when and how often I'm changing positions.  In the beginning I go to sleep on my tummy with my head to the left, but later, in the middle of the night I tend to roll onto my back, then back on my side again, and back and side... etc.  Near the end of the night you can see that I'm starting into a waking process during sleep as on the far right I become more active, changing positions / moving frequently.

In another posting later I'll show how I relate positions to my brain waves from the Zeo and my breathing and apnea events.

Thursday, June 21, 2012

Model X16-1C Accelerometer

As I mentioned in a previous post, "BasementDwellingGeek" at talked about an accelerometer for measuring movements during sleep, breathing, sleeping positions and I suppose numerous other things.  My interest is in sleeping positions.  It is the Gulf Coast X16-1C Accelerometer for $89, plus shipping.

When I received it this is what I found in the box...

The blue device at the top is the accelerometer itself and the black item below it is a rewindable USB cord, very handy because the accelerometer is actually a USB thumb drive (aka RAM drive, nice for getting your data!).  The rewindable USB cord is handy as it could be difficult to plug the accelerometer directly into your PC in close-quarters.  It shipped with a necessary AA battery and a screw driver too, so you could open the accelerometer and put in the battery.  They sent everything needed to fire up the unit.  I was expecting just the blue accelerometer.  I got more than I expected, smart on their part.  You have to put in the battery paying attention to which direction the (+) terminal goes, then you will find that the manual is on the accelerometer's thumb drive when you plug in the accelerometer to the USB (and the drivers install).  The only suggestion I would make to Gulf Coast is to put a little slip of paper in the box describing how to put the battery in (which way) and that the manual is on the RAM drive.

The accelerometer's case is just right.  Rounded corners, no wires dangling, no connectors and a nice cap over the USB connector.  It's 3-4 inches long and probably less than 1" wide and deep.

Since I was interested in sleeping positions, I needed a way to attach this to me.  I had some velcro straps I was not using so I rubberbanded the accelerometer in the velcro and then attached it to my CPAP mask headgear, which is velcro-friendly, that's the way you adjust the straps on the headgear.

Good.  It is actually secure.  It's hard to remove the velcro from the headgear.

This device is configurable by adding/changing/removing configuration settings in a text file to customize how often it records values, the number of readings per text (CSV) file it puts on its RAM drive, numerous others. You have to use WordPad in Windows to do this, not Notepad (so they say).  Something about proper line terminations (Carriage Return Line Feed stuff).

The nice thing about this unit is that it senses and records gravitational G's.  That means it's recording positions, not just movement.  If you have it at different orientations, it's recording different G's on it's X, Y, and Z axes thus different X, Y, and Z values. So, if I strap it to my body / head and rotate my head, or roll from my tummy to my back when sleeping, there will be levels of X, Y, Z that correlate to those positions. Perfect!

Surprise Bonus... Temperature
Come to find out when this unit writes files it records the temperature for each file following the hour change.  Who knew!  Great!  Now I can have my sleeping temperature too!  Perfecto!

More later on the XYZ and sleeping position with some graphs...

Until then.

Monday, June 18, 2012

New Toy: Accelerometer

On a recommendation by "BasementDwellingGeek" at I got a new toy... an accelerometer.  It is Model X16-1C made by Gulf Coast Data Concepts in Waveland, Mississippi.  Here's the web page to the device:

Gulf Coast X16-1C Accelerometer

It cost me $89, plus shipping.  Is it worth it?  For me, clearly yes!

Why an accelerometer?  Well, it clearly tells me my sleeping position.

In the coming days I'll write up what it looks like, what I got with my order, how I set things up to use it, the data it generates and what it is telling me.

Friday, April 27, 2012


Time for a progress update on my personal performance.  Below you will see 3 trends, my Zeo sleep score, my "Whack a Mole" and my "Goodness", each smoothed with a moving average, since February 20th, 2012.  So, I've been collecting this data for about 67 days.

The Zeo Sleep Score above comes from the Zeo Bedside unit where it scores my sleep by length, quantities of REM and Deep and deducts points for number of times I wake and duration awake.  My Zeo Sleep Score has been trending upward.  Good.

The "Whack-a-Mole" is a measure of my response time by measuring the average time it takes for me to click on a little picture that jumps around a window.  I take this "test" most every morning and sometimes during the day as well.  Lower is better.  My response time is becoming faster, but I sense it is leveling off.

Above is my personal subjective feeling of "Goodness".  How good I feel which I record using a slider, higher is better.  It has also been rising but I see it leveling off.  That may be because I am in fact reaching a plateau or there's a psychological aspect to adapting to "better" and not wanting to slide the bar higher.  These kinds of things is why I collect a variety of performance metrics, and these 3 are not the only ones, there are 8 of them I collect (?!).

OK, so, I've been getting better and that is good news.  I might be reaching a plateau and that is something to ponder ... how to take the next step up.

Tuesday, April 24, 2012

Comparison: "Sleep like Android" vs. Zeo

Someone mentioned accelerometer based sleep monitors and there so happens to be a popular one for my Android (Motorola Android Razr Maxx) called "Sleep like Android" so I downloaded, installed, read through the instructions.  You plug your phone into the power (so it does not fully discharge) and put your phone on the mattress and "Sleep like Android" uses the phone's accelerometer to detect movement to try to classify your sleep in simplistic terms, on a continuum from Deep to Light.  The idea is if you are moving, you are awake or in light sleep, or maybe REM, or something.  Below is an image that compares my ResMed S9 AutoSet respiration (low and stead during Deep, volatile during REM) and my Zeo (big 'eyes' during Deep, volatile during REM) with the Zeo classifications from their website at the bottom.  The black chart is the "Sleep like Android" output.

You can see the "Sleep like Android" output does NOT match with anything from the medical device (ResMed) nor the Zeo brain wave monitor.  It shows "light" during Deep, shows "deep" during REM, the Zeo shows some "Wakes" but nary a blip on the "Sleep like Android"

I may try some additional nights to double check, but in my initial view... "Sleep like Android" does not work and is not useful, at least for me.  This does not suggest other accelerometer based sleep monitors do not work, just that the "phone on a mattress" look to be a weak solution.

Major advantage: My phone was fully charged in the morning, ready for a busy day. :)

Monday, March 19, 2012

Making a Zeo Cable

The Zeo Bedside unit has a serial port which emits the raw signal it picks up from your forehead, the brainwaves; Delta, Theta, Alpha, Beta 1, Beta 2, Beta 3 and Gamma, the sensor impedance and also the 30 second sleep stages.  How do you get this data?

1) Make a cable
2) Get and install a "Real time" firmware upgrade into the Zeo Bedside unit.
3) Get ZeoScope (free)


The Cable
The Zeo Bedside's serial port can be connected to your PC using a Serial -to- USB cable, but Zeo does not sell one and if you want the data, you must make it. The cable itself is a RS-232 Serial to USB, so there's a chip in the USB connector thus one cannot use a standard USB cable and "hack it up". To make mine I followed the directions here:

To make it, I got these parts: ... 16-02-1114
(5 each, to have a couple spares, they are cheap... wire termination connector clip thingys) ... 50-57-9405
(1 each the plastic 5 pin connector) ... 32R-3V3-WE
(1 each, $20... the cable itself)


The Firmware Upgrade
It's explained step by step at the same web page on how to make the cable:


ZeoScope is PC software available for free here:

Have fun watching your brainwaves streaming by... Look left, look right, watch the wave patterns.  Take off the Zeo headband and press it against your chest... WOO... One of the weirdest EKG's you've ever seen. :)

Saturday, February 25, 2012

Zeo Sleep Score: Mean Anything?

The Zeo puts out a sleep score based on hours slept, the amount of time in REM and Deep sleep and the number and duration of waking during the night.  Does this have any bearing on how you feel or perform, really?  In some initial data collection, the answer is YES. 

From time to time I do a home-made "Whack-A-Mole" type of measurement of response time.  In this little performance game an image appears in random locations 10 times in a window and I must mouse to the image and click on it.  The average time it takes between clicks is logged each time I play the game.

If I do a chart of my Zeo Sleep Score vs. my response time it looks like this:

You can see when my Zeo Sleep Score is low, my response time is high (I'm slower to respond) and the reverse is true.  Mathematically the correlation is low, but to our eyes we can see there is a relationship between these two independently arrived at metrics.