Enhancement suggestion - Automated access control / food restriction programs

178 views
Skip to first unread message

Dan Brierley

unread,
Oct 16, 2018, 5:21:30 AM10/16/18
to FEDforum
FED 3 looks to have a lot of additional functionality that could really improve the efficiency of feeding labs - can't wait to get mine up and running!

Couple of suggestions for new programs which would be very helpful if can be implemented?

1. User-specified fasting periods: Could we set a time-out period when the FED does not dispense, then turns on light(s) and/or buzzes to signify when food is available again on ad-lib basis? Key issue here (which the Sable Promethion system struggled with IIRC) would be ability to set the schedule over a multi day cycle, so can start a fasting period one day and continue it through past midnight into next day (for overnight fasting). 

2. Ad-lib feeding up to specified amount of pellets per day: To keep mice on a food restriction schedule or for pair feeding paradigms.

Lex Kravitz

unread,
Oct 16, 2018, 11:21:24 AM10/16/18
to FEDforum
Hi Dan,
Thanks for the suggestion, I've heard this suggestion before and I think these are great ideas!  I'll work on writing a variant of the code to do this.  Let me know if these would cover what you're thinking of?

For idea #1, FED3 has a realtime clock (RTC) on it so this should be very straightforward.  We can use the LED-bar to signal when food is available with a low-level light and have the user set the start and end time for food availability.  Something like: 
foodAvailable = "20:00"
foodUnavailable = "08:00"

For idea #2, I would imagine setting a time for each "day" to start, and a max pellets per day.  So the user would again set 2 variables: 
dayStart = "08:00" 
maxPellets = 150  
So here the FED would stop dispensing if he takes more than 150, but each day at 8am the pellet count would reset. 

I'll post back here when I've had a chance to work on these.  Best,  
-Lex

zane andrews

unread,
Apr 8, 2019, 10:24:31 PM4/8/19
to FEDforum
I think both of these ideas are great and could imagine using similar approaches. Are these available?

Cheers

ZAne

Lex Kravitz

unread,
Apr 10, 2019, 10:44:26 AM4/10/19
to FEDforum
Thanks for bringing these up again.  I didn't implement this yet but I'll put it on the list to work on while I do the reversal stuff!

Amy Sutton

unread,
Jun 30, 2019, 8:51:59 PM6/30/19
to FEDforum
New FED user that is very interested in both of these as well! I've done a quick and dirty adaptation to the code to adjust for timed feeding (using the RTC). For reference, it is important to make sure the clock on each FED is correct by running the FED3_SetClock code. Make sure you download the most recent code from the hackaday, as Lex and I noticed a small glitch in the code that was previously up there if the RTC was previously set and needs to be adjusted.  Below is what I've simply added to the front start up which is working nicely: 

Main loop

********************************************************/

void loop() {

  CheckForPellet();

  if (PelletAvailable && FEDmode != 5) {  // Don't sleep during extinction testing, and sleep only if sleepflag !=1

    sleep();

  }

  else {

    CheckPokes();

    DateTime now = rtc.now();

    if (Ratio_Met == true && (now.hour() >= 18 && now.hour() < 21) { // addition to adjust time based on 24 hour clock

      Feed();

    }

  }

  //SerialOut();  

 

I am working now on making a new mode that is timed feeding, as well as a mode for pellet number limitations. 

All this to say, stay tuned! But, for now, the code above works fine for timed feeding, you just have to reflash the original code on the FED if you want to switch back to free feeding.

Amy 

Renée Poelman

unread,
Aug 31, 2022, 7:58:03 AM8/31/22
to FEDforum
Hi Lex,
I was wondering if there is a function to set a maximum amount of pellets in the free feeding mode on the FEDs? 
And would it be possible to set the maximum using the nosepoke hole menu we use for setting the device number etc.?
I would like to food restrict my mice, but the number of pellets will be individual for each mouse and has to be adjusted on different days. 
Best,
Renée


Op maandag 1 juli 2019 om 02:51:59 UTC+2 schreef amys...@gmail.com:

Lex Kravitz

unread,
Sep 2, 2022, 11:02:50 AM9/2/22
to FEDforum
Hi all,
I am attaching two examples that should help here!  The first is "FreeFeeding_Limited.ino", which makes use of the variable fed3.PelletCount (see all available variables here!).  Here, I modified the void loop() from the FreeFeeding.ino example to only run the Feed() function if fed3.PelletCount is below the number set in the variable maxPellets.  When fed3.PelletCount exceeds maxPellets the FED3 will enter an inactive state, and you can reset FED3 to have it start over and dispense that same number of pellets again. In the attached examples maxPellets is set to 5 to facilitate testing, so you can increase this number before flashing. 

void loop() {
  fed3.run();                                           //Call fed.run at least once per loop
  if (fed3.PelletCount < maxPellets) {                  //Only dispense a certain number of pellets
    fed3.Feed();                                        //Drop pellet
    fed3.Timeout(5);                                    //5s timeout
  }
}

In the second example "FreeFeeding_LimitedDailyReset.ino" I added code to multiply maxPellets by the number of days since FED3 booted up. This should allow FED3 to dispense the number of pellets set by maxPellets each day without user intervention.  I wanted to post both versions but I did not wait a day to fully test out the daily reset version. I can follow up (or someone else can) here to confirm that it resets daily. 

Renée, setting maxPellets individually each day for each mouse is more tricky.  It could be done by reflashing the "FreeFeeding_Limited.ino" code with a new maxPellets value each day, although that's annoying.  maxPellets could also be modified from the startup poke menu as you suggest but that requires more work. I opened an issue in the FED3 library Github so I don't forget about this but I likely won't look into this for a bit!

Please post back if you try either code, if they're useful I'll add them to the library examples. 
Best, -Lex

FreeFeeding_LimitedDailyReset.ino
FreeFeeding_Limited.ino

Alexandra Porczak

unread,
Sep 13, 2022, 6:13:19 PM9/13/22
to FEDforum
I just started pair feeding and I found FreeFeeding_Limited.ino to be incredibly useful! I'll be trying out FreeFeeding_LimitedDailyReset.ino for the next few days. 

Alexandra Porczak

unread,
Sep 15, 2022, 2:25:55 PM9/15/22
to FEDforum
Hi everyone,
I tried to use FreeFeeding_LimitedDailyReset.ino and my Feds did not reset after a day. Any suggestions?
Thank you!

Lex

unread,
Sep 15, 2022, 2:31:14 PM9/15/22
to Alexandra Porczak, FEDforum
Thanks for the feedback, I'll look into it!  I didn't do a full 24 hour test before so it seems it needs more testing.  I'm traveling now but hopefully will figure it out this week!

--
You received this message because you are subscribed to the Google Groups "FEDforum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fedforum+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fedforum/53a96e4a-9ae7-4ef4-9703-9b8512ad3fcfn%40googlegroups.com.

Matthew Perkins

unread,
Dec 28, 2023, 10:36:33 AM12/28/23
to FEDforum
Hi Alexandra, 

Not sure if this is something you worked out, but it seems there is a typo in the program, I think at line 28 column 35, the = should be - 
I am testing now if this resolves.

Reply all
Reply to author
Forward
0 new messages