Backyard Brains Logo

Neuroscience for Everyone!

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


items ()

[Summer’16 Internship] The Dragonfly: Manipulating the code for the laser set-up

In order to replicate Paloma Gonzalez-Bellido’s experiment, I need to be able to manipulate the direction and position of the laser beam. In Paloma Gonzalez- Bellido’s 2012 paper she publish these results:

Gonzalez-Bellido, P. T., H. Peng, J. Yang, A. P. Georgopoulos, and R. M. Olberg. “Cozzarelli Prize Winner: Eight Pairs of Descending Visual Neurons in the Dragonfly Give Wing Motor Centers Accurate Population Vector of Prey Direction.” Proceedings of the National Academy of Sciences 110.2 (2012): 696-701. Web.

The diagrams on the left column plot the preferred direction of a certain neuron (labeled DIT.., MD… etc). Imagine that in the centers of the circles are the dragonflies, and that each color represents a position the target could be moving in. The red arrow points to the position that is preferred. The next column represents the flattened out screen. Each colored dot represents a pixel that the target has either started or passed through, and each color represents the direction. By looking at the left column, we can determine the direction the target was moving. The last column represents the firing rate- yellow being the greatest and black being the weakest.

I wrote a first draft of code, using Arduino, to mimic the experiment. Using the data collected about the preferred direction and the preferred starting location of the target, I designed code that would move the laser beam from each of the preferred starting locations for each of the neurons and travel in each of the neurons preferred directions.

For example, I wrote code for the neuron MDT3:

#include <Servo.h>
  
  const int servo = 10;       // The servo motor pin
  const int servo2 = 11;
  int laserPin = 12;
  Servo myservo;  // create servo object to control a servo
  Servo myservo2;
  int servoAngle= 0;
  
  void setup() {
  
    // Servo  
  pinMode(laserPin, OUTPUT); // set up the laser pin
  
    myservo.attach(servo);  // X servo
    myservo2.attach(servo2); // Y servo
  

  }
  
  
  void loop(){
    
    for (int i = 0; i < 11; i ++)
    {
    
    for (int j =0; j < 5; j ++)
    {
      
    digitalWrite(laserPin, LOW);
     
      myservo.write(30); // X servo starting point
      myservo2.write(60 - i*(2.5)); // Y starting point - moves with i
      delay(100); // 100 millisecond delay
      digitalWrite(laserPin, HIGH); // turns the laser on
      for(servoAngle = 30; servoAngle < 55 ; servoAngle ++)
    {    
      myservo.write(servoAngle); // X servo moves

       delay(50);
    
    }
    }
    
    delay(1000);
    }
  
  
  }
 

The result is:

Here is the first draft of the code for the final testing:

#include <Servo.h>
  
  const int servo = 10;       // The servo motor pin
  const int servo2 = 11;
  int laserPin = 12;
  Servo myservo;  // create servo object to control a servo
  Servo myservo2;
  int servoAngle=0;
  
  
  void setup() {
  
    // Servo  
  pinMode(laserPin, OUTPUT); // set up the laser pin
  
    myservo.attach(servo);  // attaches the servo to the servo pin
    myservo2.attach(servo2);
  
    // Inizialize Serial

  }
  
  void loop(){
    
    //DIT1
    
    for (int i = 8; i < 11; i ++)
    {
    
    for (int j = 0; j < 5; j ++)
    {
     
     
      myservo.write(55);
      myservo2.write(60 - i*(2.5));
      delay(100);
      digitalWrite(laserPin, HIGH); // turns the laser on
      for(servoAngle = 30; servoAngle >10 ; servoAngle --)
    {    
      myservo.write(servoAngle);

       delay(50);
    
    }
    digitalWrite(laserPin, LOW);
    delay(2000);
    }
    delay(10000);
    }
    
    //DIT3
        for (int i = 0; i < 11; i ++)
    {
    
    for (int j =0; j <5; j ++)
    {
      

     
      myservo.write(55);
      myservo2.write(60 - i*(2.5));
      delay(100);
      digitalWrite(laserPin, HIGH); // turns the laser on
      for(servoAngle = 45; servoAngle >20 ; servoAngle --)
    {    
      myservo.write(servoAngle);

       delay(50);
    
    }
       digitalWrite(laserPin, LOW);
    delay(2000);
    }

    
    delay(10000);
    }
    
    //MDT1
        for (int i = 0; i < 11; i ++)
    {
    
    for (int j =0; j <5; j ++)
    {
      
  
     
      myservo.write(55);
      myservo2.write(60 - i*(2.5));
      delay(100);
      digitalWrite(laserPin, HIGH); // turns the laser on
      for(servoAngle = 55; servoAngle >20 ; servoAngle --)
    {    
      myservo.write(servoAngle);

       delay(50);
    
    }
       digitalWrite(laserPin, LOW);
    delay(2000);
    }

    
    delay(10000);
    }
    //MDT5
    
        
    for (int i = 0; i < 11; i ++)
    {
    
    for (int j =0; j <5; j ++)
    {
      
 
     
      myservo.write(20);
      myservo2.write(60 - i*(2.5));
      delay(100);
      digitalWrite(laserPin, HIGH); // turns the laser on
      for(servoAngle = 20; servoAngle < 55 ; servoAngle ++)
    {    
      myservo.write(servoAngle);

       delay(50);
        
    }
       digitalWrite(laserPin, LOW);
    delay(2000);
    }
    
    delay(10000);
    }
    //MDT3
        for (int i = 0; i < 11; i ++)
    {
    
    for (int j =0; j <5; j ++)
    {
      
      myservo.write(30);
      myservo2.write(60 - i*(2.5));
      delay(100);
      digitalWrite(laserPin, HIGH); // turns the laser on
      for(servoAngle = 30; servoAngle < 55 ; servoAngle ++)
    {    
      myservo.write(servoAngle);

       delay(50);
    
    }
       digitalWrite(laserPin, LOW);
    delay(2000);
    }
    
    delay(10000);
    }
    
    //DIT2
        
    for (int i = 0; i < 11; i ++)
    {
    
    for (int j =0; j <5; j ++)
    {
      
      myservo.write(30);
      myservo2.write(60 - i*(2.5));
      delay(100);
      digitalWrite(laserPin, HIGH); // turns the laser on
      for(servoAngle = 30; servoAngle < 55 ; servoAngle ++)
    {    
      myservo.write(servoAngle);

       delay(50);
    
    }
       digitalWrite(laserPin, LOW);
    delay(2000);
    }
    
    delay(10000);
    }
    
    //MDT2
        
    for (int i = 0; i < 11; i ++)
    {
    
    for (int j =0; j <5; j ++)
    {

      myservo.write(30);
      myservo2.write(60 - i*(2.5));
      delay(100);
      digitalWrite(laserPin, HIGH); // turns the laser on
      for(servoAngle = 30; servoAngle < 45 ; servoAngle ++)
    {    
      myservo.write(servoAngle);

       delay(50);
    
    }
       digitalWrite(laserPin, LOW);
    delay(2000);
    }

    
    delay(10000);
    }
    
    //MDT4
        
    for (int i = 0; i < 11; i ++)
    {
    
    for (int j =0; j <5; j ++)
    {
      
      myservo.write(50);
      myservo2.write(60 - i*(2.5));
      delay(100);
      digitalWrite(laserPin, HIGH); // turns the laser on
      for(servoAngle = 50; servoAngle > 20 ; servoAngle --)
    {    
      myservo.write(servoAngle);

       delay(50);
    
    }
       digitalWrite(laserPin, LOW);
    delay(2000);
    }

    
    delay(10000);
    
    }
  }

By Patricia Aguilar


[Summer’16 Internship] The Dragonfly: Building a servo laser set-up, prototype 2

I built a servo laser set-up (prototype 2) that allows me to control the movement of the laser beam across a curved screen using an X direction servo and a Y direction servo.

Below is the final result of prototype 2:

The problems:

The hot glue on the mirrors makes the mirrors tilt at an angle, and not line up exactly with the wooden sticks.

This curves the laser beam, and does not make it perfectly straight. Furthermore, my set-up was altered many times to get the laser, the mirrors and the screen to line up. Thus, the set-up is overall very messy and filled with scraps of old glue, tape, and wood.

By Patricia Aguilar


[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