{"id":23977530,"url":"https://github.com/remrama/flicker","last_synced_at":"2025-04-14T01:15:54.447Z","repository":{"id":96765376,"uuid":"164051543","full_name":"remrama/flicker","owner":"remrama","description":"closed-loop device for LRLR eye signal detection and response during sleep","archived":false,"fork":false,"pushed_at":"2019-07-10T16:25:04.000Z","size":4221,"stargazers_count":12,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-04-14T01:15:26.459Z","etag":null,"topics":["arduino","lucid-dreaming","sleep","sleep-communication"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/remrama.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-04T03:10:54.000Z","updated_at":"2025-03-13T11:12:13.000Z","dependencies_parsed_at":"2023-04-16T07:17:24.818Z","dependency_job_id":null,"html_url":"https://github.com/remrama/flicker","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remrama%2Fflicker","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remrama%2Fflicker/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remrama%2Fflicker/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/remrama%2Fflicker/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/remrama","download_url":"https://codeload.github.com/remrama/flicker/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248804824,"owners_count":21164135,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arduino","lucid-dreaming","sleep","sleep-communication"],"created_at":"2025-01-07T07:44:45.597Z","updated_at":"2025-04-14T01:15:54.407Z","avatar_url":"https://github.com/remrama.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# flicker\n\n\u003cp align=center\u003e\n\u003cimg src=./images/device-cartoon.jpg width=30% /\u003e\n\u003c/p\u003e\n\n\n### Summary\nDuring a lucid dream, the dreamer can control their physical eyes by performing directed eye movements within the dream. We built a closed-loop device, _flicker_, to be worn during sleep that monitors for intentional horizontal saccades (i.e., [“flicks”](#how-to-flick)). Upon flick detection, the device plays audio back to the dreamer via bone conduction. Bone conduction plays audio by vibrating bones in the skull rather than the conversion of sound waves through the ear, which results in a sensation of audio playing from “inside the head.” Because the audio can be triggered within the dream, a benefit of _flicker_ is that one can perform external sensory stimulation experiments without an experimenter triggering the stimulation. See [usage](#usage).\n\nThe **hardware** is primarily a combination of Arduino microcontroller, MyoWare muscle sensor, and Adafruit audio amplifier (see [parts list](#parts-list)). Outside of the Arduino code placed on the Teensy board, all **software** is in Python (see [conda environment file](./environment.yml) for requirements) driven largely by [PyQt](https://riverbankcomputing.com/software/pyqt/intro), [PyQtGraph](http://www.pyqtgraph.org/), and a [custom \"flick detection\" algorithm](./src/detectorClass.py) using the [SciPy stack](https://www.scipy.org/).\n\n\u003cp align=center\u003e\n\u003cimg src=./images/device-wear.jpg width=18% align=center /\u003e\n\u003cimg src=./images/gui-lrlr.png width=60% align=center /\u003e\n\u003c/p\u003e\n\n\n### Usage\n1. Secure sensor near right eye and stimulator on forehead.\n2. Start listening for flicks. `$ python runall.py`\n3. Go to sleep, become lucid, [send a flick signal](#how-to-flick), and listen for audio.\n4. Wake up and end the session by X'ing out the _flicker_ GUI.\n5. Check the log file (using any text editor) to see if your flick was detected.\n\n\n### How to flick\nSee section 9.1 of [Baird et al., 2019](https://doi.org/10.1016/j.neubiorev.2019.03.008) for in-depth discussion about signaling with eye movements from within a lucid dream. Here, we adopt their suggested set of instructions for sending a signal from a lucid dream:\n\u003e When making an eye movement signal, we would like you to look all the way to the left then all the way to the right two times consecutively, as if you are looking at each of your ears. Specifically, we would like you to look at your left ear, then your right ear, then your left ear, then your right ear, and then finally back to center. Make the eye movements without moving your head, and make the full left-right-left-right-center motion as one rapid continuous movement without pausing.\n\nThe EOG signal typically results in something like this:\n\u003cimg src=./images/baird2019-fig1_lrlr.png width=10% align=top /\u003e\n\nBut because of the MyoWare sensor's on-board processing, in *flicker*'s case it should look something like this:\n\u003cimg src=./images/lrlr.png width=10% align=top /\u003e\n\n\n### Parts list\nThe circuit board was designed using [Autodesk EAGLE](https://www.autodesk.com/products/eagle/overview) and ordered through [OSH Park](https://oshpark.com/). Design files/specifications are available in the [design](./design/) directory. Custom casings for the [controller](https://cad.onshape.com/documents/ed15d5b42aa4e13c9ebdd001/w/4501215e34b319a0e4282dd3/e/fc6b625667ca0f5b9852f31f) and [sensor](https://cad.onshape.com/documents/ed15d5b42aa4e13c9ebdd001/w/4501215e34b319a0e4282dd3/e/f00a7b5da7534cec24908e40) were designed using [Onshape](https://www.onshape.com/) and 3D printed locally. The USB isolator case design was pulled from [cyrusdreams](https://www.thingiverse.com/thing:1592996) on [Thingiverse](https://www.thingiverse.com/).\n\n| part | description | price |\n| ---- | ----------- | ----: |\n| [Teensy 3.6](https://www.pjrc.com/store/teensy36.html) | microcontroller board | 30 |\n| [MyoWare muscle sensor](https://www.sparkfun.com/products/13723) | EOG sensor | 38 |\n| [Adafruit TPA2012](https://www.adafruit.com/product/1552) | audio amplifier | 10 |\n| [Soberton E-12041808](https://www.soberton.com/e-12041808/) | bone conduction speaker | 3 |\n| [Adafruit USB isolator](https://www.adafruit.com/product/2107) | safety | 35 |\n| [Miscellaneous](#link2wikipage) | \u0026nbsp; | 20 |\n| \u0026nbsp; | \u0026nbsp; | **$136** |\n\n\u003cp align=center\u003e\n\u003cimg src=./images/device.jpg width=15% align=center /\u003e\n\u003cimg src=./images/base-open.jpg width=15% align=center /\u003e\n\u003cimg src=./images/sensor-under.jpg width=15% align=center /\u003e\n\u003cimg src=./images/sensor-wear.jpg width=15% align=center /\u003e\n\u003cimg src=./images/device-wear.jpg width=15% align=center /\u003e\n\u003c/p\u003e\n\n\n\u003cbr\u003e\u003cbr\u003e\n\n---\n\u003cp align=center\u003e\n\u003cimg src=https://imgs.xkcd.com/comics/tcmp.png width=90% /\u003e\u003cbr\u003e\n\u003ca href=https://xkcd.com/269/\u003exkcd\u003c/a\u003e\n\u003c/p\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremrama%2Fflicker","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fremrama%2Fflicker","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fremrama%2Fflicker/lists"}