Project Description Controlling the EV3 Robot with

Controlling the Air Swimming Shark
with your Brainwaves
How does it work?
Nick Carter 7/25/2016
?????????????????????
The Idea
• In researching EEG Sensors I found Open EEG and
their application idea.
• http://eeghacker.blogspot.com/2015/03/braincontrolled-shark-attack.html
• http://spectrum.ieee.org/geek-life/handson/openbci-control-an-air-shark-with-your-mind
• I wanted to do it on the cheap
– thus, MindFlex Game has 1 or 2 EEG sensor inputs.
Shark being driven at Nova Labs
EEG
Headset
IR
RF
Arduino
Shark
Remote
MindFlex
Game
For Video see: https://drive.google.com/file/d/0B_8yqnVcbS5gQ0ZWVjVQdGU2SzQ/view?usp=drivesdk
Block Diagram - Project Building Blocks
MindFlex Toy
Player Brain
Control Signals.
1 EEG Sensor
??
Circuit* to
make
MindFlex
compatible
with Arduino
??
Program in
Arduino to
translate
MindFlex
signals to
Shark
Remote
signals
Circuit* to
make Shark
Remote
buttons
compatible
with Arduino
??
??
Shark
Remote
Modified to
get button
signals
Interface Mindflex to Arduino - 1
• What signals are available
– Motor control
• Physically moves
• Seems to have speed/position feedback
• Physical access?
– LED control
• Easy access
• 3 intensities already decoded
• 2 player access
– Other
• Hack controller?
• More difficult – little info available
 I chose the LED control
Interface Mindflex to Arduino - 2
• Interface to LEDs – how do I monitor them
• What is the drive LED signal
– Light intensity varies with Pulse Width Modulated (PWM) signal
• How do I interface to it, Arduino has Analog and Digital
inputs.
– Digital interfacing requires careful timing and there are 6 lights.
– Analog interfacing is easy. I used an RC network to convert
PWM to analog.
– Use threshold values in the Arduino to decide if LEDs are
“ON/OFF” for control purposes
Wiring inside MindFlex Base Unit
LEDs
LEDs
Connectors
LED Wiring to Connectors
Arduino Code
•
Major Code Blocks – Loop this
–
–
–
Read Analog Inputs
Compare Analog inputs with thresholds to see if they represent ON or OFF. Since the filtered signal is
a saw tooth, we need a big hysteresis. (Difference between thresholds more than saw tooth height.)
Decide Shark Drive action based on LED ON/OFF
•
–
Send signals to “push” the Remote Control buttons
•
•
Forward, Turn Left, Turn Right, Up, Down
Turn solid state relays ON/OFF with Digital outputs
Create Sequences for Drive actions as callable functions
•
•
•
•
Forward = side to side tail wag, alternate L/R button press
Turn Left = Short wag R, Long wag L. (Turn R = opposite)
Up/Down – requires 2nd player, use manual control at first
Using one player,
–
–
–
Activate Drive sequence Forward when Green LED is on,
Activate turn Left or Right when Orange LED is on,
Change turn direction every time Orange is achieved after Green.
Notes:
 2 Player LED signal sets are available – players would have to coordinate but more control
information is available.
 Preprogrammed Shark drive sequences could be used without the “mind control.” just using
the Arduino – or using other input means.
Interface Arduino to Shark Remote
control
• Remote control has push buttons
to control the Shark.
– 3 buttons close to a common signal
– 1 button does not**
– I need to wire out the button
contact points
– I will wire to a convenient external
connector for my relay board
**This was my remote version. Some
versions of remote may have all
buttons with common connection to
switches drivable from Arduino, but
relay drive is universal.
Ribbon cable with 6
pin connector to
Relay Board
Interface Arduino to Shark Remote
control
• I need to close the Push
Button circuit from Arduino
– I cannot drive directly from
digital outputs for all
– I need a relay (isolated
contact) for the 1 contact
– I designed a quad Solid State
Relay board using Eagle CAD,
PCB from OSHPark.
Components from Digikey.
Solid State
Relay
Ribbon Cable
Connector
mate
Integrating the Parts
Couple everything with connectors
Breadboard
interface
Arduino to
Game
1=LED_ON,
0=LED_OFF
Arduino
Analog level
REMOTE
GONDOLA
IR
Arduino Monitor
on PC.
Values sent back
(This pic shows EV3 remote not shark remote)
Wagging the tail
from the PC
The Shark
•
I used “Air Swimming Shark” from Internet. (Other fish types available)
– Price range $15 to $50
•
Requires about $15 of helium to inflate
– I bought a party balloon kit for $25 with helium canister. So far it did 1 full inflate + 1 top-up –
more left still.
•
•
•
•
•
•
•
Shark stays inflated a few days then may need to be topped up.
Cannot assemble shark until inflated. 2 people needed for best assembly.
Fins and control electronics are held with double sided sticky tape + overlay
reinforcements. (Tricky with one person)
Neutral buoyance is achieved using clay/putty (supplied). I found I had to tape
some to front of shark to balance it.
Normal leveling is supposed to be achieved using “climb/dive “ attitude
adjustment using the remote to move the electronics module (gondola) to front or
rear with rack /pinion gearing.
Propulsion forwards is by side to side tail wags using remote to wag left and right
alternately (separate buttons)
Turn is done using the wag buttons to wag more one way than the other, or
holding button down will only wag to one side.
Issues
• Shark fin reinforcement tape is light and sticks to itself easily. Can be
difficult to apply.
• My placement of the control gondola using lowest altitude placement was
not far enough forward to enable proper climb dive control (I added more
clay taped to front of shark.)
– You can’t tell until you stick it on then it is too late.
• The fins came off in my car driving 7 miles and the shark was stressed
against roof etc.. They could be re-stuck but for how long?
• The control gondola did not stick well to underside, curvature did not
match shark. One end broke and I had to hot-glue it.
• The tail drive mechanism frequently became stuck and had to be manually
released (forced) to continue wagging.
• From time to time it gets “directionally challenged” and needs manual
intervention to put it back on course (see video)
BUT…..despite these issues, it is a fun toy and people really like it 