Close
0%
0%

Feeding Experimentation Device 3 (FED3)

Version 3 of our home-cage feeding device, FED.
FED3 includes nosepokes and stimuli for behavioral training.

Public Chat
Similar projects worth following
FED3 is a home-cage compatible device designed for high throughput training of mice

This is a battery powered FED device for training rodents in home cages.  FED was developed to free researchers from expensive and rigid behavioral testing equipment, and allow them to do their experiments wherever they'd like - in dedicated boxed, in the home cage, or even inside other scientific equipment.  Importantly, FED3 is open source and new sensors or code can be easily added to change its function.    

The device runs on an Adafruit Adalogger M0 Feather board, which also includes a microSD card slot for recording behavioral data.  The hardware include two "nosepoke" beambreak sensors, a beeper, a multi-color LED strip, a pellet dispenser, a BNC output jack for synchronizing with other equipment, and a screen for providing feedback to the user.   See logs for info on the build, costs, etc.  And as always, feedback is welcome! 

Please join our Google group for troubleshooting and questions.

Funding and license:

This project was funded by the NIH Intramural Research Program (NIDDK).  This project is released under the terms of the Creative Commons - Attribution - ShareAlike 3.0 license:

  human readable: https://creativecommons.org/licenses/by-sa/3.0/
  legal wording: https://creativecommons.org/licenses/by-sa/3.0/legalcode

FED3-041319.zip

Newest code, includes programs with active/inactive pokes reversed, and also a self-stimulation program for use with optogenetic stim

x-zip-compressed - 15.95 kB - 06/13/2019 at 19:17

Download

FED3read_video_photometry.bonsai

Updated bonsai file to read FED3, FLIR camera, and NPM system. Combines all outputs into a single CSV file for better synchronization. Updated 6-4-19

bonsai - 16.68 kB - 06/04/2019 at 13:40

Download

FED3-011519.zip

FED3 main code from January 2019, updated 01-15-19, includes 6 programs

x-zip-compressed - 14.94 kB - 01/14/2019 at 23:00

Download

FED3_SetClock.ino

Set RTC on FED3 (see instructions for how to use this code)

ino - 6.29 kB - 01/14/2019 at 23:01

Download

FED3 libraries.zip

Libraries used in FED3

x-zip-compressed - 3.78 MB - 01/14/2019 at 22:16

Download

View all 12 files

View all 18 components

  • New programs

    Lex Kravitz05/20/2019 at 16:22 0 comments

    Based on feedback, I've updated the number of programs to 10!  Here are the modes present in the newest version of the code.  Use the left and right pokes at startup to scroll though:

      0 Free feeding
      1 FR1
      2 FR3
      3 FR5
      4 Progressive Ratio
      5 Extinction
      6 Light tracking FR1 task
      7 FR1 (reversed)
      8 PR (reversed)
      9 Optogenetic stimulation
      10 Optogenetic stimulation (reversed)

  • Interfacing FED3 with Bonsai

    Andrew Hardaway04/18/2019 at 20:47 0 comments

    Hi,

    Many of you may be using the FED3 in satellite mode, logging the data locally and extracting it for later analysis. Lex and I wanted to codify a platform where the outputs from the FED3 could be read in real-time and paired with other neural circuit manipulations like fiber photometry that use open source platforms like Bonsai. Briefly, Bonsai is an open source program with near limitless potential to read out and drive multiple pieces of hardware, software and provide you with behavioral or physiological data in real time. All for the low low price of $0. It uses a visual programming language to control different functions which means zero front end coding - the flow of commands appear as nodes that move left to right. Check out and install Bonsai here at https://bonsai-rx.org/

    My goal was to use the FED3 as an operant feeding device reading out the sensors in real time to generate time stamps that I could then extract from fiber photometry data sets. I'm using the Neurophotometrics (NPM) System with 3 LEDs 415, 470, and 560 and a BlackFly Camera. Sage Aronson of NPM provided us with some starting bonsai files to control his system and I've adapted it and combined it with the FED3 bonsai layout. You can access the Bonsai layouts in the Files section above. Ultimately it does 3 things: 1) Talk to the FED3 and generate a timestamp file of the different sensor outputs 2) Talk to another camera to capture video of the chamber and 3) Talk to the NPM and generate fiber photometry signal data in csv format. A simple schematic of the hardware is below. Notably, you will need a separate Arduino to function as an I/O Box for the FED3. 

  • FED3 wall mounting system (take 2!)

    Lex Kravitz03/02/2019 at 20:31 0 comments

    We've recently been re-evaluating the utility of mounting FED externally to a cage or behavioral chamber, rather than placing FED3 in the cage itself.  To faciliate this, we modified the front plate to include 4 magnet holes/mounts, and created a drill guide pattern for modifying the wall of a chamber to mount FED3 to it.  We also used the "mini-hopper", which is available in the files area.  

    For mounting on a chamber or cage, it only requires drilling four 5/16" holes (for magnets) and two 2" holes (with a hole-saw) for the pokes and feeder.  I was able to drill these and insert magnets in about 10 minutes.  Video below, please contact me for modified FED3 front plate design and drill guide.

  • Improved dispensing

    Lex Kravitz02/09/2019 at 18:27 0 comments

    The Achilles heel of any pellet dispenser is pellet jamming.  There are several reasons for a jam, but one of them is that the pellets inside the hopper align in a way that impedes the movement of the dispensing disc.  To combat this issue, I've modified the stepper code to make the stepper "vibrate" while dispensing.  This can help shake up the pellets in the hopper and reduce jams.  

    Please leave feedback in comments if you try this update! 

    This log is also posted here:

    https://hackaday.io/project/72964-feeding-experimentation-device-fed-20/log/158560-improved-dispensing

  • FED3 for high throughput mouse operant behavior

    bridget.matikainen-ankney01/25/2019 at 23:30 0 comments

    Our lab is interested in how exposure to obesogenic diets might influence the willingness to work for palatable food, or to learn how to acquire such rewards. One way to test aspects of this is to perform an experiment in which a mouse learns to associate a specific task with the delivery of a reward. Since the amount of the reward and the work it takes the mouse to earn it are static in this experiment, it is called a "fixed ratio", or FR. We can then look at how quickly mice who are obese formed these associations compared to lean mice.  Here are the weight curves showing how the "obese" group quickly gained weight on a high fat diet.

    To test whether the obese and lean mice learned to acquire rewards (in this case a sugar pellet) differently, we used FED3 to launch a large-scale FR experiment between lean and obese mice. As  you can see, the FED3 easily sits inside the home cages which are then housed in a rack in the vivarium. 

    (If you look closely you can see some of the cages with green tape on them labelled, "HFD," for high fat diet.)

    We let the FED3s (running the Fixed Ratio program) run overnight, since that is when mice are most active. The next day, we pulled that data from the SD cards in each device, and used python to organize and plot our data. 

    As you can see, the lean mice learned to acquire more sugar pellets than the obese mice. This kind of straightforward experiment would have been very time consuming without FED3, which let us collect this data overnight!

  • FED build video!

    Lex Kravitz12/20/2018 at 22:38 0 comments

    Check out our video detailing the parts and steps for building a FED! 

  • FED modifcation to mount it on a wall

    Lex Kravitz12/10/2018 at 14:53 0 comments

    I was asked by another researcher about mounting FED to a wall, instead of placing FED in a cage.   It is very do-able but requires a modification to the hopper to make it a bit smaller so it doesn't stick out in the front. STLs for the modified parts are in the files area here.  With the smaller hopper, FED can be mounted on the outside wall of a cage like this:

    I also went ahead and printed a wall to fit in our operant boxes.  This wall divides off part of the box so the mice can't get behind the FED.  I wasn't sure how this would work but it came out pretty nice.  The wall had to be printed in 2 parts because of its size.  It was a fun modification, STLs for the wall parts are also in the files area here.

  • Mass production!

    Lex Kravitz12/10/2018 at 14:40 0 comments

    Our lab is completing an experiment looking at long-term effects of obesity on motivation to work for food.  The question is, "are obese mice more or less willing to work for food than lean mice?"  One way this can be tested is with a "progressive ratio" schedule, in which the first pellet requires one poke, the second two pokes, the third four pokes, etc.  We can ask when the cost will be too high to continue.  You can read more about this here.  

    To test this in our experiment we needed 20 FEDs.  So we decided to build them!  It was the largest FED build we've attempted and it went super well.  Building 20 is different from building 1, and we learned some things that I'll adopt in the design to make manufacturing easier.  But we got 20 FEDs built in ~2 days.  Photos from the build below:

  • Pellet path

    Lex Kravitz10/24/2018 at 13:30 0 comments

    Since we started making FED1.0 we found the hardest aspect of making a pellet dispensing to be.... dispensing pellets. 

    There are several issues that need to be resolved, two of which are dust and pellets landing correctly in the well.  Dust is a serious issue that can jam the FED.  We have found that printing the front plate at a finer resolution (see 3D printing log) helps greatly with reducing dust.  Basically making the pellet path as smooth as possible for the pellets.  We have also noticed that pure sucrose pellets make much less dust than grain based pellets, which can be useful if you don't need to provide the whole diet to the mouse via FED.  Lastly, we included "drain holes" in the design to try to remove some dust.  That said, if you run FED for multiple days you should watch out for dust forming and try to clean it out.

    The second issue was getting the pellet to land correctly between the arms of the photo-interrupter.  These little pellets are hard and they can tend to "bounce" when they drop out of FED.  To slow the pellets down and minimize bouncing, we use a curved pellet dispensing path, shown here (courtesy of the excellent visualization tools at 3D Hubs).  This seemed to solve the bouncing issue.

  • FED3 battery life

    Lex Kravitz10/18/2018 at 16:06 0 comments

    We performed a real-world test with a singly hosued mouse training on FR1 for 5 days.  Here is the battery discharge curve, indicating that FED3 can last about 5 days of continuous use on a charge.  This can probably be improved by optimizing sleep modes further (it currently sleeps whenever a pellet is in the well), but it seems good enough for our purposes.

    He took 345 pellets during this time, also note that pellets taken are higher at night.

View all 25 project logs

  • 1
    Download Arduino IDE

    Before starting with building anything you should make sure your computer can communicate with the Adalogger M0 board and that you can flash the operant FED sketch.  Start by installing the Arduino IDE.

  • 2
    Install relevant Arduino boards to run the Adalogger M0

    The Adafruit M0 Adalogger board is not natively supported by the Arduino IDE.  To enable the Arduino IDE to flash sketches to this board, follow instructions here.  After completing these steps make sure you can flash the example sketch "Blink" to the Adalogger board before continuing.  Open Blink in File>Examples>Basic>Blink.  "Double-click" the button on the Adalogger to put it in bootloader mode and make sure Board is set to "Adafruit Feather M0" and port is set to the same before clicking upload (the right arrow at the top of the Arduino IDE).

    You should see "Upload complete" in the bottom feedback window and the red LED on the board should blink once per second.  

    Congratulations, you have configured your Arduino IDE and uploaded a sketch to the Adalogger!

  • 3
    Install relevant libraries

     FED3 requires the following libraries:

    #include <Wire.h>
    #include <Stepper.h>
    #include <RTCZero.h>
    #include <SPI.h>
    #include <SdFat.h>
    #include <Adafruit_GFX.h>
    #include <Adafruit_SharpMem.h>
    #include <Fonts/FreeSans9pt7b.h>
    #include <Adafruit_NeoPixel.h>
    

    You can install them in multiple ways, but the simplest will be to download the prepared zip file (oFED libraries.zip, also in the files area) including these libraries and extracting it to your Arduino libraries directory (for most it is: /Documents/Arduino/libraries

    When you're done they should all be in your libraries directory, see example:

    If this doesn't work, or you'd prefer a different way go through instructions here for how to manually add libraries.

View all 9 instructions

Enjoy this project?

Share

Discussions

Jay Phansalkar wrote 04/08/2019 at 13:22 point

Really great design, and fun to put  together!

I am having trouble fitting the electronics into the the 3D housing. 

- The holes for the photointerrupters are too small

- The front plate won't click in with the body

- The pellet disk won't fit with the motor

What do you think is the best way to remedy this? Scale up the parts and reprint, or try to make modifications to my existing prints?

Also have you ever encountered the RTC error in which the date uploads as 165/165/2165?

  Are you sure? yes | no

Lex Kravitz wrote 04/08/2019 at 23:05 point

Hi Jay!

Thanks!  The short answer is that this will depend on your 3D printer and the quality of the prints that you are getting with it.  If you are experiencing multiple issues you may want to try using a different printer and see if you get better results.  Or try changing the settings on your printer to try to get better quality prints.  If the parts are only slightly off you can heat them gently with a heat gun and see if it helps them snap together.

I have seen this RTC error, it suggests either the RTC board is disconnected, doesn't have a battery, or isn't set.  Did you follow the instructions on these parts?

Lastly, can post these issues on the FED Google group?  There are other people there who may benefit from these questions.  Please request access here: https://groups.google.com/forum/#!forum/fedforum

Thanks!

  Are you sure? yes | no

zane.andrews wrote 04/08/2019 at 01:13 point

Great job on the FED3 system Lex. And massive thanks for all your efforts to help us put these together.

One question - It would be really useful to have a way to change the active poke port. Even a protocol that has FR1-reversed would be super helpful and useful.

  Are you sure? yes | no

Lex Kravitz wrote 04/08/2019 at 23:11 point

Thanks Zane!  I'm exited to see what you do with it!

That's a great suggestion, and I will look into a simple way to implement this.  Adding a reversed FR1 protocol is very simple, I can whip that up for you.

As a more elegant solution for all programs, what do you think about leaving all programs as is, but swapping which poke is active if a user holds both pokes for ~3 seconds or something?  (BTW, that move is currently programmed to reset the FED but I rarely use it so I could re-purpose it...).

Also, could you post this question on the FED Google group?  There are other people there who may benefit from this or have ideas. Thanks!  https://groups.google.com/forum/#!forum/fedforum

  Are you sure? yes | no

nino.benci wrote 03/11/2019 at 01:38 point

Components list update.

The excel file lists the following LiPo battery;

Adafruit product 354

The component list on this website lists;

Adafruit product 353

The 353 (3.7V 6600mAH) is too big to fit the housing, the 354 (3.7V 4400mAH) is the correct size.

Order the component off the excel list.

  Are you sure? yes | no

Lex Kravitz wrote 04/08/2019 at 02:05 point

Thanks again for catching this Nino - I'm really sorry/embarrassed for all of the errors 8(  It's updated now.

  Are you sure? yes | no

nino.benci wrote 03/03/2019 at 23:13 point

Quick note of advice, the following items are incorrect... "2mm pitch headers" do not fit the 2.5mm pitch of the pin headers...

2mm Pitch Female Headershttps://www.adafruit.com/product/2672

I ordered the kit components and have just found out ( did not do a check, thought the parts numbers were correct )

The following are actually 2.5 mm ( 0.1 inch )

2 mm Pitch Short Male Headershttps://www.adafruit.com/product/3002

Cheers.

  Are you sure? yes | no

Lex Kravitz wrote 03/04/2019 at 01:21 point

Shoot I'm sorry about that, I'll update the part number right away.  Please let me know if you detect any other errors, thanks in advance!

  Are you sure? yes | no

Lex Kravitz wrote 10/07/2018 at 23:26 point

Thanks Sophi!  Yeah I need to do a few more videos and finish the instructions, hopefully I'll find time for that this week!

  Are you sure? yes | no

Sophi Kravitz wrote 10/06/2018 at 22:43 point

FED 3! Hooray! Two mouse pokes in one package is impressive and so is the build. Very clean. Awesome job on the video too! Next time do the video with a mouse :D

  Are you sure? yes | no

Similar Projects

Does this project spark your interest?

Become a member to follow this project and never miss any updates