Arduino Forum

Forum 2005-2010 (read only) => General => Exhibition => Topic started by: merkz on Mar 04, 2010, 07:18 pm

Title: ArduDreamer
Post by: merkz on Mar 04, 2010, 07:18 pm
I built this as I went so the layout is pretty messy =)

The user wears a headband that has electrodes placed at the temples.  The left and right eye movements are tracked.  The gain of the op amps in the electrooculogram circuit are controlled by the arduino through an AD5204 digital pot to allow for an automatic calibration routine.

You put on the headband and power up the board, and it outputs eye movement, unix timestamp and REM status to a computer for graphing.   It waits a set amount of time for you to fall asleep, and then monitors your eye movements to detect the REM stage of sleep (when you are dreaming).  When it detects REM, it blinks LEDs mounted in front of your eyes to give you a hint that you are dreaming to help you become lucid (http://en.wikipedia.org/wiki/Lucid_dream).  When the REM ends, it can wake you up so you can remember the dream better.

Since your physical eye movements match your dream eye movements, movement sequences can be programmed so that you can interact with it while you are in a lucid dream (like turn the flashing LEDs off, or make notes in the log, i.e. I'm Lucid)

It also has a built in alarm clock that can wake you up at a set time in the morning.  

I got the idea from some experiments Stephen Laberge did at Stanford university

http://www.lucidity.com/slbbs/index.html

I had found a device called "RemDreamer" that could flash LEDs when you were in REM but it couldn't output a graph of exact eye movements and was pretty expensive so I decided to make my own.

It's working but I still need to make a PCB for it and integrate it into a sleep mask.


I was able to get all of the ICs except the atmega168 as free samples so the cost for this was about $15.

It uses an LM358, INA126P, 2x TLV2472, AD5204, DS1307, Atmega168 w/arduino bootloader and is powered via FTDI cable.

(http://img690.imageshack.us/img690/1305/dreamer1.jpg)


This is the eye movement output of a 3 hour afternoon nap:
(http://img237.imageshack.us/img237/7923/nap.png)
I'm pretty happy that it all actually works and just wanted to share =)
Title: Re: ArduDreamer
Post by: Ran Talbott on Mar 04, 2010, 07:26 pm
Quote
I'm pretty happy that it all actually works


And proud,  too,  I hope:  that's extremely clever and slick.
Title: Re: ArduDreamer
Post by: hwiguna on Mar 04, 2010, 07:47 pm
WOW!
Thats a cool project!

Of course, we expect you to post your next update from your dream. ;-)
Title: Re: ArduDreamer
Post by: merkz on Mar 04, 2010, 08:28 pm
Thanks!  I found a company that was kind enough to send me a couple samples of some really nice electrodes to use with this so hopefully that will clean up the signal a bit.  
Title: Re: ArduDreamer
Post by: KenH on Mar 04, 2010, 08:53 pm
First I've heard of that!  I read both articles and am amazed... but I do think I remember having Lucid dreams myself....  

Thank you for posting and I will follow this thread more.

Ken H>
Title: Re: ArduDreamer
Post by: doublet on Mar 04, 2010, 09:30 pm
That's pretty amazing!
I'm a lucid dreamer too (I'm active as 'Doublet' on the dutch LD4all)!

I'll make me one too  :D
Title: Re: ArduDreamer
Post by: cr0sh on Mar 04, 2010, 09:49 pm
Nice job!

I've always wanted to pursue something like this, but never found the time. Something that I wondered was whether by using a computer, headphones, and lights over the eyes - if the computer could somehow control or feed suggestions to the dreamer; in some manner using a computer to alter the dream-world thru suggestion in some manner (ie, lucid-dream virtual reality). Feedback from the REM movements would be necessary and needed, but you already have that...

What has always annoyed me most when lucid dreaming (the rare occasion it does occur to me; I rarely can remember on my own, so it is happenstance) is how easy it is to fall out of lucidity - if there were some way to both a) induce/remind the user for lucidity (which this machine can probably help) and b) keep the user in lucidity - dreaming would be a much more interesting (and potentially useful) experience...

Keep us updated on your progress, ok?

:)
Title: Re: ArduDreamer
Post by: programmer on Mar 05, 2010, 12:25 am
Well done!

Really interesting project, and something I really want to do myself at some point. I bought some of the bits needed but haven't had the time to work on it, and they've been sitting gathering dust for months.

I`d love to see a more detailed write up if you're happy to do one & share at some point  :)
Title: Re: ArduDreamer
Post by: Tchnclfl on Mar 05, 2010, 04:24 am
Man, I'd love to see how you monitor eye movements, tell when the user is asleep, etc.  I always thought you had to use EMF detectors (which are usually pricey) to tell when the user is asleep, etc.

Looks almost as cool as Zeo (http://www.myzeo.com/)!
Title: Re: ArduDreamer
Post by: Ran Talbott on Mar 05, 2010, 07:21 am
Quote
Looks almost as cool as Zeo!


I dunno if I want to use a subliminal coaching machine purchased from a site that set at least NINE cookies before showing the home page (It may have wanted to do more,  but I clicked "Deny" when Firefox asked permission for the ninth).

"When you wake up,  you will feel refreshed and confident,  and have an irresistible urge to order a Zeo for each of your immediate family members..."
Title: Re: ArduDreamer
Post by: KnMn on Mar 05, 2010, 02:29 pm
This is definately one of the coolest projects I've seen on this board so far.

I spent months constantly counting my fingers and checking clocks and lightswitches while I was awake, but never managed to have (or remember having) a lucid dream. It's on my "to-do" list for life.

Good job :)
Title: Re: ArduDreamer
Post by: doublet on Mar 06, 2010, 08:09 am
Where did you get the IC's? Can you also post the schematics?
Title: Re: ArduDreamer
Post by: merkz on Mar 06, 2010, 03:47 pm
I got the ICs from Texas Instruments (INA126P & TLV2472), Analog Devices (AD5204), and Maxim (DS1307).  The passive components and atmega168 I got from digikey.   If you want to try building one I would recommend the atmega328 instead, digi was just out of them when I ordered stuff.

The only schematic I have right now is from when I was figuring out the EOG circuit in pspice:

(http://img269.imageshack.us/img269/2158/eogschematic.png)

Some things I changed since that schematic: I just power it from FTDI now so I got rid of the 9V battery and 7805.    I took out the TLV2472 from the virtual ground circuit and replaced it with an LM358.   I reused the TLV2472 to cascade two more 40Hz low pass filters before the final amplification.   I replaced the 280ohm resistor in the instrumentation amplifier with a channel on the AD5204.  I replaced the 270K resistor on the final amp circuit with a 150K, and I replaced the 10K resistor on the final amp circuit with another channel on the AD5204.  

The rest of it I just made as I went on the breadboard so I dont have any schematics right now, but Im going to build a PCB for this and I can post the full schematic after I get it in to eagle
Title: Re: ArduDreamer
Post by: doublet on Mar 06, 2010, 04:34 pm
If you would make a shield or PCB, I'm VERY interested in buying one.
Title: Re: ArduDreamer
Post by: merkz on Mar 06, 2010, 04:59 pm
Cool.  I'm waiting on a couple different types of sleep masks and the reusable electrodes to come in.  The adhesive ones I've been using leave nasty red marks next to my eyes after wearing them so my GF has kindly asked my to stop using them =)
Title: Re: ArduDreamer
Post by: doublet on Mar 06, 2010, 05:17 pm
:P I think Zeo is selling masks with elektrodes in it.
Title: Re: ArduDreamer
Post by: alternate on Mar 06, 2010, 05:39 pm
I just stumbled upon this topic and had to chuckle, since i had a schematic lying around my hard drive for about a year now, looking quite similar. Even used the same InAmp.
Had a breadboard version up and running, and began working on a layout for a smd version consisting of three tiny (2x3cm) pcbs connected by flexibel connectors.
One board as analog stage with amp and filters, the second with the microcontroller (atmega64) and a third with rs232 and a small rf transceiver module.
That way i intended to mount the entire rig directly on the headband, supplied by a small LiPo Battery.
Also began looking into the possibility of using active electrodes without the for contact gel, but never came around to do some testing.
I had to put the thing on hiatus however, since other things have taken up my time since then.

Thought you might be interested of how others tried something similar. Best of luck to you and your project.

Below my design for the analog stage. I used three electrodes though, with the third directly tied as reference.
Title: Re: ArduDreamer
Post by: alternate on Mar 06, 2010, 05:40 pm
(http://img242.imageshack.us/img242/3153/42945240.jpg)
Title: Re: ArduDreamer
Post by: merkz on Mar 06, 2010, 06:32 pm
Hah cool, I think EOG is the way to go with this type of thing (and it's just cool).

The Serial C# grapher that got posted inspired me to write an app to go with this.  I've been using KST in linux to do the graphing, but now I'm going to try writing my own specifically for this, maybe with an integrated dream journal to tie journal entries with the graphs.  And it'd be nice to configure everything from an app instead of accessing a menu through minicom.
Title: Re: ArduDreamer
Post by: merkz on Mar 11, 2010, 06:05 pm
I got the code somewhat cleaned up.   I removed the speaker since it kept waking up my GF.  I removed the DS1307 in favor of using a running timer and syncing time on the PC.  The PC can give commands to the arduino by sending "#key=value" over the serial connection.  The PC gets updates from the arduino at about 375Hz using 115200 baud.  

I decided to skip doing a custom app, not worth the work since I got my issues with KST resolved  

The autocalibration didn't work all that great, I found it easier to look at the graph and adjust the gains by hand.  Would be nice to get it working tho.

Here's the arduino code..

Code: [Select]

#include <EEPROM.h>
#include <string.h>

#define BAUDRATE 115200

//pins
#define pLED 7
#define pMOSI 11
#define pMISO 12
#define pSCK 13
#define pCS 10
#define pAMP1OUT 2
#define pAMP2OUT 3

//rheostats
#define rAMP1 3
#define rAMP2 1
#define rLED 2

//button interrupts
#define bDELAY 0
#define bTEST 1

struct config_t {
 int ledBrightness;
 int ledOnTime;
 int ledOffTime;
 int delayTime;
 int REMAlarm;
 int EOGREMHi;
 int EOGREMLo;
 int amp1Gain;
 int amp2Gain;
 int REMTime;
 int testTime;
} config;

unsigned long thisMillis = 0;
unsigned long lastMillis = 0;
unsigned long REMStop = 0;
unsigned long testStop = 0;
unsigned long delayStop = 0;
unsigned long startTime = 0;

int ledOn = 0;

char buff[100];

template <class T> int EEPROM_write(int ee, const T& value)
{
   const byte* p = (const byte*)(const void*)&value;
   int i;
   for (i = 0; i < sizeof(value); i++)
       EEPROM.write(ee++, *p++);
   return i;
}

template <class T> int EEPROM_read(int ee, T& value)
{
   byte* p = (byte*)(void*)&value;
   int i;
   for (i = 0; i < sizeof(value); i++)
       *p++ = EEPROM.read(ee++);
   return i;
}

char spi_transfer(volatile char data)
{
 SPDR = data;                    // Start the transmission
 while (!(SPSR & (1<<SPIF)))     // Wait the end of the transmission
 {
 };
 return SPDR;                    // return the received byte
}

byte write_pot(int address, int value)
{
 digitalWrite(pCS,LOW);
 //2 byte opcode
 spi_transfer(address);
 spi_transfer(value);
 digitalWrite(pCS,HIGH); //release chip, signal end transfer
}

void setDelay() {
 delayStop = config.delayTime;
 delayStop = delayStop * 1000 + millis();
 REMStop = 0;
 digitalWrite(pLED, LOW);
}

void reality() {
 testStop = config.testTime;
 testStop = testStop * 1000 + millis();
}

void setup()
{
 Serial.begin(BAUDRATE);
 byte clr;
 pinMode(pMOSI, OUTPUT);
 pinMode(pMISO, INPUT);
 pinMode(pSCK, OUTPUT);
 pinMode(pCS, OUTPUT);
 pinMode(pLED, OUTPUT);
 digitalWrite(pCS, HIGH);
 
 SPCR = (1<<SPE)|(1<<MSTR);
 clr = SPSR;
 clr = SPDR;
 delay(10);

 EEPROM_read(0, config);

 write_pot(rAMP1, config.amp1Gain);
 write_pot(rAMP2, config.amp2Gain);
 write_pot(rLED, config.ledBrightness);
 
 attachInterrupt(bDELAY, setDelay, LOW);
 attachInterrupt(bTEST, reality, LOW);
}

void doInput() {
 char key[25];
 char value[25];
 if(Serial.read() != '#') {
   Serial.flush();
   return;
 }
 for(int i = 0; i < 25; i++) {
   char c = Serial.read();
   if(c == '=') {
     key[i] = '\0';
     break;
   } else {
     key[i] = c;
   }
 }
 for(int i = 0; i < 25; i++) {
   char c = Serial.read();
   if(c == '\r' || c == '\n') {
     value[i] = '\0';
     break;
   } else {
     value[i] = c;
   }
 }
   if(!strcmp("amp1Gain", key)) {
     if(!strcmp("u", value)) {
       if(config.amp1Gain < 255)
         config.amp1Gain++;
     } else if(!strcmp("d", value)) {
       if(config.amp1Gain > 0)
         config.amp1Gain--;
     } else {
       config.amp1Gain = atoi(value);
     }
     write_pot(rAMP1, config.amp1Gain);
   } else if(!strcmp("amp2Gain", key)) {
     if(!strcmp("u", value)) {
       if(config.amp2Gain < 255)
         config.amp2Gain++;
     } else if(!strcmp("d", value)) {
       if(config.amp2Gain > 0)
         config.amp2Gain--;
     } else {
       config.amp2Gain = atoi(value);
     }
     write_pot(rAMP2, config.amp2Gain);
   } else if(!strcmp("EOGREMHi", key)) {
     if(!strcmp("u", value)) {
       if(config.EOGREMHi < 1024)
         config.EOGREMHi++;
     } else if(!strcmp("d", value)) {
       if(config.EOGREMHi > 0)
         config.EOGREMHi--;
     } else {
       config.EOGREMHi = atoi(value);
     }
   } else if(!strcmp("EOGREMLo", key)) {
     config.EOGREMLo = atoi(value);
   } else if(!strcmp("ledBrightness", key)) {
     config.ledBrightness = atoi(value);
     write_pot(rLED, config.ledBrightness);
   } else if(!strcmp("ledOnTime", key)) {
     config.ledOnTime = atoi(value);
   } else if(!strcmp("ledOffTime", key)) {
     config.ledOffTime = atoi(value);
   } else if(!strcmp("delayTime", key)) {
     config.delayTime = atoi(value);
   } else if(!strcmp("REMAlarm", key)) {
     config.REMAlarm = atoi(value);
   } else if(!strcmp("REMTime", key)) {
     config.REMTime = atoi(value);
   } else if(!strcmp("testTime", key)) {
     config.testTime = atoi(value);
   } else if(!strcmp("startTime", key)) {
     startTime = millis();
   }
   EEPROM_write(0, config);
}
void loop()
{
 if(Serial.available()) {
     doInput();
 } else {
   thisMillis = millis();
   int eog = analogRead(pAMP2OUT);
   if(eog >= config.EOGREMHi || eog <= config.EOGREMLo) {
     if(thisMillis < delayStop) {
         delayStop = config.delayTime;
         delayStop = delayStop * 1000 + thisMillis;
     } else if(!REMStop) {  
       REMStop = config.REMTime;
       REMStop = REMStop * 1000 + thisMillis;
       digitalWrite(pLED, HIGH);
       ledOn = 1;  
       lastMillis = thisMillis;
     } else {
       REMStop = config.REMTime;
       REMStop = REMStop * 1000 + thisMillis;
     }
   }
 if(REMStop && thisMillis > REMStop) {
   REMStop = 0;
   digitalWrite(pLED, LOW);
 }
 if(REMStop || thisMillis < testStop) {
   if(!ledOn) {
     if(thisMillis - lastMillis >= config.ledOffTime) {
       digitalWrite(pLED, HIGH);
       ledOn = 1;
       lastMillis = thisMillis;
     }
   } else {
     if(thisMillis - lastMillis >= config.ledOnTime) {
       digitalWrite(pLED, LOW);
       ledOn = 0;
       lastMillis = thisMillis;
     }
   }
 }    
 if(testStop && thisMillis > testStop) {
   testStop = 0;
   digitalWrite(pLED, LOW);
 }
 //EOG,REM,SLEEPDELAY,AMP1GAIN,AMP1OUT,AMP2GAIN,EOGREMHI,EOGREMLO,REMTIMEOUT
 Serial.print(thisMillis - startTime);
 Serial.print(",");
 Serial.print(eog);
 Serial.print(",");
 if(REMStop) { Serial.print("1024"); } else { Serial.print("0"); }
 Serial.print(",");
 if(delayStop > thisMillis) {
   unsigned long x = config.delayTime;
   Serial.print(map(delayStop - thisMillis, 0, x * 1000, 0, 1024));
 } else {
   Serial.print("0");
 }
 Serial.print(",");
 //Serial.print(map(config.amp1Gain,0,255,0,1024));
 //Serial.print(",");
 //Serial.print(analogRead(pAMP1OUT));
 //Serial.print(",");
 //Serial.print(map(config.amp2Gain,0,255,0,1024));
 //Serial.print(",");
 Serial.print(config.EOGREMHi);
 Serial.print(",");
 Serial.print(config.EOGREMLo);
 Serial.print(",");
 if(thisMillis > REMStop) {
   Serial.print("0");
 } else {
   unsigned long y = config.REMTime;
   Serial.print(map(REMStop - thisMillis, 0, y * 1000, 0, 1024));
 }
 Serial.println();
 
 }  
}
Title: Re: ArduDreamer
Post by: merkz on Mar 11, 2010, 06:08 pm
I use this on the PC side to collect the data from arduino and output it to the file KST monitors for graphing.  Theres no flow control between the arduino and PC so it does some checks to make sure the data "looks" correct since it sometimes gets messed up if the receive buffer overflows

Code: [Select]

#include <sys/timeb.h>
#include <unistd.h>
#include <stdio.h>

int main(int argc,char *argv[])
{
       struct timeb tp;
       ftime(&tp);

       FILE * outfile;
       FILE * serial;

       serial = fopen(argv[1], "w+");
       outfile = fopen("dream", "w");

       //sync time on arduino
       fprintf(serial, "#startTime=startTime");

       char data[100];
       char buff[100];

       char *pdata = data;
       char *pbuff = buff;

       int seps = 0;

       unsigned long a_ms;
       int a_eog;
       int a_rem;
       int a_delay;
       int a_eoghi;
       int a_eoglo;
       int a_remt;

       unsigned long pa_ms = 0;

       int go = 0;

       while (1)
       {
               pdata = data;
               pbuff = buff;
               a_ms = 0;
               a_rem = -1;
               a_delay = -1;
               a_eoghi = -1;
               a_eoglo = -1;
               a_remt = -1;
               seps = 0;

               fgets(data, 100, serial);

               //parse string from arduino
               while(*pdata != '\0') {
                       if(*pdata == ',' || *pdata == '\r' || *pdata == '\n') {
                               *pbuff = '\0';
                               if(seps == 0)
                                       a_ms = atoi(buff);
                               else if(seps == 1)
                                       a_eog = atoi(buff);
                               else if(seps == 2)
                                       a_rem = atoi(buff);
                               else if(seps == 3)
                                       a_delay = atoi(buff);
                               else if(seps == 4)
                                       a_eoghi = atoi(buff);
                               else if(seps == 5)
                                       a_eoglo = atoi(buff);
                               else if(seps == 6)
                                       a_remt = atoi(buff);
                               seps++;

                               pbuff = buff;
                               pdata++;
                               continue;
                               if(*pdata == '\r' || *pdata == '\n')
                                       break;
                       } else {
                               *pbuff++ = *pdata++;
                       }
               }

               //do some data sanity checks
               if(seps != 8)
                       continue;
               if(a_ms < 1)
                       continue;
               if(a_eog < 0 || a_eog > 1024)
                       continue;
               if(a_rem != 0 && a_rem != 1024)
                       continue;
               if(a_delay < 0  || a_delay > 1024)
                       continue;
               if(a_eoghi < 512 || a_eoghi > 1024)
                       continue;
               if(a_eoglo < 0 || a_eoglo > 512)
                       continue;
               if(a_remt < 0 || a_remt > 1024)
                       continue;

               //dont log until timer resets on arduino
               if(!go) {
                       if(a_ms > 1000) {
                               printf("%i,%d\n", go, a_ms);
                               continue;
                       } else {
                               printf("%i,%d\n", go, a_ms);
                               go = 1;
                       }
               }

               //use timer from arduino as offset to start time
               int msec = a_ms % 1000;
               a_ms = a_ms/1000 + tp.time;
               if(a_ms > pa_ms + 1) {
                       pa_ms = a_ms;
                       continue;
               }
               msec = msec + tp.millitm;
               if(msec > 999) {
                       msec = msec - 1000;
                       a_ms++;
               }

               //need msec displayed as thousandths with no leading 0
               char fs[10];
               float f = msec;
               sprintf(fs, "%.3f", f/1000);
               char *fp = fs[1];

               //write to log
               fprintf(outfile,"%ld%s,%s",a_ms,fp,data);
       }
       fclose(serial);
       fclose(outfile);
       return 0;
}
Title: Re: ArduDreamer
Post by: merkz on Mar 11, 2010, 06:12 pm
KST file for graphing the data (part 1)

Code: [Select]

<?xml version="1.0" encoding="UTF-8"?>
<kstdoc version="1.3">
 <windowsize>
   <width>1066</width>
   <height>853</height>
   <active name="W1"/>
 </windowsize>
 <graphicsautosave time="1" enabled="false" format="PNG" xsize="640" ysize="480" display="0" square="false" />
 <kstfile>
   <tag>DS-dream</tag>
   <filename>/home/user/dream</filename>
   <type>ASCII</type>
   <index vector="INDEX" interpretation="1"/>
   <comment delimiters="#/c!;"/>
   <columns type="2" delimiters=","/>
   <header start="10"/>
 </kstfile>
 <scalar>
   <tag>P1/XMin</tag>
   <orphan/>
   <value>1268324681.1026</value>
 </scalar>
 <scalar>
   <tag>P1/XMax</tag>
   <orphan/>
   <value>1268325026.1234</value>
 </scalar>
 <scalar>
   <tag>P1/YMin</tag>
   <orphan/>
   <value>0</value>
 </scalar>
 <scalar>
   <tag>P1/YMax</tag>
   <orphan/>
   <value>1024</value>
 </scalar>
 <vector>
   <tag>DS-dream/1</tag>
   <provider>DS-dream</provider>
   <filename>/home/user/dream</filename>
   <field>1</field>
   <start>0</start>
   <num>-1</num>
 </vector>
 <vector>
   <tag>DS-dream/1-1</tag>
   <provider>DS-dream</provider>
   <filename>/home/user/dream</filename>
   <field>1</field>
   <start>0</start>
   <num>-1</num>
 </vector>
 <vector>
   <tag>DS-dream/3</tag>
   <provider>DS-dream</provider>
   <filename>/home/user/dream</filename>
   <field>3</field>
   <start>0</start>
   <num>-1</num>
 </vector>
 <vector>
   <tag>DS-dream/4</tag>
   <provider>DS-dream</provider>
   <filename>/home/user/dream</filename>
   <field>4</field>
   <start>0</start>
   <num>-1</num>
 </vector>
 <vector>
   <tag>DS-dream/5</tag>
   <provider>DS-dream</provider>
   <filename>/home/user/dream</filename>
   <field>5</field>
   <start>0</start>
   <num>-1</num>
 </vector>
 <vector>
   <tag>DS-dream/6</tag>
   <provider>DS-dream</provider>
   <filename>/home/user/dream</filename>
   <field>6</field>
   <start>0</start>
   <num>-1</num>
 </vector>
 <vector>
   <tag>DS-dream/7</tag>
   <provider>DS-dream</provider>
   <filename>/home/user/dream</filename>
   <field>7</field>
   <start>0</start>
   <num>-1</num>
 </vector>
 <vector>
   <tag>DS-dream/8</tag>
   <provider>DS-dream</provider>
   <filename>/home/user/dream</filename>
   <field>8</field>
   <start>0</start>
   <num>-1</num>
 </vector>
 <curve>
   <tag>1-1</tag>
   <xvectag>DS-dream/1</xvectag>
   <yvectag>DS-dream/1-1</yvectag>
   <legend></legend>
   <interp>0</interp>
   <hasMinus/>
   <color>#00aa00</color>
   <hasLines/>
   <lineWidth>0</lineWidth>
   <lineStyle>0</lineStyle>
   <pointType>0</pointType>
   <pointDensity>0</pointDensity>
   <barStyle>0</barStyle>
 </curve>
 <curve>
   <tag>3</tag>
   <xvectag>DS-dream/1</xvectag>
   <yvectag>DS-dream/3</yvectag>
   <legend>EOG</legend>
   <interp>0</interp>
   <hasMinus/>
   <color>#009999</color>
   <hasLines/>
   <lineWidth>0</lineWidth>
   <lineStyle>0</lineStyle>
   <pointType>0</pointType>
   <pointDensity>0</pointDensity>
   <barStyle>0</barStyle>
 </curve>
 <curve>
   <tag>4</tag>
   <xvectag>DS-dream/1</xvectag>
   <yvectag>DS-dream/4</yvectag>
   <legend></legend>
   <interp>0</interp>
   <hasMinus/>
   <color>#000001</color>
   <lineWidth>0</lineWidth>
   <lineStyle>0</lineStyle>
   <pointType>0</pointType>
   <pointDensity>0</pointDensity>
   <hasBars/>
   <barStyle>1</barStyle>
 </curve>
 <curve>
   <tag>5</tag>
   <xvectag>DS-dream/1</xvectag>
   <yvectag>DS-dream/5</yvectag>
   <legend>Delay Timeout</legend>
   <interp>0</interp>
   <hasMinus/>
   <color>#990099</color>
   <hasLines/>
   <lineWidth>0</lineWidth>
   <lineStyle>0</lineStyle>
   <pointType>0</pointType>
   <pointDensity>0</pointDensity>
   <barStyle>0</barStyle>
 </curve>
 <curve>
   <tag>6</tag>
   <xvectag>DS-dream/1</xvectag>
   <yvectag>DS-dream/6</yvectag>
   <legend>REM Threshold (R)</legend>
   <interp>0</interp>
   <hasMinus/>
   <color>#ff0000</color>
   <hasLines/>
   <lineWidth>0</lineWidth>
   <lineStyle>0</lineStyle>
   <pointType>0</pointType>
   <pointDensity>0</pointDensity>
   <barStyle>0</barStyle>
 </curve>
 <curve>
   <tag>7</tag>
   <xvectag>DS-dream/1</xvectag>
   <yvectag>DS-dream/7</yvectag>
   <legend>REM Threshold (L)</legend>
   <interp>0</interp>
   <hasMinus/>
   <color>#1717c8</color>
   <hasLines/>
   <lineWidth>0</lineWidth>
   <lineStyle>0</lineStyle>
   <pointType>0</pointType>
   <pointDensity>0</pointDensity>
   <barStyle>0</barStyle>
 </curve>
Title: Re: ArduDreamer
Post by: merkz on Mar 11, 2010, 06:13 pm
KST file for graphing the data (part 2).   I'll post schematic for the board soon.

Code: [Select]


 <curve>
   <tag>8</tag>
   <xvectag>DS-dream/1</xvectag>
   <yvectag>DS-dream/8</yvectag>
   <legend>REM Timeout</legend>
   <interp>0</interp>
   <hasMinus/>
   <color>#4f4c51</color>
   <hasLines/>
   <lineWidth>0</lineWidth>
   <lineStyle>0</lineStyle>
   <pointType>0</pointType>
   <pointDensity>0</pointDensity>
   <barStyle>0</barStyle>
 </curve>
 <plot>
   <border color="#000000" width="0" padding="0" margin="0" />
   <tag>P1</tag>
   <aspect x="0" y="0" w="1" h="1" />
   <idealsize w="1062" h="764" />
   <name>P1</name>
   <borderColor>#000000</borderColor>
   <borderWidth>0</borderWidth>
   <foregroundColor>#000000</foregroundColor>
   <backgroundColor>#ffffff</backgroundColor>
   <margin>0</margin>
   <padding>0</padding>
   <xscalemode>0</xscalemode>
   <yscalemode>6</yscalemode>
   <xscalemodedefault>0</xscalemodedefault>
   <yscalemodedefault>5</yscalemodedefault>
   <xmin>1268324681.1026</xmin>
   <xmax>1268325026.1234</xmax>
   <ymin>0</ymin>
   <ymax>1024</ymax>
   <xreversed>0</xreversed>
   <yreversed>0</yreversed>
   <yminexp>0</yminexp>
   <ymaxexp>1024</ymaxexp>
   <toplabel>
     <text></text>
     <interpret/>
     <rotation>0</rotation>
     <justify>1</justify>
     <fontfamily>DejaVu Sans</fontfamily>
     <size>12</size>
   </toplabel>
   <xlabel>
     <text>Column 1</text>
     <interpret/>
     <rotation>0</rotation>
     <fontfamily>DejaVu Sans</fontfamily>
     <size>12</size>
   </xlabel>
   <ylabel>
     <text></text>
     <interpret/>
     <rotation>270</rotation>
     <fontfamily>DejaVu Sans</fontfamily>
     <size>12</size>
   </ylabel>
   <xticklabel>
     <text>[0]</text>
     <interpret/>
     <rotation>0</rotation>
     <fontfamily>DejaVu Sans</fontfamily>
     <size>12</size>
   </xticklabel>
   <yticklabel>
     <text>1000</text>
     <interpret/>
     <rotation>0</rotation>
     <fontfamily>DejaVu Sans</fontfamily>
     <size>12</size>
   </yticklabel>
   <xfullticklabel>
     <text>03/11/2010 10:30:00 [seconds]</text>
     <interpret/>
     <rotation>0</rotation>
     <fontfamily>DejaVu Sans</fontfamily>
     <size>12</size>
   </xfullticklabel>
   <xlogbase>10</xlogbase>
   <ylogbase>10</ylogbase>
   <curvetag>4</curvetag>
   <curvetag>8</curvetag>
   <curvetag>5</curvetag>
   <curvetag>6</curvetag>
   <curvetag>7</curvetag>
   <curvetag>3</curvetag>
   <xmajorgrid>0</xmajorgrid>
   <ymajorgrid>0</ymajorgrid>
   <xminorgrid>0</xminorgrid>
   <yminorgrid>0</yminorgrid>
   <majorgridcolor>#808080</majorgridcolor>
   <minorgridcolor>#808080</minorgridcolor>
   <majorgridcolordefault>1</majorgridcolordefault>
   <minorgridcolordefault>1</minorgridcolordefault>
   <majorpenwidth>1</majorpenwidth>
   <minorpenwidth>1</minorpenwidth>
   <axispenwidth>1</axispenwidth>
   <xminorticks>-1</xminorticks>
   <yminorticks>-1</yminorticks>
   <xmajorticks>5</xmajorticks>
   <ymajorticks>5</ymajorticks>
   <xticksinplot>1</xticksinplot>
   <xticksoutplot>0</xticksoutplot>
   <yticksinplot>1</yticksinplot>
   <yticksoutplot>0</yticksoutplot>
   <suppresstop>0</suppresstop>
   <suppressbottom>0</suppressbottom>
   <suppressleft>0</suppressleft>
   <suppressright>0</suppressright>
   <xtransformed>0</xtransformed>
   <ytransformed>0</ytransformed>
   <xtransformedexp></xtransformedexp>
   <ytransformedexp></ytransformedexp>
   <xinterpret>1</xinterpret>
   <xinterpretas>1</xinterpretas>
   <xdisplayas>4</xdisplayas>
   <yinterpret>0</yinterpret>
   <yinterpretas>1</yinterpretas>
   <ydisplayas>4</ydisplayas>
   <xoffsetmode>0</xoffsetmode>
   <yoffsetmode>0</yoffsetmode>
   <stylemarker>0</stylemarker>
   <widthmarker>0</widthmarker>
   <colormarker>#000000</colormarker>
   <defaultcolormarker>1</defaultcolormarker>
   <autoLabelTop>1</autoLabelTop>
   <autoLabelX>1</autoLabelX>
   <autoLabelY>1</autoLabelY>
 </plot>
 <window>
   <tag>W1</tag>
   <restore x="2" y="2" w="1062" h="764" />
   <internal x="2" y="2" w="1062" h="764" />
   <name>W1</name>
   <backgroundColor>#efefef</backgroundColor>
   <Plot>
     <tag>P1</tag>
     <Legend>
       <border color="#000000" width="2" padding="0" margin="0" />
       <border color="#000000" width="2" padding="0" margin="0" />
       <tag>Object 165</tag>
       <aspect x="0.028248587570621" y="0.73429319371728" w="0.2" h="0.1" />
       <idealsize w="1" h="1" />
       <name>unnamed</name>
       <borderColor>#000000</borderColor>
       <borderWidth>2</borderWidth>
       <foregroundColor>#000000</foregroundColor>
       <backgroundColor>#ffffff</backgroundColor>
       <margin>0</margin>
       <padding>0</padding>
       <font></font>
       <fontSize>1</fontSize>
       <transparent>false</transparent>
       <trackContents>false</trackContents>
       <legendMargin>5</legendMargin>
       <vertical>true</vertical>
       <title></title>
       <curvetag>3</curvetag>
       <curvetag>5</curvetag>
       <curvetag>6</curvetag>
       <curvetag>7</curvetag>
       <curvetag>8</curvetag>
     </Legend>
   </Plot>
 </window>
</kstdoc>
Title: Re: ArduDreamer
Post by: quackmaster7000 on Mar 11, 2010, 09:52 pm
I have to say, this is a superb project. Probably the coolest application I have ever seen with the Arduino. I would be more than willing to assemble this circuit and make a nice finished product (if all the schematics are all in place...), giving you credit for the design. Very, very cool  8-)
Title: Re: ArduDreamer
Post by: merkz on Mar 13, 2010, 08:00 pm
Thanks

Here's the schematic

(http://img502.imageshack.us/img502/8284/schem.png)
Title: Re: ArduDreamer
Post by: creatrope on Mar 14, 2010, 01:37 am
Also interested in the pcb w/ or w/o parts kit if you make one.  I've tried my hand at a version of this, but am interested in trying yours.

-creatrope
Title: Re: ArduDreamer
Post by: Jeremy1998 on Mar 14, 2010, 04:59 am
please do make kits... thi is awsome...  ;)
Title: Re: ArduDreamer
Post by: cafmike on Apr 14, 2010, 05:50 am
very cool
Title: Re: ArduDreamer
Post by: rogajogey on Jun 04, 2010, 04:16 am
Awesome work!!! way to go, this is totally amazing.

Any new updates???

I was just reading about the zeo the other day and was really hoping someone could make such a device for lucid dreaming.

I got some questions for the creator

Why did you choose to track the eye movements through the temple and not the frontal lobes?

The zeo personal sleep coach tracks the frontal lobes which are located on the forehead using foam pads which you don't need to use any gel. They said their tech which they call softwave is patented and is based on polysomnography which they say is the most reliable way of detecting sleep cycles including REM and that this is what they use in sleep labs all around the world.

The zeo is a wireless device that communicates on the 2.4mhz band, the zeo alarm clock has an sd card which all the nights sleep data is recorded onto which can then be viewed by inserting it into a PC.

Will your device work via a cable to a PC/notebook that sits by your beside table?

Can you not make a console that communicates with the headband wireleslly  without needing a computer by your bed?

I see in your first post of this thread that your headband has the same tech like the remdreamer which is TWC for two way communication. The remdreamer has just got this new upgrade out which is a rem speaker that can work with TWC do you think your device could support this, the remspeaker allows you to record an audio clip which can be played when the rem sensor detects that you are dreaming.

I would love to see this device of yours being able to have the following features

wireless
TWC
light and beep cues
audio cues
console with microphone for recording audio cues (so no computer needed)
4 LED's for each eye, a light and sound machine upgrade for the future that could get your brainwaves ready for lucid dreaming. This is what the dreammaker pro has. Maybe we can forget this feature.

Anyway if you could have all those features and maybe or maybe not the last one then that would be so awesome.

I would love to see you building these as a complete unit and as well offering the flashed chip and parts for people to build it themselves.

Awesome and please keep up the great work, this is amazing work that really has got to be finished. The best idea I have seen in many years.

Thanks very much for reading
Title: Re: ArduDreamer
Post by: Cesar_1337 on Dec 10, 2010, 11:04 pm
I'm very interested in this subject as well. I would like to be updated on how this is going for you.
Title: Re: ArduDreamer
Post by: 2345 on Dec 22, 2010, 08:39 am
Hi all! My friend and I are engaged in the development of devices for lucid dreaming.

Made homemade REM-Dreamer (Novadreamer) - comfortable to sleep with him does not work, the mask presses on the head hard. So we decided to move to EOG - now doing an amplifier and a processing unit for DSP-processor.

This will be a platform consisting of EOG sensors, vibrating alert, Neurophone (for submission to the voice prompts sleep), as well as sensors on the neck to remove sounds of sleep - see Chuck Jorgensen
Dear merkz tell about their experiences with the EOG, let us cooperate in the field of devices for lucid dreaming.

P.S sorry for my english))) write through translator)))) ::)