It takes a few steps to get this demo up and running!
The environment variables in the code allow us to update it on GitHub without cleaning out personal data first ) A highly recommended step! To replicate the Arduino functionality with Particle involved updating NPM and the particle module then, editing the setup portion of the script to match Rick's example code and finally, updating the pin to D7 to use the Photon's built-in LED. With some tweaking, this should eventually enable you to carry the Thinker and Blinker parts around wirelessly, while the computer does all the processing from a dark corner. Then, type node index.js to launch the script on your computer and have at it :)Īlex decided to present this at Particle's Spectra conference, so she mashed up Moheeb's code with the Particle platform for NodeBots: Match the streaming port to the index.js script. Enter this in Muse Monitor (with your phone on the same network) and put that IP in the streaming settings. To run the code, open the script directory in your terminal and type ifconfig to find your computer's IP address on the network. The creepy whispering is just to mark when I focus/defocus.Īnd then, it was 5am and Alex headed home. This turned out to be the perfect level for Alex to focus and control the light bulb. Above the threshold, the LED turns on otherwise, it's off. The script also prints the current beta level to your terminal console. Then, we put the pieces together! Moheeb updated his code to pull in the streaming data and scrape it for the beta frequency channel, then set a threshold of attention at 0.29.
She tested first using the MuseLab application for Mac ( ), which can open a UDP receiver port and visualize the EEG data coming in from your brain. It gives some pretty great real-time data graphs right on your phone, but can also stream to another IP address on the same WiFi network. Meanwhile, Alex got the Muse device to stream data with the Muse Monitor iOS app. You can learn more by searching for NodeBots !
He uploaded the Firmata sketch to an Arduino, then wrote JavaScript code to drive the bulb, using Johnny-five to communicate with it: įirmata is a special "listener" sketch that sits on the microcontroller, and receives data over a USB serial connection. (He soldered jumper wires to it on the table at a fancy tea restaurant.) Voilà, idea lightbulb! It can run off one of the Arduino's output pins. Moheeb bought a low-power LED string and cut it in half, then stuffed it inside his cup. We had gotten dessert at a place that serves drinks in lightbulb-shaped cups, and cajoled them into selling us the cups separately.
That relates to a calm mental state, and gets a big boost when you close your eyes.įirst, we built this on an Arduino Pro Mini, late at night in Brooklyn after Maker Faire.
You could also take a more relaxed approach and use the alpha frequency band instead of beta for this. If you don't have visual feedback, you can also practice doing difficult math in your head – anything that requires strong focus. You can also watch the numbers or lines on the screen and will them to increase. Try not to move too much or clench your muscles. One easy way to drive up your beta activity is to simply will the light to turn on. In Alex's case, she practices turning the LED on and off for 5-10 seconds at a time, to convince the skeptics that the brain control is indeed real. For now, play around with the graphs and learn about the different EEG frequency bands (delta, theta, alpha, beta, gamma) and what they mean. You'll need to put in streaming settings, as described in the Arduino section below.
Install the Muse Monitor app on your phone: AWESOME.įirst, get familiar with your Muse before attempting this project: the better your connection with the electrodes, and your control over your brainwaves, the better the demo will be. More precisely, we're using a Muse EEG sensor to detect beta-range frequencies in the spectrum of electrical pulses that are constantly emitted by your brain! Then we pipe that through a NodeBots system to turn on a light – even over WiFi. Got a bright idea? Find out how bright, with this lightbulb that detects your mind's focus!