My open source EEG/ECG device (for lucid dreaming research) - Page 1
Forum section: electronics / projects

author: SolarSunrise
author_rank: Regular Contributor
timestamp: October 06, 2016, 01:43:37 pm
content: Hey guys.Wow, I realized that I haven't posted anything in the EEVBlog forum for quite a while now. Anyways, a few months back I built a working EEG acquisition device for a sleep apnea diagnosis system. But half way through the project, I realized that this can double as a lucid dreaming device. (by the way for those of you guys who don't know what it is, go google it up; it's fascinating) I was quite surprised that I actually succeeded in having a few lucid dreams using this thing. Well, I'm surprised that this thing even works at all...So here is a post that I wrote in Hackaday (https://hackaday.io/project/13285) that describes the project. I talk about pretty much everything (hardware, software, the algorithm for detecting REM sleep, etc.) and it is of course open source. I would also like to mention that as of right now, the code for it is quite awful -- this thing is held together by rogue C and assembly nightmare (but at least it works...)As always, feedback and questions are appreciated. Thanks guys!EDIT: Karel (thanks!) made a crucial point about how the device above could potentially be non-isolated from the mains. I should really emphasize the fact that the above design is only a crude prototype and should not be treated as a complete product. So use the project only as a reference!

author: Karel
author_rank: Super Contributor
timestamp: October 06, 2016, 03:38:08 pm
content: I do understand that this is a hobby project and not a medical device.However, I would never publish or use a circuit for biopotential measurements on humans without proper isolation.With your device, it's possible to connect the patient electrodes and the usb port at the same time!

author: SolarSunrise
author_rank: Regular Contributor
timestamp: October 06, 2016, 04:04:50 pm
content: Quote from: Karel on October 06, 2016, 03:38:08 pmThat is definitely true and I am very aware of the dangers associated with the design provided above. That is why I explicitly state in my documentation that the device shouldONLYused with isolated USB power bricks - my design only has a bluetooth for a connection to a computer, while the USB is only used for power. But nonetheless, as you've stated, the danger is still there.Thanks for pointing that out!

author: Karel
author_rank: Super Contributor
timestamp: October 06, 2016, 05:10:12 pm
content: Quote from: SolarSunrise on October 06, 2016, 04:04:50 pmUnfortunately, that's not enough. In most countries, you'll be still liable if an accident happens.A cheap but effective solution could be to remove the USB connector.Instead, connect the +5V and the ground to two unused pins of the EEG cable connector.Supply a custom made USB cable that has at one end the same EEG connector.This way, only one cable can be attached at a time. Much cheaper and simpler than adding an isolation barrier.

author: SolarSunrise
author_rank: Regular Contributor
timestamp: October 06, 2016, 05:46:18 pm
content: Quote from: Karel on October 06, 2016, 05:10:12 pmThat is a pretty good idea. In my other (more "official") prototypes, I used Analog Device's ADUM series for isolation, but I guess that will also work as well. By the way, I have and had absolutely no intention of selling or publishing the design above as fully functional, but only as an basic reference design. That's why the schematics, board layout, and the code for it is in such a mess! I actually refer people to OpenBCI (http://shop.openbci.com/collections/frontpage) if they are interested in replicating the hardware portion of my project. (a bit expensive, but much more proven piece of tech!)Again, thanks for your feedback!

author: Karel
author_rank: Super Contributor
timestamp: October 06, 2016, 06:01:43 pm
content: Quote from: SolarSunrise on October 06, 2016, 05:46:18 pmI have used them and got rid of them as soon as possible once we tried to pass EMC certification.Those Adum digital isolators, and specially the iso power versions, are a pain in the ass for radiated emissions.Specially in medical devices class CF where low patient leakage current requirements prohibits the use of acapacitor between floating and non-floating parts.