Backyard Brains Logo

Neuroscience for Everyone!

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


items ()

What does the Fish say? Electric fish spikes with Bailey

Hello my name is Bailey! I am a junior majoring in electrical engineering at Michigan State University and am doing an internship at Backyard Brains this summer. Sorry I missed the first blog post, I was travelling in Japan with my sister!

Sister

Left-my sister, Right-me

I know it doesn’t look like it from the picture, but I was doing some important background research for my project.

Robot

I mean…circuits were involved

Ok, so it was just for fun.

After getting over my jetlag it was time to get back to work. My project this summer involved mormyrid fishes. What’s so special about these fish? Mormyrid fish are awesome because they both emit and detect electric signals. Unlike an electric eel, however, their electrical discharges are too weak to harm other fish. Instead, they use electric signals to navigate their environment, which is naturally very cloudy, and communicate with each other. A lot can be learned about these fishes’ behavior and even evolutionary history just by studying their electric organ discharges (EODs).  Unfortunately the equipment used to record their EODs is quite costly, often prohibitively so-especially for those who live in the same area as the fish. This is where we come in. My goal this summer was to build an inexpensive, easy to use, and open source device that can record EODs from weakly electric fish.

Since the EODs occur at very high frequencies, a simpler microcontroller like an Arduino is not sufficiently powerful to record their EODs in real time. Enter the BeagleBone Black.

BeagleBone

Woof

The BeagleBone Black has a 1GHz processor and 4GB of storage (that can be supplemented with a micro SD card) as well as running a full Linux OS, making it perfect for collecting the EOD data.

Now I need something to convert the analog EOD signals to digital so that the BeagleBone can process them. For this project I am using the MCP3008 analog to digital converter. Initially, I started by using a cape that had the chip on it.

Analogs, prepare to be converted!

Analogs, prepare to be converted!

The cape worked well for testing the setup with low frequency sine waves, however, the inputs it normally connected to on the BeagleBone were not able to handle the high speed data collection I needed and the data was not being recorded in real time. To work around this issue, I had to individually connect each pin to the appropriate input on the BeagleBone. This lead to the setup appropriately nicknamed “The Shiva”.

Not pictured: the 6 other arms I grew to operate this setup

Not pictured: the additional arms I grew to operate this setup

This setup allowed me to access the programmable real time units (PRUs) on the BeagleBone. PRUs are essentially microprocessors within a microprocessor that sit around eagerly awaiting a program to execute. Unlike the main CPU, the PRUs do not run Linux, allowing them to collect the data in real time. Now that I had my setup I was only missing one thing-the fish! A quick trip to the Electric Fish Lab at MSU and the newest additions to the Backyard Brains Petting Zoo, Tina and Taco, were ready for some data collection.

The one on the right with the goatee is Taco. Tina is on the left

The one on the right with the goatee is Taco. Tina is on the left

I started recording by using the example code from chapter 13 on the Exploring BeagleBone website. The code filled up the PRU memory with data from the recording, and then used another program to read the data from the memory. Although this worked well, it was not what I wanted in terms of a final product. Using the example code as a basis, Stanislav Mircic, Backyard Brains’ ultra-programmer, and I modified it to continuously write the data to a circular buffer as well as simultaneously read the buffer and check if an EOD has occurred.

Bailey7

Now the program will record only the EODs, which is what we are ultimately interested in, instead of all of the raw data. Here’s an example of the output:

bailey8

Now that I’ve verified what the circuit needs to be, I have to draw out the schematic so that a board can be printed in a form that can snap onto the BeagleBone.

My drawing of the circuit

My drawing of the circuit 

Official Schematic

Official Schematic

And finally the actual board.

Goodbye Shiva!  Only two arms needed for this one.

Goodbye Shiva! Only two arms needed for this one.

For the rest of the summer I will be modifying the circuit design to better suit the goal, such as altering the gain to match the type of recordings we’ll be getting, and preparing the device for field work by building a portable power source and a case that it can float in.  Soon we hope for the device to be picking up lots of fish conversations from around the world!  Stay tuned!