Some behavioral experiments reward correct performance. A typical response is a lick of a spout and the reward is a fixed volume of water. One simple way to achieve this is by using an Arduino board along with the capacitive sensing library. The diagram below summarizes the parts used. Just connect a 1 Mohm resistor between pins 2 and 3. Pin 2 is also connected to a metallic spout. Short pins 22, 24 and 26 and connect them to one of the solenoid pins of the valve . The micro-valve has 3 ports. The port further away from the pins must be sealed off. The middle port is connected to the spout. The port closer to the pins must be connected to the a 60 cc syringe reservoir. With the syringe filled with 30 cc of fluid at a height of 20 cm from the spout the code below delivers 2 uL of fluid per pulse.
Once downloaded, the Arduino code below accepts 1-byte commands. A command 0f 0x00 (0) simply rests the lick variable and starts monitoring for licks. A command of 0x01 (1) reads out if there had been a lick since the last reset (a single byte reply). A command of 0x02 (2) delivers a reward. Any other number is interpreted as a change in the valve pulse width, thereby changing the volume delivered each time. The only variable that may need to be adjusted is the the threshold for lick detection which is initially set at 500. The code just a skeleton… you will likely need to modify it for your own application. Credit: Nick Olivas in the Trachtenberg Lab helped designed this.