A peer-reviewed version of this preprint was published in ...75. 10 pF to over 2000 pF with a...

12
A peer-reviewed version of this preprint was published in PeerJ on 14 February 2017. View the peer-reviewed version (peerj.com/articles/2981), which is the preferred citable publication unless you specifically need to cite this preprint. Longley M, Willis EL, Tay CX, Chen H. 2017. An open source device for operant licking in rats. PeerJ 5:e2981 https://doi.org/10.7717/peerj.2981

Transcript of A peer-reviewed version of this preprint was published in ...75. 10 pF to over 2000 pF with a...

Page 1: A peer-reviewed version of this preprint was published in ...75. 10 pF to over 2000 pF with a resolution of 0.01 pF. It has a time resolution of 16 ms. Further, signal. 76. filtering

A peer-reviewed version of this preprint was published in PeerJ on 14February 2017.

View the peer-reviewed version (peerj.com/articles/2981), which is thepreferred citable publication unless you specifically need to cite this preprint.

Longley M, Willis EL, Tay CX, Chen H. 2017. An open source device foroperant licking in rats. PeerJ 5:e2981 https://doi.org/10.7717/peerj.2981

Page 2: A peer-reviewed version of this preprint was published in ...75. 10 pF to over 2000 pF with a resolution of 0.01 pF. It has a time resolution of 16 ms. Further, signal. 76. filtering

An open source device for operant licking in rats

Matthew Longley 1 , Ethan Willis 2 , Cindy Tay 3 , Hao Chen Corresp. 4

1 Undergraduate Program, University of Memphis, Memphis, Tennessee, United States

2 Master's Program, University of Memphis, Memphis, Tennessee, United States

3 Undergraduate Program, Duke University, Durham, North Carolina, United States

4 Department of Pharmacology, University of Tennessee Health Science Center, Memphis, Tennessee, United States

Corresponding Author: Hao Chen

Email address: [email protected]

Increasingly complex data sets are needed to fully understand the complexity in behavior.

Credit card sized single-board computers with multi-core CPUs are an attractive platform

for designing devices capable of collecting multi-dimensional behavioral data. To

demonstrate this idea, we created an easy to-use device for operant licking experiments

and another device that records environmental variables. These systems collect data

obtained from multiple input devices (e.g., radio frequency identification tag readers,

touch and motion sensors, environmental sensors) and activate output devices (e.g., LED

lights, syringe pumps) as needed. Data gathered from these devices can be automatically

transferred to a remote server via a wireless network. We tested the operant device by

training rats to obtain either sucrose or water under the control of a fixed ratio, a variable

ratio, or a progressive ratio reinforcement schedule. The lick data demonstrated that the

device has sufficient precision and time resolution to record the fast licking behavior of

rats. Data from the environment monitoring device also showed reliable measurements.

By providing the code and 3D design under an open source license, we believe these

examples will stimulate innovation in behavioral studies.

http://github.com/chen42/openbehavior.

PeerJ Preprints | https://doi.org/10.7287/peerj.preprints.2435v1 | CC BY 4.0 Open Access | rec: 11 Sep 2016, publ: 11 Sep 2016

Page 3: A peer-reviewed version of this preprint was published in ...75. 10 pF to over 2000 pF with a resolution of 0.01 pF. It has a time resolution of 16 ms. Further, signal. 76. filtering

An Open Source Device for Operant Licking1

in Rats2

Matthew Longley1, Ethan Willis2, Cindy Tay3, and Hao Chen43

1Undergraduate program, University of Memphis4

2Master’s program, University of Memphis5

3Undergraduate program, Duke University6

4Department of Pharmacology, University of Tennessee Health Science Center7

ABSTRACT8

Increasingly complex data sets are needed to fully understand the complexity in behavior. Credit card-

sized single-board computers with multi-core CPUs are an attractive platform for designing devices

capable of collecting multi-dimensional behavioral data. To demonstrate this idea, we created an easy-

to-use device for operant licking experiments and another device that records environmental variables.

These systems collect data obtained from multiple input devices (e.g., radio frequency identification

tag readers, touch and motion sensors, environmental sensors) and activate output devices (e.g., LED

lights, syringe pumps) as needed. Data gathered from these devices can be automatically transferred to

a remote server via a wireless network. We tested the operant device by training rats to obtain either

sucrose or water under the control of a fixed ratio, a variable ratio, or a progressive ratio reinforcement

schedule. The lick data demonstrated that the device has sufficient precision and time resolution to

record the fast licking behavior of rats. Data from the environment monitoring device also showed reliable

measurements. By providing the code and 3D design under an open source license, we believe these

examples will stimulate innovation in behavioral studies. http://github.com/chen42/openbehavior.

9

10

11

12

13

14

15

16

17

18

19

20

21

Keywords: operant behavior, licking response, behavior testing device, environment variables, single

board computer, open source

22

23

INTRODUCTION24

Quantitative measurement of rodent behavior is one of the cornerstones of neuroscience. Traditionally,25

neuroscientists have favored the approach of vastly reducing the complexity of measurements. However,26

more recently, many scientists have realized that in order to better grasp the complexity of behavior, data27

sets capturing many more internal and environmental variables and with much higher time and spacial28

resolution are required (Gomez-Marin et al., 2014).29

One of the obstacles in obtaining such data sets is that most commercial behavioral measurement30

equipment was designed decades ago and is not sufficiently flexible to be integrated with emerging31

technologies. In rare cases when new technologies are used for behavioral measurements, such as32

touch screen assays for rodents, the cost of the commercial equipment is prohibitive for most academic33

laboratories. These factors have hindered the collection of “big behavioral data” from complex animal34

behavior (Gomez-Marin et al., 2014).35

On the other hand, Moore’s Law has dictated the continued increase in computing power and the36

reduction of its cost. Recent generations of single board computers are the size of a credit card and yet37

are capable of controlling many behavioral tests. Furthermore, numerous sensors are available to be38

connected to these computers. These sensors can be used to monitor a wide variety of environmental39

variables as well as animal behaviors. Therefore, there exists an opportunity to exploit these readily40

available electronic and computing resources for measuring multi-dimensional behavioral data.41

Here, we describe a project where a Raspberry Pi R© single board computer was used to study operant42

licking in rats. Operant training in animals allows them to associate a response (e.g. peck a spot with the43

beak, press a lever, or lick a spout) with a reward (e.g, food, water, or drugs), as well as reward-associated44

cues (e.g. a light). Operant conditioning is used to study a wide variety of behaviors, especially those45

related to the function of the reward system, such as food consumption or drug abuse. We also used46

Page 4: A peer-reviewed version of this preprint was published in ...75. 10 pF to over 2000 pF with a resolution of 0.01 pF. It has a time resolution of 16 ms. Further, signal. 76. filtering

a motion sensor to track the locomotion of the rat and a radio-frequency identification (RFID) tag to47

track the identity of the rat. In addition, we also designed an environmental sensor set that monitors the48

temperature, humidity, barometric pressure, and ambient light levels.49

METHODS50

The operant licking device.51

This system uses a touch sensor connected to the drinking spouts to record the licking behavior of rodents.52

When the number of licks on a spout meets a predetermined criteria, a syringe pump is triggered to deliver53

a fixed amount of solution to that spout. A visual cue (an LED) is turned on every time the solution is54

delivered. A motion sensor is used to record locomotion of the rodent. An RFID reader is used to read the55

glass ID tag embedded in the animal. All the data are transferred to a remote server via wireless internet56

connection at the end of the sessions. All electronic devices are installed in a 3D printed frame and can57

be placed in a standard rat cage. The syringe pump can be placed on top of the wire grid of the cage.58

The design source files used for 3D printing, software, and instructions for assembly are available in our59

github repository (https://github.com/chen42/openbehavior) under the Creative Commons Attribution60

NonCommercial license (Version 3.0).61

Output

System Add on

Input

Step Motor Controller

Step Motor

Syringe

Motion LED Lick LED LCD

Real Time Clock

Raspber ry P i

I2C

WiFi

USB

Power Supply

12V

Voltage Converter

12V

5V

Touch Sensor

Active SpoutInactive Spout

I2C

Motion Sensor

GPIO

RFID Reader

Antenna

RS232

Motor Switches

GPIO

GPIO GPIO GPIO GPIO

Figure 1. A Diagram of the Operant Licking System. A touch sensor is used to measure the number of

licks by a rat on a spout. When the number of licks reaches a criteria, the Raspberry Pi computer

advances a step motor, which in turn pushes a syringe to deliver a drop of solution. A motion sensor is

used to record the movement of the rat.

Computer62

We used the Raspberry Pi (RPi, model 2B) single board computer. The computer uses a Broadcom63

BCM2836 Arm v7 quad core processor (900 MHz) and has 1 GB RAM. A total of 40 pins are available64

on a header for user expansion, including 17 GPIO pins, an I2C connection, and a serial line. A diagram65

of the peripheral components connected to the RPi is shown in Figure 1. Although sufficiently powerful,66

the RPi is missing a few key components. Therefore, we added a WiFi module (Edimax) and a real time67

clock (DS1307). The clock is connected to the RPi via an I2C interface and is needed to maintain the68

system time when network connectivity is not available. The system power is provided by a 12 V AC-DC69

converter (2 Amp). A DC-DC voltage step down module (LM2596) is used to provide 5 V power to the70

RPi.71

Input devices72

The key component of the system is a capacitive touch sensor (Model MPR121, Adafruit), which73

communicates with the RPi via the I2C protocol. The sensor can measure capacitances ranging from74

2/10

Page 5: A peer-reviewed version of this preprint was published in ...75. 10 pF to over 2000 pF with a resolution of 0.01 pF. It has a time resolution of 16 ms. Further, signal. 76. filtering

10 pF to over 2000 pF with a resolution of 0.01 pF. It has a time resolution of 16 ms. Further, signal75

filtering and debounce are all handled in the chip, which makes this sensor easy to use. We used only two76

of the 12 channels of this sensor. Each channel is connected to one drinking spout to monitor the licking77

behavior. A passive infrared motion sensor (HC-SR501) was used to monitor the activity of the animal.78

We also connected a RFID reader (RDM6300) to the RPi. This reader can detect low frequency (125 kHz)79

glass RFID tags that using the EM4100 standard. These glass tags can be implanted under the skin of the80

rats to provide a unique identification code for each rat. Lastly, we installed two push buttons to provide81

bidirectional manual control of the step motor. This allows the position of the motor to be adjusted when82

loading the syringe.83

Output devices84

The main output device is a syringe pump modified from the design provided by Wijnen et al. (2014). A85

step motor controller (model A4988, with a heat sink) is used to advance a NEMA 11 motor. The motor86

is installed in a 3D printed frame, which also has a holder for a 10 ml syringe. The motor is calibrated to87

push the syringe and deliver 60 µ l of solution to the tip of the spout (via a polyethylene tubing) each time88

it is activated. A total of three LEDs are connected to the device. One is a cue light installed on top of the89

active spout. Two other LEDs are turned on when licking or motion is detected, respectively. Lastly, an90

LCD (16x2 characters) is connected to the GPIO pins. The LCD is the only display of the system and91

provides information about the system before, during, and after the test sessions.92

Software and reinforcement schedules93

Our software is written in the Python programming language and runs on the Raspbian Linux operating94

system (Jessie, released on 05-27-2016). Libraries for the touch sensor and the LCD are provided by95

Adafruit. The main program is automatically launched at system start up. Once the program is loaded,96

two push buttons can be used to adjust the pump for loading the syringe. The system then awaits input97

from the RFID scanner. The session timer starts when the technician scans the glass RFID tag embedded98

in the rat. The touch sensor records the timing of licking from two spouts, designated as the active and99

the inactive spout, respectively. We implemented three reinforcement schedules. When the fixed ratio100

(FR) schedule is used, a reward (i.e. fluid delivered to the active spout) is delivered when a predetermined101

number of licks (e.g. 10) is recorded. A variable ratio (VR) schedule delivers the reward after a randomly102

chosen number of licks, with a predetermined average (e.g. 10). When controlled by a progressive ratio103

schedule, the number of licks required to obtain each subsequent reward is increased until the animal fails104

to obtain a reward within a given time period. A time out period, when the number of licks is recorded but105

has no programmed consequence, is enforced after each reward. Because there is no conventional input106

device present, such as a keyboard or a pointing device, we use a few specific RFIDs to switch between107

these reinforcement schedules (i.e. scanning one particular RFID tag will load the the progressive ratio108

schedule).109

A cue light located above the active spout is turned on for a fixed time (e.g. 5 s) after each reward.110

The number of licks on the inactive spout is recorded throughout the session but has no programmed111

consequence. Data from the motion sensor is recorded using a separate Python program. In addition to112

the timing and type of each event (i.e., lick, movement), the start and finish times are recorded in the data113

files. The LCD is used throughout the session to provide system status and real time data. The Linux114

program rsync is used to automatically transfer data files to a remote server upon the completion of each115

session.116

The environmental variable monitoring device117

The standalone environmental variable monitoring device also uses a RPi. Four sensors are connected118

to the RPi via the I2C communication protocol. These are the TSL2561 for ambient light, HTU21D-F119

for humidity, and BMP085 for barometric pressure. Both the HTU21D-F and the BMP085 contains a120

temperature sensor. Thus the temperature we record is the average reading from these two sensors. The121

Python libraries from Adafruit for these sensors are used to obtain data. We have observed that these122

sensors can draw relatively large amounts of current when in use. Thus, we supplemented an additional123

power source to the I2C bus. Further, instead of running the data logging program continuously, it was124

activated once every 10 min as a cron job, which has increased system stability. The Linux rsync program125

is used to transfer the collected data to a remote server automatically. The Python programs are available126

in our github repository listed above.127

3/10

Page 6: A peer-reviewed version of this preprint was published in ...75. 10 pF to over 2000 pF with a resolution of 0.01 pF. It has a time resolution of 16 ms. Further, signal. 76. filtering

Operant licking for sucrose or water128

Ten female rats purchased from Harlan Laboratory were used. Animals were housed in a reverse light-129

cycled room (lights off at 9:00 AM and on at 9:00 PM). Food and water were provided ad libitum. These130

rats were tested under a FR10, a VR10, and a PR schedule to obtain a 10% sucrose solution (n = 5) or131

water (n = 5). The FR10 and VR10 sessions were 1 h. The PR session ended 10 min after the last lick132

on the active spout. These tests were run in a dark room with all lights turned off. All procedures were133

conducted in accordance with the NIH Guidelines Concerning the Care and Use of Laboratory Animals134

and were approved by the Institutional Animal Care and Use Committee of the University of Tennessee135

Health Science Center.136

Statistical analysis137

Data are presented as mean ± standard error. Student’s t-tests were used to analyze the difference between138

the licks on the active vs. the inactive spouts. Statistical significance was assigned for p < 0.05. The R139

statistical analysis language was used for data analysis and plotting.140

RESULTS141

Operant licking response for sucrose142

We tested two groups of rats for operant licking in five devices assembled as describe above. Rats obtained143

either a sucrose solution (10%, n=5) or water (n=5). Each rat was tested using the FR10, VR10, and PR144

reinforcement schedules. The number of licks and rewards for each data set are plotted in Figure 2. Rats145

licked 4902±1076, 4525±1072, and 1081±227 times on the active spouts when tested on the FR10,146

VR10, and PR reinforcement schedules, and received 89±12, 101±11, 14±1 drops of sucrose solution,147

respectively. In contrast, rats licked 141±38, 241±84, and 115±28 times on the active spouts when148

tested on the FR10, VR10, and PR reinforcement schedules, and received 8± 2, 9± 2, 5± 1 drops of149

water, respectively. The number of licks on the active spout was significantly greater than those on the150

inactive spouts when sucrose or water was provided (2). These results are very similar to those reported151

by Sclafani and Ackroff (2003), indicating that the devices are providing reliable data.152

FR10 VR10 PR

Operant Licking for Sucrose

Counts

110

100

1000

10000

*** *** **

FR10 VR10 PR

Operant Licking for Water

Counts

110

100

1000

10000

* * *

Active Spout

Inactive Spout

Reward

Figure 2. Summary of Lick Responses and Rewards. Ten rats were tested using the operant licking

devices to obtain a sucrose solution (10%, n=5) or water (n=5) under the control of a fixed ratio 10

(FR10), a variable ratio 10 (VR10), or a progressive ratio schedule. A logarithmic scale is used for the

Y-axis. *: p < 0.05, *** p < 0.001, compared to the active spout.

The time course of licks on the two spouts as well as rewards earned from the rat with the highest153

number of licks in each of the six test conditions was plotted in Figure 3. Rats licked almost continuously154

on the active spouts for the entire 60 min testing period for sucrose when the FR10 or the VR10 schedule155

was used. The rate of licking was much lower when the PR schedule was used. Although they sampled156

4/10

Page 7: A peer-reviewed version of this preprint was published in ...75. 10 pF to over 2000 pF with a resolution of 0.01 pF. It has a time resolution of 16 ms. Further, signal. 76. filtering

the inactive spout initially, licking activity became exclusive for the active spout near the end of each of157

the sessions. In contrast, when water was provided, the licks were much sparser, with large time lags158

between receiving rewards. Thus, these data better illustrate the number of licks between rewards. The159

number of licks was not even when the FR10 schedule was used. This is because rats continue to lick on160

the active spout during the 20 s time out period after the reward was delivered.161

0 10 20 30 40 50 60

02

00

06

00

0

Sucrose, FR10

Minutes

Nu

mb

er

of

Lic

ks

l l lllllllll l

llll lllll ll

llllllllll

lllllll lll

llll lllllllllll

lllllllllllll

llllllllllllllll

lll lllllllllllll

lllllllllll

llllllllllll

l

Active SpoutInactive SpoutReward

0 10 20 30 40 50 60

02

00

06

00

0

Sucrose, VR10

Minutes

Nu

mb

er

of

Lic

ks

l l lllllllll

llllllllllll

llllllllllllllll

llllllllllllll

llllllllllll

llllllllllllll

llllllllllll lll

lllllllllllllll

lllllllllll l

0 10 20 30 40 50

02

00

06

00

0

Sucrose, PR

Minutes

Nu

mb

er

of

Lic

ks

llll llll l l

l l l l l l

0 10 20 30 40 50

02

00

40

06

00

Water, FR10

Minutes

Nu

mb

er

of

Lic

ks

l l l l ll ll

l ll l l

10 20 30 40 50 60

02

00

40

06

00

Water, VR10

Minutes

Nu

mb

er

of

Lic

ks

ll l

l l

l

l

lll l

ll

0 10 20 30 40

02

00

40

06

00

Water, PR

MinutesN

um

be

r o

f L

icks

l l l l l l

Figure 3. Time Course of Licks and Rewards. The cumulative number of licks on the active and inactive

spouts as well as rewards (i.e. sucrose solution or water) earned during one test session are shown. Rats

licked continuously on the active spouts for sucrose when the FR10 or VR10 schedule was used. The rate

of licking slowed down dramatically under the PR ratio, where the workload for each subsequent reward

increased rapidly. The rate of licking was much lower when water was provided.

The microstructure of licks is informative for the reward value of the taste substance (Davis and Smith,162

1992). As previously reported (Davis and Smith, 1992; Wang et al., 2014), we defined a cluster as licks163

that occurred within 0.5 seconds of each other. Clusters with fewer than two licks were excluded from the164

analysis. The size of a lick cluster is the number of licks it contains. Inter-licking interval is defined as the165

time between each lick within each cluster. The distributions of inter-lick intervals and the size of lick166

clusters for sucrose or water under the FR10 schedule are shown in Figure 4. The average size of lick167

clusters on the active spout for sucrose was 35.7±6.4 for sucrose and 7.2±1.1 for water (p < 0.05). In168

contrast, the average size of lick cluster on the inactive spout was 8.6±4.0 for sucrose and 5.9±0.4 for169

water (p > 0.05).170

The inter-lick interval on the active spout was 0.15±0.002 s for sucrose and 0.22±0.01 s for water171

(p < 0.01). The inter-lick interval on the inactive spout was 0.20±0.01 s for sucrose and 0.26±0.02172

for water (p < 0.01). The size of the lick clusters for sucrose was in agreement with those reported in173

the literature (Davies et al., 2015). These data not only confirm that the subjective value of sucrose is174

significantly greater than that of water, but more importantly indicate that the device we designed has175

sufficient time resolution to accurately measure the rapid licking behavior of rats.176

The locomotion data collected from the FR10 and VR10 session were presented in Figure 5. Data177

from the PR session was not shown because each rat had a different session length. The movement was178

combined into 1 min bins. The average number within each bin from all the rats were shown. These179

5/10

Page 8: A peer-reviewed version of this preprint was published in ...75. 10 pF to over 2000 pF with a resolution of 0.01 pF. It has a time resolution of 16 ms. Further, signal. 76. filtering

SucroseActive Spout

Cluster Size

Fre

qu

en

cy

0 50 100 1500

20

40

60

80

WaterActive Spout

Cluster Size

Fre

qu

en

cy

0 50 100 150

020

40

60

80

SucroseInactive Spout

Cluster Size

Fre

qu

en

cy

0 50 100 150

020

40

60

80

WaterInactive Spout

Cluster Size

Fre

qu

en

cy

0 50 100 150

020

40

60

80

SucroseActive Spout

ILI, Seconds

Fre

qu

en

cy

0.0 0.1 0.2 0.3 0.4 0.5

02000

6000

WaterActive Spout

ILI, Seconds

Fre

qu

en

cy

0.0 0.1 0.2 0.3 0.4 0.5

020

40

60

80

SucroseInactive Spout

ILI, Seconds

Fre

qu

en

cy

0.0 0.1 0.2 0.3 0.4 0.5

020

40

60

80

WaterInactive Spout

ILI, Seconds

Fre

qu

en

cy

0.0 0.1 0.2 0.3 0.4 0.5

020

40

60

80

Figure 4. Lick Microstructure Analysis of the FR10 Data Set. We defined a cluster as a group of licks

where the inter-lick interval (ILI) was less than 0.5 s. Data from all five rats were combined for the

analysis.

data showed that although there was a general trend of reducing locomotion, rats remained active during180

the entire 1 hr session when sucrose was provided. However, the rats were less active when water was181

provided.182

Environmental data183

The data gathered by the environment sensor set from an animal housing room for the first week of184

July 2016 is plotted in Figure 6. The data showed that the animal facility is under tight climate control.185

However, after adjusting the airflow on July 5th, the temperature was reduced by ˜1 ◦ C and the humidity186

was increased by 3%. The air pressure also shows fluctuation. The level of light recorded indicates that187

the light of the room was reverse cycled (On at 9 PM and off at 9 AM, and that technicians occasionally188

enter the room during the day.189

DISCUSSION190

We designed two devices using single board computers. We tested the operant licking device by training191

rats to obtain sucrose or water using several reinforcement schedules in regular housing cages. We also192

designed a device that can continuously record four environmental variables, including temperature,193

humidity, air pressure, and light levels. We used 3D printers to manufacture the frames of the devices. The194

designs of the devices, including all source files and software, are available under an open source license.195

Since their inception, computers have been an integral part of quantitative behavioral studies. Desktop196

computers are used in most behavioral equipment produced in the past few decades. As predicted by197

Moore’s Law, the number of transistors per square inch continues to double every two years. Computers198

the size of a credit card currently have processing power equivalent to desktop computers from 10 to 15199

years ago. Many behavioral researchers have discovered the relevance of these small computers for data200

collection projects and taken full advantage of their usefulness. For example, Escobar and Perez-Herrera201

(2015) described the use of an Arduino microcontroller in conjunction with a laptop computer to conduct202

operant conditioning experiments. Pineno (2014) reported an operant conditioning device using an iPod203

Touch and an Arduino microcontroller. Most interestingly, Rizzi et al. (2016) designed an Arduino-based204

system that triggered the delivery of optogenetic stimulation from nose pokes of mice.205

We chose to use single board computers over microcontrollers because they have much faster proces-206

6/10

Page 9: A peer-reviewed version of this preprint was published in ...75. 10 pF to over 2000 pF with a resolution of 0.01 pF. It has a time resolution of 16 ms. Further, signal. 76. filtering

Sucrose FR 10

Minutes

Lo

co

mo

tio

n C

ou

nts

05

10

15

20

25

Sucrose VR 10

Minutes

Lo

co

mo

tio

n C

ou

nts

05

10

15

20

25

Water FR 10

Minutes

Lo

co

mo

tio

n C

ou

nts

05

10

15

20

25

Water VR 10

MinutesL

oco

mo

tio

n C

ou

nts

05

10

15

20

25

Figure 5. Locomotor Response. The locomotion data from each rat were combined into 1 min bins. Rats

remained active during the entire 60 min when sucrose was provided, while fewer locomotor activity

counts were recorded when water was provided.

sors, easy access to permanent data storage, and network access, and run on modern operating systems207

while still being very affordable. Although there are numerous single board computers available, we chose208

the Raspberry Pi ($35) because it has a large user community and is the most likely to have sustained209

development, as demonstrated by the recent release of Raspberry 3, which includes a built-in WiFi210

module.211

Our devices demonstrated the utility of RPi in studying rodent behaviors. The small size of the RPi212

allows the entire device to fit in a regular rat housing cage. Combined with low cost, this has the potential213

for breaking down two of the main barriers for many academic labs to conduct operant behavioral tests:214

the lack of funding for expensive equipment and limited space in the vivarium. Another advantage of215

shrinking the size of behavioral test equipment is that it allows rodent behavior to be recorded continuously216

in the home cage. Thus, the diurnal rhythm of the behavior can be recorded without incurring large costs217

for dedicated equipment.218

RFID tags are starting to be used in animal research to provide unique identification codes for animals.219

The low frequency (125 kHz) glass tags (˜$1 each) usually encode a twelve character hexdecimal number220

and therefore can uniquely identify 2.8× 1014 animals for a research project. Because of their small221

size, they can be inserted into a syringe needle and be injected under the skin of rodents without general222

anesthesia. Once embedded, they provide a permanent ID for each individual. These tags can even be223

placed with tissue samples once the animals are euthanized.224

Integrating an RFID reader with the behavioral device allows each test subject to be unequivocally225

identified in the data files. Further, the device can be programmed to start the test session when an RFID226

is detected. This not only simplifies the workflow but also reduces potential noise in the data (e.g. when227

testing multiple animals, some technicians prefer to start the recording once all the animals are placed in228

the testing device. Thus some animals are exposed to the device while their behavior is not recorded).229

Devices with small footprints can suffer from the limited choices of input methods. Although touch230

7/10

Page 10: A peer-reviewed version of this preprint was published in ...75. 10 pF to over 2000 pF with a resolution of 0.01 pF. It has a time resolution of 16 ms. Further, signal. 76. filtering

21

.02

2.0

Temperature

Ce

lsiu

s

2016−

07−

01

2016−

07−

02

2016−

07−

03

2016−

07−

04

2016−

07−

05

2016−

07−

06

2016−

07−

07

50

52

54

56

58

Humidity

Pe

rce

nt

2016−

07−

01

2016−

07−

02

2016−

07−

03

2016−

07−

04

2016−

07−

05

2016−

07−

06

2016−

07−

07

10

03

00

10

06

00

10

09

00

Air pressure

Pa

2016−

07−

01

2016−

07−

02

2016−

07−

03

2016−

07−

04

2016−

07−

05

2016−

07−

06

2016−

07−

07

04

00

80

01

20

0

Ambient light

Lu

x

2016−

07−

01

2016−

07−

02

2016−

07−

03

2016−

07−

04

2016−

07−

05

2016−

07−

06

2016−

07−

07

Figure 6. Environmental data. The temperature, humidity, air pressure and level of light in an animal

housing room are shown. The shift in temperature and humidity on July 5th coincided with an adjustment

of the airflow in the facility.

screens can be used, RFID tags provide a helpful alternative when the number of program options are231

limited. For example, while our program defaults to start the variable ratio 10 schedule, we encoded the232

value of several RFID tags in the program so that when these particular tags are detected, the fixed ratio233

or the progressive ratio schedules will be used. Although this is very simple to use and can be readily234

expanded to include other options, one shortcoming is that we need to use those particular tags to start the235

program. We remediated this by programming two alternative tags for each reinforcement schedule.236

Another potential advantage of the RFID tags is that they allow for the possibility of multiple animals237

to be tested in a group housing setup. However, in our tests, we have found that the detection of RFID tags238

using the RDM6300 reader is not sufficiently reliable. It sometimes misses the tag even when the antenna239

is in close proximity to the tag (maximum sensitivity is found when the tag approaches the antenna in240

a perpendicular direction and at the edge of the antenna loop. One of the main future directions of this241

project is to improve the sensitivity of the RFID detection system, possibly by using a different RFID242

reader, such as those used by Howerton et al. (2012).243

There are several commonly used methods for recording the licking behavior of rodents. The contact244

lickometer supplies a small voltage between the wire floor and the spout. It then detects the small current245

passing through the rat when it licks the spout. This requires a metal floor to be used. An alternative246

method is to set up an infrared beam to monitor the tip of the spout. The tongue blocks the light beam247

and allows the licks to be detected. This method requires the position of the light and the spout to be248

carefully calibrated. We used a capacitive touch sensor to monitor the licking events. Our analysis of the249

lick microstructure showed that this method has sufficient time resolution and sensitivity to reliably detect250

rodent licking behavior. One caveat is that these touch sensors are very sensitive. They can sometimes251

be triggered by environmental interference, especially after they are connected to a large piece of metal,252

such as a rodent drinking spout. We found that adjusting the threshold to touch=36 and release=18 in the253

Python library for the MPR121 touch sensor is sufficient to avoid the noise while still reliably recording254

8/10

Page 11: A peer-reviewed version of this preprint was published in ...75. 10 pF to over 2000 pF with a resolution of 0.01 pF. It has a time resolution of 16 ms. Further, signal. 76. filtering

the licking events.255

One of the main motivations in developing these devices is to study operant alcohol self-administration256

in rats. Rats have many advantages for behavioral neuroscience research (Parker et al., 2013). However,257

many of the widely used rat strains do not readily consume alcohol. We hope the device described here258

will be helpful in establishing a robust model of oral alcohol self-administration. Operant licking provides259

potential advantages over lever pressing behavior, such as its high response-reinforcer contingency.260

Further, the lick microstructure analysis can provide insights into the subjective value of the reward (Davis261

and Smith, 1992). The combination of low cost and small footprint of this device also provides a unique262

opportunity to perform relatively large-scale studies on the diurnal rhythm of alcohol consumption.263

Lastly, the environmental monitoring device allows the collection of several variables that could264

potentially influence alcohol intake in the long run and improve experimental reproducibility. Although265

commonly ignored, more and more recent data show that environmental factors such as temperature266

(Chesler et al., 2002), humidity (Chesler et al., 2002), barometric pressure (Mizoguchi et al., 2011), noise267

(Okada et al., 1988; Prior, 2002), illumination (Valdar et al., 2006), and vibration (Okada et al., 1988) have268

a great impact on animal behavior. Our low cost system can capture large amounts of environmental data,269

which can improve understanding of the complex effects of the environment on behavior and increase270

research reproducibility (Collins and Tabak, 2014).271

A potential disadvantage of our approach is that manufacturing these devices may require skills not272

present in a behavioral neuroscience lab. For example, although 3D printers have become very affordable,273

printing high-quality parts is still a trial and error process. For example, two parts of the syringe pump274

that hold the stainless steel rods need to be printed with precise dimensions to ensure accurate delivery of275

the solutions. It is possible that the design files need to be slightly modified according to the printer and276

printing conditions (e.g. temperature, resolution, etc.) to achieve the precision needed. One alternative is277

to use commercial 3D printing stores to manufacture these parts.278

In summary, we developed two open source devices that can be used to collect multi-dimensional data279

for behavioral studies. By providing the design and software under an open source license, we hope they280

will stimulate the wider adoption of single board computers and innovation in behavioral measurements.281

ACKNOWLEDGMENTS282

This work was supported by NIH DA-037844 (HC) and the Faculty Start Up Fund by the University of283

Tennessee Health Science Center. The authors thank Ms. Pawandeep Kaur for her excellent technical284

assistance in collecting the behavioral data.285

REFERENCES286

Chesler, E. J., Wilson, S. G., Lariviere, W. R., Rodriguez-Zas, S. L., and Mogil, J. S. (2002). Identification287

and ranking of genetic and laboratory environment factors influencing a behavioral trait, thermal288

nociception, via computational analysis of a large data archive. Neurosci. Biobehav. Rev., 26(8):907–289

923.290

Collins, F. S. and Tabak, L. A. (2014). Policy: NIH plans to enhance reproducibility. Nature,291

505(7485):612–613.292

Davies, J. R., Humby, T., Dwyer, D. M., Garfield, A. S., Furby, H., Wilkinson, L. S., Wells, T., and Isles,293

A. R. (2015). Calorie seeking, but not hedonic response, contributes to hyperphagia in a mouse model294

for Prader-Willi syndrome. Eur. J. Neurosci., 42(4):2105–2113.295

Davis, J. D. and Smith, G. P. (1992). Analysis of the microstructure of the rhythmic tongue movements of296

rats ingesting maltose and sucrose solutions. Behav. Neurosci., 106(1):217–228.297

Escobar, R. and Perez-Herrera, C. A. (2015). Low-cost USB interface for operant research using arduino298

and visual basic. J. Exp. Anal. Behav., 103(2):427–435.299

Gomez-Marin, A., Paton, J. J., Kampff, A. R., Costa, R. M., and Mainen, Z. F. (2014). Big behavioral300

data: psychology, ethology and the foundations of neuroscience. Nat. Neurosci., 17(11):1455–1462.301

Howerton, C. L., Garner, J. P., and Mench, J. A. (2012). A system utilizing radio frequency identification302

(RFID) technology to monitor individual rodent behavior in complex social settings. J. Neurosci.303

Methods, 209(1):74–78.304

Mizoguchi, H., Fukaya, K., Mori, R., Itoh, M., Funakubo, M., and Sato, J. (2011). Lowering barometric305

pressure aggravates depression-like behavior in rats. Behav. Brain Res., 218(1):190–193.306

9/10

Page 12: A peer-reviewed version of this preprint was published in ...75. 10 pF to over 2000 pF with a resolution of 0.01 pF. It has a time resolution of 16 ms. Further, signal. 76. filtering

Okada, A., Nakamura, H., Nakamura, H., and Nohara, S. (1988). Combined effect of whole-body307

vibration and noise on the dopamine turnover in the rat brain. J. Acoust. Soc. Am., 83(S1):S22–S22.308

Parker, C. C., Chen, H., Flagel, S. B., Geurts, A. M., Richards, J. B., Robinson, T. E., Solberg Woods,309

L. C., and Palmer, A. A. (2013). Rats are the smart choice: Rationale for a renewed focus on rats in310

behavioral genetics. Neuropharmacology, 76 Pt B:250–258.311

Pineno, O. (2014). ArduiPod box: a low-cost and open-source skinner box using an ipod touch and an312

arduino microcontroller. Behav. Res. Methods, 46(1):196–205.313

Prior, H. (2002). Effects of predictable and unpredictable intermittent noise on spatial learning in rats.314

Behav. Brain Res., 133(2):117–124.315

Rizzi, G., Lodge, M. E., and Tan, K. R. (2016). Design and construction of a low-cost nose poke system316

for rodents. MethodsX, 3:326–332.317

Sclafani, A. and Ackroff, K. (2003). Reinforcement value of sucrose measured by progressive ratio318

operant licking in the rat. Physiol. Behav., 79(4-5):663–670.319

Valdar, W., Solberg, L. C., Gauguier, D., Cookson, W. O., Rawlins, J. N. P., Mott, R., and Flint, J. (2006).320

Genetic and environmental effects on complex traits in mice. Genetics, 174(2):959–984.321

Wang, T., Wang, B., and Chen, H. (2014). Menthol facilitates the intravenous self-administration of322

nicotine in rats. Front. Behav. Neurosci., 8:437.323

Wijnen, B., Hunt, E. J., Anzalone, G. C., and Pearce, J. M. (2014). Open-source syringe pump library.324

PLoS One, 9(9):e107216.325

10/10