Rodent Operant Bucket

Similar projects worth following
This is a project that was built by two postbacs in my lab, Kavya Devarakonda and Katrina Nguyen, in 2015. They used an Arduino Uno to train mice to "nosepoke" for sugar water so they could quantify their ability to learn.

The ROBucket code runs on an Arduino UNO, uses an SD shield to log data, and uses an LCD/button shield to control the device and display data. Other hardware includes photo-interrupters to monitor left and right "nose-pokes", and a solenoid valve to dispense sugar water.

This project is released under the terms of the Creative Commons - Attribution - ShareAlike 3.0 license:
human readable:
legal wording:

ROBucket is useful for training mice, as seen in Figure 4 of Devarakonda et al. The full PDF of paper is in files area.

Figure caption: The ROBucket can train mice to respond for sucrose. (a) Number of responses on the active (closed circles) and inactive (open circles) during the first five 1-h training sessions. (b) Number of responses on the active (black bars) and inactive (white bars) during the first and last day of each animal’s training. Data are expressed as mean ± SEM. Asterisks indicate significant within-subject difference (* p < 0.05, ** p < 0.01), analyzed by a post hoc two-tailed paired t-test.

Update that fixes magazine training and also logs center port entries

x-zip-compressed - 3.57 MB - 11/10/2018 at 17:37


Updated code for use with the V2 SD shield

Zip Archive - 4.17 MB - 09/13/2018 at 12:00


Commented out logging to bypass SD card issues

x-zip-compressed - 3.57 MB - 06/26/2019 at 01:34



PDF of the research article describing ROBucket

Adobe Portable Document Format - 752.79 kB - 09/10/2018 at 19:55


ROBucket BOM.png

Bill of Materials table

Portable Network Graphics (PNG) - 69.16 kB - 09/11/2018 at 04:14


View all 6 files

  • 1 × Please see Devarakonda et al PDF in files area for components

  • ROBucket modification #2!

    Lex Kravitz12/03/2018 at 15:41 0 comments

    Macarena Churruca, a grad student in Chile sent me this photo of a modification that puts the ROBucket electronics on a larger box, and mounts them the the outside!  

    She also sent a video!

  • ROBucket can log entries into the center port

    Lex Kravitz11/10/2018 at 17:30 0 comments

    I was asked by a researcher in Chile how to read from the photointerrupter on the center port (where sucrose is dispensed).  I wrote a quick update (available in the files area) that activates the center port.  It shows the Active (A), Inactive (I), Center (C) and Rewards (Rew) on the screen during trials, and writes a new column "Center" to the CSV files.   

  • Cool modification of ROBucket

    Lex Kravitz09/11/2018 at 02:51 0 comments

    Shawn Minnig and his colleagues recently used ROBuckets to study learning in transgenic mice to better understand Huntington's disease.  They made a very nice modification to improve the mounting of ROBucket in the actual Bucket, and also designed a sound attenuating enclosure system for ROBuckets.  And they released all of their modifications as open source!  It's great to see this!

  • Adapting ROBucket for the Adafruit SD Shield V2

    Lex Kravitz09/11/2018 at 02:43 0 comments

    I was contacted by a couple people about ROBucket over the last year, and decided to update its code and make it a bit easier for people to use it.  

    Unfortunately, Adafruit made two versions of their Arduino SD shield.  In the ROBucket paper we used version 1 of the shield, which was discontinued later that year.  Adafruit made several improvements in version 2, but unfortunately the original ROBucket code can not run with this version without modifications.  While making these modifications I ended up rewriting the code with better commenting so it should be easier to read and modify.  

    Full code here, main loop sans functions below.  Feedback welcome!

    void loop() {
      if (ratio_Met) {

View all 4 project logs

  • 1
    Drill mounting holes in the bucket (get these from the PDF in the files area).

    1. Print out the Adobe Illustrator files for the front and side panel on plain paper or removable labels (8½” x 11”). 

    2. Place the templates on the bucket, with the side panel to the right of the front panel. 

    3. Drill seven 1/8” holes and two 5/16” holes where shown on the templates. 

  • 2
    Print out the 3D housing
  • 3
    Plug three JST SH jumper 3-wire assemblies into three photo interrupter boards.

    Label the signal wire for each “L” (for left), “C” (for center), and “R” (for right).

    NOTE: You can use any photo-interrupter you want, but you may have to modify the mounting holes in the 3D housing.

View all 13 instructions

Enjoy this project?



Rachel A wrote 04/15/2022 at 15:29 point

Do you think this would work with rats? I haven't done nose poking with rats so I am not sure if the nose poke holes would accommodate them as well. Thank you! 

  Are you sure? yes | no

Lex Kravitz wrote 11/30/2019 at 03:21 point

Thanks for your updates Macarena!

  Are you sure? yes | no

Macarena Churruca M. wrote 11/27/2019 at 12:51 point

The ROBucket box is very useful for working with mice in different learning modalities. There were some improvements we made:
1. There are changes in the voltage of the current, that is why a diode is welded in the solenoid valve to give stability.
2. It is very important, clean every time the solenoid valve is used, with distilled water.
3. In the conditioning extinction test, no reward is granted, to avoid damaging the solenoid valve, it must be disconnected.

4. The Arduino could be programmed to register the reward. That is, when the mouse does an active nose poke and then a poke in the center. The sum of both must be recorded as a reward.

  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