Hello everyone, I haven't posted in a long while, but I want to share my code and hardware concept for REM detection. It all started in this thread. I went quiet since then initially because I wanted to make a Kickstarter for the device. This apparently didn't happen, because I had problems with the hardware and insufficient time to solve them. I consider the concept proven though, since I've had some good recordings. It's unfortunate I lost so much time (not releasing my work as FOSS) with the idea for a Kickstarter, but better late than never.
Project description:
The hardware consists of a headband with three electrodes (two lateral ones and one in the centre of the forehead). I had the idea to use conductive thread instead of electrodes but I guess it changed its contact surface too much and/or there was some static electricity or whatever, but it was very hard to get good recordings with the sawn electrodes.
The instrumental amplifier is the main (one of very few) electronic components. I use for now the AD620 wired pretty much as explained in this tutorial (it pretty much made the project possible, because I'm pretty lame with electronics still). I bought an AD8237 (which is freaking tiny) and had it soldered to a dev board, but I haven't gotten around testing it yet. So, the amplifier outputs analogue data in the same range as a microphone, so we hook it up as one - the output is connected to the microphone slot on the computer (the sound card).
(btw all of the hardware costs like 10$ (without the soldering iron, that you might need))
Some pictures from the archives:

Above are the first and only working electrodes - just a wire soldered to that hardware part I don't know the name of. This picture is only to get an idea, since at the time I was using the headband to try the conductive wire. Here's a pic of that too:

Here's my very first amplifier setup (not a very informative picture, but still):

Since then I've fitted it with power supply from usb (not batteries). It's not the safest thing to do but I consider the risk for myself negligible and I don't have to deal with batteries.
The software is my doing and resides in GitHub - here . The concept is that the application is like a control panel for a series of filters. Every filter is a process that pipes data in and out (read about pipes in unix processes if you want to get into it) . For now I have the input "filter" which is actually the command line application arecord - it just spews out the data from the microphone . This data is fed to the second filter - a "sum" filter I called it (it eliminates noise via outputting the sum for the last n samples , where n is such so the 60hz noise from the power grid is cancelled out but the slow eye movements are not). That's where I'm at. Here's a screenshot from an old record (only the sum-filter output is shown):

The next step is to deal with the hardware noise, since at the moment the instrumental amplifier falls into some kind of noise-only state in some cases. Basically it works in the beginning or with some adjustment of the electrodes, but then when I try to make a night recording it gets into the noise state somewhere early in the night, and I have practically nothing in the morning. Somewhere in the beginning when I tried my first night recordings I think I had one or two that really showed the REM stages , but then I only viewed the records in Audacity and hadn't developed Sofia-EOG , so I can't compare.
Btw Sofia-EOG , because I live in Sofia, Bulgaria, and it sounded like a good product name (Kickstarter-wise .. ), but it grew on me, so I'm sticking with it.
The software is written in Qt, and as soon as someone wants to try it out - post on this thread or in a PM or in GitHub (preferably the first option) and I'll make a how-to for setting it up, maybe upload binaries, etc. It's in C++ and can be compiled for all Qt supported platforms (Win,Linux,Mac..) with minimal work.
So that's that, thanks for reading, and I really hope that more people get their minds on this project so we can have a cheap EOG device for lucid dreamers.
|
|
Bookmarks