Intro: Mind-Controlled Traffic Light Using Arduino and MindFlex
Hi everyone,this is my first instructable.Today i will show you how to make a simple traffic light controlled by your brainwaves using the EEG toy MindFlex. This is a very simple and basic project,but the uses of the MindFlex Hack are much much more.
For this project you will need the following parts:
- 1 Arduino UNO R3
- 1 Breadboard
-1 MindFlex Headset
-1 Green LED
-1 Yellow LED
-1 Red LED
- 3 330 Ohm Resistors
-Hot Glue Gun
-Arduino Brain Library
Note: To install the Brain library you have to put the brain folder inside the arduino "Libraries" folder.
Step 1: Hacking the MindFlex Headset
Hacking the headset is very very simple. It has two cases,one for the battery and one for the circuit.You have to open the circuit case and look for a small board (The NeuroSky board).There you will see a pin named " T " .If you look the entire circuit you will also see a place where the battery is connected.You have to solder (Very Carefully) a wire to the " T " pin,and another to the negative pin of the battery.
Once done this,you have to drill a small hole in the case where the wires will pass,and i suggests that you put a small dab of hot glue there so the wires won't move.
Done this,we can proceed to the next step.
Step 2: Make the Circuit
The circuit is a standard traffic light circuit.You have to connet a GND pin of the Arduino to the negative rail of the Breadboard (Sorry,i forgot to connect the rail to the arduino GND on the scheme).Then,you have to connect the anode (Long Leg) of the green LED to the Arduino pin 2, the anode of the yellow LED to the Arduino pin 4 and the anode of the red LED to the Arduino pin 7 (But you can also use the PWM pins).Done this,you have to connect the cathode (Short Leg) of the three LEDs to the ground rail using the three resistors.
After this,you have to connect the ground wire of the MindFlex to the Arduino ground,and the " T " wire to the arduino 0 (RX) pin.
Now you have to upload the code (remove the wire connected to the RX pin first,and reconnect it after the code is uploaded,because the Arduino IDE can show an error).
Step 3: The Code
Here is the code :