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, home-cage based behavioral training of mice for research studies.

This is a battery powered FED device that includes two input sensors 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 nosepokes, 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:
  legal wording:

Main code

x-zip-compressed - 16.50 kB - 10/04/2018 at 01:28



Flash this first to set the RTC

ino - 6.96 kB - 09/13/2018 at 12:04


FED3 100118

Zip file of 3D parts for printing FED3

x-zip-compressed - 479.83 kB - 10/01/2018 at 18:52



PCB fabrication file

brd - 100.88 kB - 10/06/2018 at 17:58


oFED BOM 081518.xlsx

Bill of materials, current as of 081518

sheet - 10.69 kB - 08/15/2018 at 14:43


View all 6 files

View all 11 components

  • First contact!

    Lex Kravitz7 days ago 0 comments

    We finally started using FED3 with mice!  These mice are our 'beta testers' to see how FED3 works, how to break it, etc.  This is a mouse that hasn't learned to use FED3 yet, I'll update this when he learns!

  • Pre-installed behavioral programs on FED3

    Lex Kravitz10/09/2018 at 03:06 0 comments

    FED3 includes NINE behavioral programs that can be selected directly from the FED, no computer needed.  All of FED3's code is open source so you can tweak these programs further or write your own if you need to.  For tweakers, you may want to look at the "a_header" tab in the Arduino IDE, which has the following variables that you can safely change:

    //Timeout length for all programs (in seconds)
    const byte timeout = 0; //timeout between trials in seconds
    //For Compulsivity test
    const byte trialsToAversStim = 3;
    const byte stimsBeforeSwitch = 5; // How many aversive stims in Active mode?
    //For Prob Reversal Task
    byte rewardProb=80; //probability of reward on active poke in prob reversal task 

    However, for many people there's no need to modify the code.  The FED3 code can run:

    Free-feeding (FED3 acts like FED1/FED2)

    FR1, FR3, FR5 (fixed ratio programs where a set number of pokes is needed to get a pellet)

    Progressive Ratio (the number of pokes needed increases with each pellet)

    Extinction (no pellets, but log behavior on left and right pokes)

    Compulsivity test (this one alternates through blocks of 15 trials, in which on every other block, every 3rd pellet is paired with an aversive light flash)

    Light tracking (a visual learning task in which the animal has to poke where the light is)

    Probabalistic reversal (pellets are dispensed probabalistically on left poke (80% of pokes get a pellet) or right poke (20% of pokes get a pellet).  Every 8 pokes on the higher probability side causes the probabilities on the pokes to switch.

    See these in action below:

  • 3D printing tips

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

    This log will cover 3D printing tips.  If you have suggestions from your own experience please leave them below!

    FED3 was designed to be printed with minimal support material, as our printers don't have supports.  You'll notice that many of the parts "slope up", which allows them to be built without any supports. 

    FED3 is a mechanical device, and the quality of the print will affect its reliability.  One of the biggest issues we've experienced with FED3 are pellet jams, which can be caused by imperfections in the print.  We print FED3 parts at a slow speed of 40mm/s and a layer height of 100microns.  This takes about 24 hours of total print time to produce one FED3.  The front plate takes about 10 hours but these settings make very smooth surfaces for dispensing pellets.

    We print much faster while we are prototyping.  Here are some examples of different print settings and potential issues that occurred below:

    200 micron layer height, 40mm/s (~4 hours to print front plate).  Print is OK but has some rough areas:

    200 micron layer height, 100mm/s (~2.5 hours to print).  Many problems!

  • First complete build!

    Lex Kravitz08/15/2018 at 15:45 0 comments

    We have finished the 3D design and assembled the first two operant FEDs!  Stay tuned for validation data, but for now, some photos!

    Screen displays behavioral data, timestamp, and battery life:

  • Price breakdown / BOM

    Lex Kravitz08/15/2018 at 14:42 0 comments

    Mohamed prepared this BOM (spreadsheet in files area).  Operant FED (not including 3D printing) is ~$135 each, but that can drop to ~$110 in bulk with price breaks on components.

  • 50 PCBs!

    Lex Kravitz08/15/2018 at 14:38 0 comments

    This showed up today!  We're getting to work populating these!

  • PCB v5 - done!

    Lex Kravitz07/08/2018 at 16:09 0 comments

    This is the final version!  It seems to work well, we may just update the orientation of the buzzer, but otherwise all systems are go!  Video coming soon...

  • PCB v4 - almost there!

    Lex Kravitz06/20/2018 at 17:41 0 comments

    We skipped right over PCB v3, and our v4 version is much easier to wire up, as we mounted the display and the BNC output directly to the PCB.  We also coded up some control code that runs 4 programs: a free-feeding program, FR1, FR5, and a progressive ratio feeding program.  See start screen video below :)

  • PCB v2 video demo!

    Lex Kravitz05/26/2018 at 17:37 0 comments

    Video demo of populated operant FED PCB v2 in operation

  • PCB Round 2 testing complete!

    Lex Kravitz05/24/2018 at 12:08 1 comment

      Mohamed populated the new PCBs over the last week and they are working great!  To recap, these boards include:

      1. Three Sharp Photo-Interrupters (2 will be operant "pokes", and one will be used to detect pellets that are dispensed
      2. One stepper motor controller and 5V stepper motor for moving the pellet dispensing disk
      3. One  Sharp low-power memory LCD display
      4. One 8 LED Neopixel strip
      5. One beeper for auditory feedback
      6. One Feather Adalogger M0 board to control the device and save data

      The idea for this improvement to FED2.0 is that this will be a true "platform" device, that can be flashed with different code to function differently.  So one code can make it act like FED2.0, while other code can deliver more complex operant paradigms for training mice.  

      We confirmed that all hardware on this PCB rev is operational, but (of course!) we want to make a couple tweaks before we mass produce.  We want to make it a bit easier to solder - a couple components were too close, and we want to move the location of the screen.  Overall this will provide a lot more functionality than FED2.0, while being much easier to assemble and taking up ~1/2 the space!  

View all 15 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, 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?



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