REM Detecting LED Goggle Device Nova Dreamer Wanna Be Thing

Hey MeusOpusMagnus,

your new device looks great. I am also building the Kvasar device and I am finished alreday except for progamming the PIc16F84 though. I tried several tricks to solve the program including emailing brindefalk and the makers of the Ek project programmer. however, it seams it doesnt work for me and my windows XP. but I found a solution which is sending in my PIC chips to an electronic shop, that will progrma the chip with the correct code for about 3$. I guess thats is a deal.
also, I hop to post some pics of my kvasar soon

Very best wishes,

Thomas

getting it programmed is a really good idea, i didn’t know you could actually do this… i mean, i assumed it could be done by some store, but i never really looked into it.

windows XP is a bit tricky, it needs a driver and you have to use Windows API instead of the IO settings on the software. Also, the voltage in your socket may not be good or the IO delay needs to be played with if you do use IO… I just used this old 486 i have and that works great so i guess you could see if any of your friends has an old computer lying around.

I also e-mailed Bjorn and the guy who wrote the JAL software, asking them both about the programming difference between 16f84 and 16f84a and they both replied the chips are supposed to be 100% compatible.

So i shoved some batteries in my almost finished mask (missing the leds that are attached and the sensor) and I pushed the buttons like described in the manual. I got the right beeps when expected, so it WORKS (so far hehe, i don’t know if the leds flicker and if the sensor will work, but at least i know the button functions all work well)…

MeusOpusMagnus

sounds like you did it. Let us know how it works.

That’s great that someone already made schematics (and that sensor is available at the local electronics store :smile: ).

I glanced at the source for it and it looks like the trick is to calibrate the infra-red LED to the lowes level that is detected when the eyelid is still (this is done with the mask on). Once you have done that the slightest change in the eyelid will probably disrupt the signal temporarly which is detected by the micro controller.

I think the biggest problem will be to build one that’s comfortable enough to sleep with.

lol, if you’re planning to build one, you might wanna buy a couple of those sensors as soon as you can :smile: if they’re gone from that store you’ll have a really nasty time getting them.

i HOPE mine are in by now… ooooh, if they left Michigan on Wednesday they should be here in a week or so I suppose, so in a few days I’ll be able to finish my mask and see how it works. The LEDs are already in, the switch is halfway on, the batteries are connected… all i need to do is mount the electronics on the mask, but that i’ll only be able to do when I get the sensor, so I can know how short to cut the wires and where to place everything…

waits :spinning:

The local electronics store is actually part of a chain called ELFA that has pretty much everything. Im sure they will have it in stock.

By the way I’ll probably try to make my own design with a small AVR microcontroller instead of the PIC. But i won’t have time now i’ll have to wait until the semester is over.

Edit: lol better move to Sweden if you want convinient electronics-shoping :tongue:

yeah, i saw the elfa website and i thought maybe i could order it from there, but i couldn’t figure out if they’d ship overseas… they had some weird thing about the pickup at some store or another, so i just gave up and tried to find it somewhere in north america :smile:

oh well…

:cool_laugh: i got my two samples of the S4810 from Hamamatsu :happy: … I was so excited for the whole day (they were shipped to school cause they wanted a “company” address to deliver to)…

There’s a text on the box that says something about them being excited to send out samples, let them know how they work, blah blah and send them back when you’re done with them :eh: but they were so little i LOST THEM IN A MASK !!! I CAN’T SEND THEM BACK !!! :wink: i mean they’re about 1-2$ so i assume they’re talking about bigger, pricier samples… oh well

it was the last thing missing!!! now i can finish my mask and party on hehehe :happy:

BOOYEAH !

Good luck. I hope it works well for you.

You know, if there is a way to hook a PIC to a USB port for data transfer, you could have advanced functions, such as REM state reports and such. You would probably want some form of solid state memory chip also.

That PIC has 64 bytes of EEPROM which could be used to store some information. One byte for the amount of times it triggered during the night, one for how many times you pushed the RC-button, two bytes for how many seconds you had between two given REM periods and so on. Could be interesting. If i make one i would probably use a smaller chip by Atmel called tiny15, which also has the same amount of EEPROM.

I think you need an USB-interface chip for USB-support. Unless you know enough about USB to program your own routines for sending data directly from the pic.

Yeah, you may need a seperate chip to handle the USB.

I’ve thought up some goals towards the perfect microcontroller-controlled ‘Lucidity Mask’:

  • RC-Button (helps prolong lucidity in FAs)
  • Timer-based trigger
  • REM detection
  • Remembering when the REMs were detected
  • Some method of getting that info into the computer (parallel, serial, usb ports)
  • Ability to recalibrate the system

Does anyone think this could be done with PIC chips?

It sounds like a perfect example of what you can do with a microcontroller. Have you programed in assembler before?

I’ve played around with it once. I know the basic concepts though.

The source for the kvasar mask is written in some high level language called “jal”. Seems easy enough but the source and it’s comments is in swedish. Easy for me to understand and modify, but maybe not for you? :smile:

Most of your features are already coded in it from the looks of the source.

EDIT: I think you missed the link on the other page, look here for more on the kvasar: brindefalk.solarbotics.net/kvasar/kvasar.html

EDIT_2: I just noticed he included a translated version of the source. A good opportunity to brush up on your swedish. :smile:

I found an interesting microcontroller on microchip’s (the guys who made the PIC architecture) site that can handle USB.

PIC16C745

I could code this thing if you wanted, and then you test it out (i dont think i’ll be able to get my hands on the equipment to work with these things until i’m 16)

I am not sure but i think that the C in PIC16C745 means that it is not reprogramable. You can only program it once. The F models are reprogramable (correct me if i’m wrong).

I am going to build a programmer for Atmel AVR:s instead. They are more versatile and a little more expensive. But i figured that i will only buy one for each project i make anyway.

Ohwell, whatever works best for you.

Seriously, I would like to see work on a guide for an advanced dream mask that can be programmed both by buttons on the unit and companion software.

F is flash and C is for some other thing you can reprogram if you can erase the chip with UV or something… i know reading both are reprogramable, but the F is the easy one to do so.

But you’re right, the C ones you usually program once and that’s it…

… i got my project together, all hooked up right but it’s not calibrating. there’s two reasons this may be happening:

1- the chip’s not programmed right … i sometimes get an error message so i don’t know how well it gets programmed even when i don’t get the error…

2- hiding under the blankets in the basement is not enough darkness for the sensor (but that’s a bit weird)

… or maybe i didn’t calibrate the IR led properly, i’ll play with that some more…

meanwhile I e-mailed Bjorn and asked about these things, i hope he’ll reply soon.

I’d try reprogramming the chip (if you can)