brutalchrist / cylon_mindwave_example

Example Cylonjs + OpenCV + Mindwave NeuroSky + Arduino

Home Page:https://medium.com/@sgonzalez_21505/mind-control-d839f1f06daf

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Mindwave NeuroSky + Arduino + OpenCV + CylonJS

Requirements

Software

Hardware

Setup

Hardware

Arduino

Diagram

Mindwave Hack

Mindwave Hack

Software

$ git clone git@github.com:brutalchrist/cylon_mindwave_example.git
$ cd cylon_mindwave_example/

Generate a marker and print it

$ mkdir marker_images
$ ar_markers_generate_marker 666
$ open marker_images/marker_666.png

Setup camera (python/markerdetect.py)

capture = cv2.VideoCapture(ID_CAMERA)

Test markerdetect

$ python python/markerdetect.py -d

Setup arduino devices (arduino_devices.py)

marker_id: {
	name: descriptive_device_name,
	action: function with action of device
},

Setup Cylon connections (Robot.js)

connections: {
	neurosky: {
		adaptor: "neurosky",
		port: '/dev/YOUR_MINDWAVE_PORT' 
	},
	arduino: {
		adaptor: 'firmata',
		port: '/dev/YOUR_ARDUINO_PORT' 
	}
}

And you arduino devices

devices: {
	headset: { driver: "neurosky", connection: 'neurosky'},
	descriptive_device_name: {
		driver: CYLON_DRIVERr,
		pin: PIN,
		connection: 'arduino'
	}
}

Add marker to device

Marker Device

Install node dependencies with yarn 🎉 (or npm 🤐)

$ yarn install 

Run!

$ node Robot.js

Light

https://www.youtube.com/watch?v=pHXh-h6WPWw