Feeding Experimentation Device (FED) 2.0

FED measures food intake in mice. It is battery powered and designed to be used in rodent colony caging.

Similar projects worth following
FED is a Feeding Experimentation Device for measuring food intake in mice. It is a 3D printed pellet dispensing device that operates with the following logic:
1) Dispense a 20mg food pellet and monitor its presence with a photo interrupter
2) Log the date and time when the pellet is taken by the mouse
3) Repeat

The data is stored to an SD card and can be analyzed after an experiment to understand feeding patterns over multiple days. FED is battery powered and small enough to be used in many experimental conditions, including rodent home cages.

FED2.0 improves on FED1.0 in the following ways:

  1. Smaller, cheaper, and easier to build
  2. More reliable pellet dispensing
  3. Longer battery life - FED2 should last around 2 weeks on a charge.  This can be increased quite a bit with some hardware and code changes (message me if you want details) but we prioritized ease of build and use over battery life.
  4. FED2.0 has a screen!  

TODOs, as of 6/01/18:

  1. Implement wireless data transfer to watch data in realtime (in progress using Particle Photon and Blynk for visualization).
  2. Work on RFID for tracking feeding from multiple subjects (this is in progress but it's more complicated than we though!)

FED 2.0 is a redesign of the original FED device developed by Katrina Nguyen and her colleagues in 2016, and published in the Journal of Neuroscience Methods. FED2.0 runs on an Adafruit Feather Adalogger M0, and uses boards and code from Adafruit, Paul Stoffregen's Time library, and Arturo Guadalupi's ZeroRTC library.  

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

Zip Archive - 315.43 kB - 09/13/2018 at 12:06



Code for setting the RTC on the FED

ino - 5.80 kB - 08/21/2018 at 00:50



Libraries to run FED - unzip to your Arduino/libraries directory

Zip Archive - 3.84 MB - 08/21/2018 at 00:43


FED2 operating instructions.pdf

PDF with operating instructions - please comment and provide feedback!

Adobe Portable Document Format - 2.05 MB - 03/12/2018 at 18:25



All 6 STL files, updated 030418

x-zip-compressed - 266.12 kB - 03/04/2018 at 18:58


View all 7 files

View all 17 components

  • Around the world FEDs!

    Lex Kravitz07/02/2018 at 19:46 0 comments

    We have heard from people building FEDs in several countries, which is great!  These include Canada, France, Switzerland, Germany, S Korea, and several sites in the US!  This log is recognizing where FEDs are going. Please get in touch to put your photos up here!

    First up... Lydia Hanna sent this photo from Exeter University in the UK!

    This is actually the FED1.0 design, from Zhenwei Su, Post-Doctoral fellow in Nick Betley's lab at University of Pennsylvania

    And a FED2 from Kristina Wirkowski in the same lab!

  • License details

    Lex Kravitz06/24/2018 at 13:26 0 comments

    FED is released following the terms and conditions of the MIT license:

    Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

    The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.


  • 3D printing tips

    Lex Kravitz06/09/2018 at 13:59 0 comments

    This log will include a few tips on 3D printing FEDs.  Please feel free to add your own tips in the comments!

    1. A note on suppports: The printer we use is cheap and does the job, the Sindoh 3DWox (This is not an endorsement of this printer BTW, just stating what we use). Because our printer doesn't print "support material", we have designed all of the parts to be printed with as few supports as possible.  When you slice your models to print, it is possible that your software will want to add support.  This may be OK for some parts, but you should remove any supports from inside the pellet "funnel".  Stray plastic in here can cause pellet jams.

    2. Inspect the pellet path for stray plastic strands.  While it doesn't matter if they are on the housing, the FED is a mechanical device and stray plastic in the pellet dispensing area or the pellet funnel can cause jams.  Take care to look this over and make sure there aren't any stray pieces of plastic.  For instance, in yellow I've circled a little piece that can interfere with the movement of the pellet disc in this print:

    3. Tolerances are different on different printers.  We have noticed that different printers produce parts with different tolerances.  In particular, this can be a problem with tight-fitting parts, such as the sliding back door to FED.  If your parts don't slide together nicely you may need to tweak the design a bit to get it dialed in for your printer.

  • FED variant #2 - "Triggered on input"

    Lex Kravitz06/05/2018 at 01:06 0 comments

    A colleague asked for a small modification to FED, such that in addition to the output pulse on the BNC connector, it would have a 2nd BNC which it would use as an input.  This input would trigger FED to dispense, but we would still monitor the pellet well and only dispense if it was empty.  This allows FED to act like a "smart" pellet dispenser in operant tasks, such that it not only dispenses a pellet, but detects when it is removed.  

    Feeling a bit lazy, I just drilled a hole in a regular FED instead of reprinting a new base with 2 holes for BNC connectors.  I connected the new BNC to digital pin 5 on the Feather (remember when we put extra 90 degree headers there?), and wrote an updated code to allow for this behavior.  Updated code is available in the files area, to use simply connect the input BNC to pin 5 and ground, and flash the updated code.

  • How to change the timeout between pellets

    Lex Kravitz05/26/2018 at 14:00 0 comments

    We included a timeout between pellets to stop the mice from taking one pellet, dropping it, and immediately grabbing the next one.  We set this to 15 seconds by default but it can be easily changed.  In the "a_header" tab in the Arduino IDE, change the number "15" in this line to update it:

    int timeout = 15; //timeout between pellets in seconds

  • Motor considerations for FED

    Lex Kravitz05/26/2018 at 13:43 1 comment

    We have experimented with several stepper and servo motors to control FED, and we found one that works well for dispensing pellets.  This log will describe a bit of our experience and what to look for if you want to choose a different motor for a pellet dispenser.

    We needed to find a balance between having a motor that is strong enough to move the pellet disk, but also weak enough to not grind up pellets if it encounters resistance.  Grain pellets disintegrate very easily, and create dust that can gum up the works. While stepper motors are a bit more complicated to control than servos (they require a driver board), we found that they are a better choice as all of the servos we tried would grind up pellets and result in pellet jams.  They would typically work for a couple of hours, but after 1-2 days they would look like this

    Obviously this FED can no longer dispense until it is unclogged.  So if you want to experiment with different motors, or designing a different pellet dispenser altogether, we recommend choosing a geared stepper motor that will stall when it encounters resistance, rather than powering through and pulverizing the pellet.  While this can take a bit longer to dispense a pellet, we coded the motor to try dispensing 10 times, and then perform a big movement to dislodge any jammed pellets. 

    As one final point, if you use sucrose pellets they are much harder than the grain pellets and are therefore more resistant to crushing and jamming.

  • (sorta) Mass production!

    Lex Kravitz04/27/2018 at 18:20 0 comments

    We're currently building a group of 12 FEDs -  I'll post how they turn out when we have them all but here are some production pics!

    Update 06-04-18: Here we go, 14 FEDs!

  • Troubleshooting

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

      This will be a log dedicated to troubleshooting.  I'll edit this post as more issues are identified and (hopefully!) resolved. 

      1. FED code won't compile in the Arduino IDE - errors about RTCZero come up. There is an incompatibility between the code for Pail Stoffregen's Timelib library that is used by FED and an older Time library in the Arduino IDE.  The issue is documented in comments here:  Long story short, to fix this, go to wherever your "Time-master" library is installed (mine was in User\Documents\Arduino\libraries\Time-master), and rename the file "Time.h" to "Time_h.h".  Restart the Arduino IDE and this should fix the issue.
      2. Motor won't turn after building hardware - Check that battery is plugged in and charged.  The motor requires the most current of anything in FED.  When it is low, or if FED is powered by USB without a battery connected, everything else can appear to work but the motor won't receive enough current to turn.
      3. FED keeps spitting out pellets and wont' stop! There are two main reasons why FED may not detect that a pellet has been dispensed:  1) If the photo-interrupter is not correctly in place the pellet may not be detected. Make sure the pellet lands in between the "arms" of the photo-interrupter. 2) The photo-interrupter works by detecting the IR LED in one arm with an IR detector in the other.  If there is a lot of ambient IR light (for instance, if FED is in direct sunlight! the photo-interrupter may not detect the pellet.  We've experienced this issue even indoors, when FED is placed in direct sunlight from a window.
      4. FED takes a while to dispense each pellet. FED will attempt to dispense a pellet and continue trying until it is successful.  If something is impeding the pellet disk from turning, this can take many attempts.  We have found that sometimes a small bit of plastic from the printing will get in the way (see yellow circle below for example).  Watch FED try to dispense with no pellets - if it seems to be getting caught make sure there is nothing impeding the turning of the disk
      5. FED dispenses 2 pellets. In our hands, this happens <1% of the time.  We have found it very hard to reduce this further.  If it is occuring at a higher frequency than this, make sure the photo-interrupter is positioned correctly as it may not be detecting the first pellet.

      Please message me more issues and I'll log solutions here!

  • Example FED2 data

    Lex Kravitz03/13/2018 at 16:29 0 comments

    We have recorded 6 FEDs for well over a week straight (they are doing great!).  Pellet data from these devices is downloadable here:

    Example FED2 data

    If anyone wants to discuss building analyses tools for this data (meal patterns, nigh/day feeding, etc) please message me!

  • Operating instructions

    Lex Kravitz03/12/2018 at 21:00 0 comments

    I just uploaded a document to the files section containing operating instructions.  Describes a few quirks like needing to re-flash to reset the date/time.  Maybe in a future build I'll come up with a workaround that doesn't require that but for now that's how it's done!

View all 14 project logs

  • 1
    Print out the six 3D parts

    The print needs to be of decent quality.  It is a mechanical pellet dispenser, so if your print is poor it may jam or not work correctly.  I printed these in PLA on a Sindoh 3DWox printer.  STL files located in the files area.  

  • 2
    (optional) Spray the 3D parts with clear acrylic

    This is to protect them from mouse gross-ness.  Don't spray the pellet disk.  Also no need to coat the insides of the parts.  Let them dry for a couple days before putting them with mice. 

  • 3
    Add headers to the Adalogger M0 board and the Memory Display

    Solder straight male headers to the Adalogger board, instructions here: 

    Solder six 90 degree headers from Vin to CS pins on the Memory Display. You can plug the 6-wire harness in while soldering to keep the spacing correct.

View all 16 instructions

Enjoy this project?



Sophi Kravitz wrote 07/16/2018 at 18:15 point

Looks like you updated a lot of these instructions. How'd it go?

  Are you sure? yes | no

Lex Kravitz wrote 07/16/2018 at 19:28 point

So far so good! were any changes made to how images were handled?

  Are you sure? yes | no

Lex Kravitz wrote 05/25/2018 at 13:43 point

Thanks for the comment!  

Degu sound like fun.  I lived with a roommate that had lizards once and the crickets really bothered me too.. not the crickets themselves, but the whole process of buying a clear plastic bag of them from the petstore, listening to them chip all night in their bag, and then putting them in the lizard cage to be eaten a couple at a time... 

If you get more Degu it should be much easier to log the running data with the kinds of things you can buy on Adafruit or Sparkfun these days.  We also made a logging wheel that does just this and will put it on Hackaday soon.  We 3D print the wheel itself and used a hall effect sensor and a magnet to count rotations.

  Are you sure? yes | no

Morning.Star wrote 05/26/2018 at 06:02 point

They are smart and social and very vocal, like guinea pigs. I gather they are related, even though they look like chinchilla and gerbils. Between them yelling all day, and the crickets at night it was a zoo lol.

They are also very destructive, a plastic wheel lasts a matter of a few days before it gets chewed up, and I had to bolt a metal wheel to a metal plate with a bearing somehow. The aluminium drive motor proved inedible ;-)

They also run, and I mean run, a few kilometres every day throughout their lives at speeds up to 5kmh so for a degu it needs to be 10" dia minimum, have decent bearings and a solid mount. Oiling The Degu with olive oil to keep the squeaking down got on my nerves after a fashion... ;-p

I looked into a 'flying saucer' wheel, which apparently had great success with degu because of all that. It's a slightly dished plate on a hub that the degu runs on, not inside, and takes up less room. The pups took to running in teams though, which was hysterical watching them learn to synchronise step.

Definitely worth it :-D

  Are you sure? yes | no

Morning.Star wrote 04/27/2018 at 23:14 point

I used to have a colony of Degu, lovely little things. I bought my daughter a pair of supposedly females after she researched them and bugged me about them relentlessly. This was a lesson well learned, the previous year she asked for a pet and was told small and furry, me expecting a rodent. At the shop she chose a Rose Tarantula, which I grimly paid for as promised. It wasnt so much the pink and furry but its food that bothered me, crickets are nasty. Worse being munched by a million-year-old monster. Yuk...

Then when one of the degu swelled up like a tennis ball with legs and presented us with a litter of pups on New Years Eve, I gave up and put up with a lizard, a snake, several rats, fish, a mantis, and a truly evil gerbil called Goebbels who never learned not to bite. What I called him is unrepeatable ;-)

Those were happier days, I wont go on, but to say your nosepoke device made me laugh and remind me of them. I had plans, I even had an old disk-drive motor as the spindle of a wheel so I could record the miles they run each day as they can live for a decade or more. One did, and lived with my daughter and her partner until a year or two ago but I never got my data.

I wish you luck. If it works out, and is scalable, perhaps it might work on children never mind the pets XD

  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