Mind GamesDaniel Warner (EE)John Parker (EE)Justin Dwyer (EE)Duy Nguyen (EE)
G38
Goals & Objectives
Basic OverviewThe goal of this project is to control multiple applications through nontraditional methods.
Human Input - Brainwaves, Muscle Movement, Heart Rate via BCI (Brain Control Interface)
DSP - Laptop Computer to MCU
Application - RC Car, Water Fountain, Claw Machine
MotivationDiverse Multi-discipline project - Aspects include:
Biomedical Engineering DSP / Programing RF / Wireless Communications Mechanical Engineering Concepts
Specifications-Overall System Latency of 750ms
-General controller board should be flexible and offer many control options
-Claw machine needs to capable of carrying a load of 1/2 pound
-Claw machine needs a minimum of half of an inch precision in x-y motion
-Water fountain displays pulse across three pumps
-RC Car should be drivable using basic controls (Left, Right, Forward, Reverse)
Overall Block Diagram
BCI HardwareKey Points
-Multiple Bio- Potential Inputs
-High Resolution
-High Bit Depth
Electrodes Passive vs Active
-Passive requires Capacitive gel to overcome trace impedance of skull
-Active uses small amplifier to boost signal
-Modern Active and Passive Electrodes have a similar SNR
Headwear
10-20 Headset
International Standard for EEG Capture
Primarily Targeting Brain Alpha Waves
Found between 9 - 14 Hz
Strongest Propagation in the O1 and O2 Region
Occurs when users eyes are closed
DSP Software
3 options for software choice
-MATLAB, Python, BrainBay
Pro Con
MATLAB Extremely powerful, experienced in using it
Expensive to buy software & Processing Package
Python With correct modules, as powerful as MATLAB, free, Code establishing connection to board available
No experience in programming python
BrainBay Extremely simple to use, free Too simple. Lacks programming options & output is limited to keyboard strikes.
Lab Streaming LayerThe lab streaming layer (LSL) is a system for collecting data. It handles both the networking, time-synchronization, access as well as optionally the centralized collection, viewing and disk recording of the data.
We will use LSL to send our data from the board into the scripts designed to process it.
Latency is a big concern with our project. LSL samples are transferred with less than .1 milliseconds of latency for samples smaller than a megabyte.
EMGThe code for this portion must detect a muscle being flexed.
The spikes created by this muscle activity are huge and easily detected.
We will compute the absolute value of the signal, then output a positive if the signal is above 12uV.
EMG Output
We will be monitoring the muscle activity of the jaw in the Claw Machine program.
As soon as we detect a clenched jaw, we will output a ‘C’ over serial to the PCB controlling the Claw Machine.
EKG DetectionThe code for this portion must detect the pulse of the user. By counting the number of samples between the strong negative peaks, the time between each pulse can be determined.
Sample of minimum
Samples between mins
Calculated pulse
8
213 205 74.6
426 223 68.6
652 216 70.8
860 208 73.5
EKG OutputLimitations on communicating between python and our MCU limited us to transferring ascii characters.
Once the pulse is found, that number is converted into an ascii character, and that character transferred to the MCU
EKG Program Flowchart
Alpha Wave DetectionAlpha waves are produced at ~10 Hz. The image below shows EEG Data band pass filtered between 9-12 Hz to show the alpha band. When the eyes are closed, there is a large increase in activity in the range 9-12 Hz.
Alpha Wave DetectionDetecting Alpha
-Filter Signal
-Compute Average
-Output if wave detected
Determining Head TiltDetermining the way a user is tilting their head will be accomplished using the on board accelerometers.
Compute what percentage of earth’s gravity each axis experiences
From that, the angle of the head will be determined
Accelerometer Processing
Accelerometer TestingData is shown in its separate channels, with channel 0 = x, 1 = y, 2 = z
The data begins with the board flat on a desk, then tilted different directions every 5 seconds
Head Tilt OutputIf a head tilt is determined using the accelerometer, a coresponding ascii character is output.
The Claw Machine will expect an ‘l’ for left, ‘r’ for right, ‘f’ for forward, and ‘b’ for backwards.
The RC Car will expect a ‘w’ for forward, an ‘s’ for backward, a ‘d’ for right, and an ‘a’ for left
General Development BoardMany specialized Dev boards are currently available for different technologies.
3G GSM, Bluetooth, Wifi, RF.
We wanted something that was able to do more and offered useful inputs with a seamless connection.
••••
••••
––
•••
Water Fountain;/,.,.This water fountain will change output based on the user’s pulse. The following slide will show the schematic for the water fountain.
Pulse<75 75<Pulse<110 Pulse>110
Tiers active
1 1,2 1,2,3
Issues*Inductive load from relay end
*sparking from contact end
*inductive noise when pumps shut off
*isolating analog and digital grounds
*decoupling capacitors
*solid state relays
*dc motor
Claw Machine Application
User friendly:Easy input signals to control the claw machine game. with little to no BCI training.
EMG signals: Unlocks control of x and y-axis
Accelerometer signals: tilt forward -> move forwardtilt backwards -> move backwardstilt left -> move lefttilt right -> move right
EEG signal:close eyes and relax (alpha wave) -> claw drop
References----------------------not many claw machine references-decided to reference the x-y motion/rails from a 3d Printer-attach a motor on a platform for z motion
Claw Machine Subsystem
Bipolar Stepper MotorAdvantages: Provides high resolution and fair amount of torque, relatively cheap, long lifespan
Disadvantages: Current draw, Dedicated Drivers, No internal feedback system
Requirements: Project requires precision, enough torque to move the metal rails, and durability. Power consumption is not a main concern and a feedback system can be implemented through hardware and software design
How to overcome the feedback issue:
z axis:utilize a counter in software and rely on precision of stepper motor
x-y axis: Timing belt slipping means counter is not an option
Utilize limiting switches to send signal to mcu when collision occurs
Stepper MotorsLeadshine’s stepper motor selection document used for torque calculations through dynamics free body diagrams and equations:
Stepper motors selected:
x-y Axis Feedback System
Limit switches: Cheap Simple configuration effective easy coding
Encoder: expensive hardware and software
unnecessarily harder bulkier
Stepper Motor DriverAllegro A4988:--------------------------------------------Max load supply voltage: 35VMax output current: 2ALogic supply voltage: 3.3V to 5.5V---------------------------------------------
Enable pin will be used to shut off holding torque and reduce power consumption
Heatsink required for full 2 A current draw
Claw RelayParasonic 5V Relay: JS1A-B-5V-F High contact capacity: 10 AMax operating voltage: 100V DCNominal operating current at 5V: 72 mACoil resistance: 69.4Ω
FairChild NPN Transistor: BC337Max Ic current: 800mAminimum hfe at Ic=100mA: 100Vbe(sat): 1.2V Vce(sat) from circuit configuration: 40mV
*ensure Ib does not exceed mcu rating
Power SystemRAIDMAX XT series RX-300XT 300W ATX12V / EPS12V Power Supply:----------------------------------------------------------------------------------------------------+3.3V@14A, +5V@15A, +12V@21Acost: $22
Need: output 24V1 Amp Current--------------------------------------------------------------------------------------*attempted to use +12V to -12V for 24 but could only supply .5A*used 24V wall adapator @1.5A
TI TPS55340RTER DC-DC Boost Converter:--------------------------------------------------------------Vin: 2.9V to 32VVout max: 38V95% efficiencycost: $5
Program Flow x-y motion
Delivery System Program Flow
Work Distribution
BCIHardware
DSP Wireless Communication
RCCar
WaterFountain
ClawMachine
Admin/Management
Daniel Primary Secondary Primary
John Secondary Primary Primary
Justin Primary Primary
Bob Primary Primary
Budget
Financing / Sponsors