1. Introduction
Imagine controlling a robot just by focusing your thoughts. This project uses a NeuroSky MindWave Mobile 2 headset to detect brainwaves (EEG). We specifically track the "Attention" level. When you concentrate, the headset sends data via Bluetooth to an Arduino, which then triggers the robot to move. This technology is a game-changer for assistive robotics, helping people with limited mobility control devices using their minds.
2. Components
Arduino Uno or Nano (The brain of the robot)
NeuroSky MindWave Mobile 2 Headset (To read EEG signals)
HC-05 Bluetooth Module (To receive data from the headset)
L298N Motor Driver (To power the motors)
Robot Chassis & DC Motors (2WD or 4WD)
7.4V or 9V Li-ion Battery (Power source)
Jumper Wires & Breadboard
3. Circuit and Connections
| Arduino Uno Pinout Diagram |
| Pinout Diagram of L298N Motor Driver Module |
HC-05 to Arduino: * TX of HC-05 → RX (Pin 0) of Arduino
RX of HC-05 → TX (Pin 1) of Arduino (Use a voltage divider: 1kΩ and 2kΩ resistors to drop 5V to 3.3V)
VCC → 5V, GND → GND
L298N Motor Driver to Arduino:
IN1, IN2 → Pins 4, 5
IN3, IN4 → Pins 6, 7
ENA, ENB → Pins 9, 10 (PWM for speed control)
Power: Connect the battery to the L298N 12V input and share the GND with the Arduino.
4. Detailed Step-by-Step Circuit Working
EEG Capture: The NeuroSky headset's dry electrode touches your forehead to pick up tiny electrical voltages.
Processing: The headset converts these raw signals into an "Attention" value (0–100).
Transmission: The headset acts as a Bluetooth Master and sends this value to the HC-05 (configured as a Slave).
Decision Making: The Arduino reads the serial data from the HC-05. If the Attention value is above a set threshold (e.g., 70), it sends a HIGH signal to the Motor Driver.
Actuation: The L298N takes the low-power signal from the Arduino and switches the high-power battery current to the motors.
5. Libraries to be included
For this project, you don't necessarily need a complex library if you read raw serial data, but using the Mindwave library makes it much easier to parse the "Attention" values.
Mindwave.h (Available on GitHub)
SoftwareSerial.h (If you want to keep the main Serial port for debugging)
6. Code
#include <Mindwave.h>
Mindwave mindwave;
#define motor1Pin1 4
#define motor1Pin2 5
#define motor2Pin1 6
#define motor2Pin2 7
void setup() {
Serial.begin(57600); // Mindwave default baud rate
pinMode(motor1Pin1, OUTPUT);
pinMode(motor1Pin2, OUTPUT);
pinMode(motor2Pin1, OUTPUT);
pinMode(motor2Pin2, OUTPUT);
}
void loop() {
if (mindwave.update()) {
int attention = mindwave.readAttention();
if (attention > 60) { // Threshold for movement
moveForward();
} else {
stopRobot();
}
}
}
void moveForward() {
digitalWrite(motor1Pin1, HIGH);
digitalWrite(motor1Pin2, LOW);
digitalWrite(motor2Pin1, HIGH);
digitalWrite(motor2Pin2, LOW);
}
void stopRobot() {
digitalWrite(motor1Pin1, LOW);
digitalWrite(motor1Pin2, LOW);
digitalWrite(motor2Pin1, LOW);
digitalWrite(motor2Pin2, LOW);
}
7. Detailed St ep-by-Step Code Working
Baud Rate: We set
Serial.begin(57600)because that is the communication speed of the NeuroSky headset.mindwave.update(): This function constantly checks if a new packet of brainwave data has arrived.readAttention(): This extracts the specific concentration level from the data packet.Threshold Logic: The
if (attention > 60)statement is the key. It ensures the robot only moves when you are actually focusing.Function Calls: Based on the focus level, the code calls
moveForward()orstopRobot().
8. Tips
HC-05 Pairing: You must use AT commands to pair the HC-05 specifically with the MAC address of your headset.
Signal Quality: Ensure the ear-clip is attached properly; otherwise, you will get a "Poor Signal" value of 200.
Blink Detection: You can also use
readBlink()to add a "Stop" command when you blink twice.
9. Uses
Assistive Mobility: Controlling wheelchairs for people with quadriplegia.
Education: Teaching students about neuroscience and BCI.
Gaming: Creating hands-free controllers.
10. Conclusion
The Mind Controlled Robot is a perfect example of how affordable electronics like Arduino can merge with advanced neuroscience. By mastering the connection between the brain and the machine, we open doors to a more accessible future.