Backyard Brains Logo

Neuroscience for Everyone!

+1 (855) GET-SPIKES (855-438-7745)


items ()

[Summer’16 Internship] Arduino, EEG, and Free Will: A big “duh” moment

I had been searching for a readiness potential for weeks, trying to sift through noise two orders of magnitude louder than the signal itself, with little success. This morning Greg, my research mentor, pointed out that since I’m using a bipolar electrode EEG, the op-amp is only magnifying the difference between the two leads over my secondary motor area, which happen to be just a few centimeters apart. The signal between the two electrodes is practically identical, which means I won’t be picking up much of anything. Instead, I want to amplify the difference between a lead over the SMA and another lead on some more neutral part of the head.

To do this, I’m placing one electrode over C3, a second electrode on the base of my occiput, and a reference electrode clipped to my left ear. Instead of buying medical grade EEG ear clips, I soldered two washers to a copper alligator clip.

Currently in MATLAB, I’m applying a 0.25 – 64 Hz bandpass Butterworth filter. This seems to be a good range for recognizing slow cortical potentials. I kept picking up EKG pulse artifacts when I used two grounds (one on my hand for EMG, one on my mastoid for EEG), so I’ve removed the EMG ground, which eliminated EKG as well as most cross-talk between the two channels.

By Patrick Glover


[Summer’16 Internship] The Dragonfly: Connecting the laser to the Spikerbox

From previous neural recordings, I have data of the spikes of the TSDNs. However, I had yet to find a way to record the onset of the stimulus (turning on the laser) so that I could correlate it to the spikes. In order to both simultaneously record the event of the laser turning on and the neural recording of the daringly TSDN, I exchanged my neuron Spikerbox for a Muscle Spikerbox Pro, which allows me two channels (later I would find that I didn’t even need the second).

Basic schematic for how this will be accomplished:

This allows me to simultaneously record whether the laser is on and record from the neuron of the dragonfly.

Here are some more pictures of how I accomplished this:

Below is a video of the final result:

The red lines on the laptop screen represent the laser turning on. I do not yet have an event marking the laser turning off– maybe that’s the next step! Also, the white recording on the laptop screen is the recording from the electrodes (which will be recording from the dragonfly neuron).

By Patricia Aguilar


[Summer’16 Internship] The Dragonfly: Laser show first prototype

Today I started working on the first prototype for the laser set-up. Previously, I had tried to make a laser show out of bass speakers. However, I found that the bass speakers that I had did not allow me the range of motion that I wanted.

A picture of the bass speaker set up that I chose not to use:

So, I instead decided to rig up a laser show out of servos. Starting simple, I only used one servo, meaning only one degree of freedom.

My laser set up:

Using a servo motor (I started with the continuous rotation, then moved on to the stepper) and an Arduino Uno, I connected the two so that the servo moved in an angle of about 40 degrees, paused for a second, then returned. I found that the stepper motor was best for this (not the continuous rotation) because it allowed me to plug the desired angle right into the code. By connecting a mirror onto the servo, I could shine a laser onto the servo, reflect it onto a screen, and move the laser beam by controlling the movement of the servo. Additionally, through the Arduino, I could turn on and off the laser easily.

Below is a picture of the set up:

The servo and the laser are both connected to the breadboard, and then to the Arduino.

Here is the code I used to power the laser and servo:

  #include <Servo.h>
  
  const int servo = 10;       // The servo motor pin
  int laserPin = 12;
  Servo myservo;  // create servo object to control a servo
  int servoAngle = 0;   // servo position in degrees
  
  
  void setup() {
  
    // Servo  
  pinMode(laserPin, OUTPUT); // set up the laser pin
  
    myservo.attach(servo);  // attaches the servo to the servo pin
  
    // Inizialize Serial
    Serial.begin(9600);
    myservo.write(servoAngle); 
    delay(1000);
  
  }
  
  
  void loop(){
   
  
  
    
      digitalWrite(laserPin, HIGH); // turns the laser on
      for(servoAngle = 0; servoAngle < 40; servoAngle++)  //move the micro servo from 0 degrees to 40 degrees
    {    
      myservo.write(servoAngle); 
      delay(50); 
   
    }
    
    digitalWrite(laserPin, LOW); // turn the laser off
    myservo.write(0); // return to zero degrees
  
    delay(1000); // pause for one second
    
}

This moves the servo in a 40 degree wedge and turns off the laser once the servo has hit the 40 degree mark and has moved back to 0. I connected the laser by removing the batteries, connecting an alligator clip to the spring in the center of the laser (ground) and connecting another alligator clip to the metal surrounding it. Connect the ground to ground on the Arduino and the other to the 12 pin.

After I got the servo and laser working, it looked like this:

The problems with this set up are that the servo is a little unstable, meaning the laser beam is quite jerky when it moves. Maybe this does not matter to the dragonfly TSDNs. I will see. The next step, trying to find some way to record on the computer when the laser turns on and when it turns off!

By Patricia Aguilar