Calibrate the water valve#
Preparation#
Label and weigh two weigh boats for the left and right water valves respectively.
Ensure that the syringes on both sides are suspended at the same height and the lengths of the water tubes are equal. Make sure the water tubes are not compressed (e.g., by the arena lid).
Removing Air Bubbles#
Select the manual water task in
vr4mice.Set the water valve opening time to 5000 ms.
Flush the tubes repeatedly to remove air bubbles.
If bubbles persist, apply pressure with the syringe plunger while the water valve is open.
After removing the air bubbles, refill the syringe to the 20 ml mark.
Measurement#
In
vr4mice, select the manual water task and set the water valve opening times to:100 ms, 200 ms, 300 ms, 400 ms, 500 ms, 600 ms, 700 ms, 800 ms, 900 ms, 1000 ms.
Place the weigh boat under the lick port.
Open the valve and dispense the water into the weigh boat.
Carefully remove the weigh boat after water has been dispensed. Collect any clinging water droplets with the edge of the weigh boat.
Weigh the boat to measure the water dispensed. Perform each measurement three times to ensure consistency.
Get reward size#
Subtract the weight of the weigh boat from the recorded measurements, and enter the results into the code.
Use curve fitting to determine the corresponding time needed to open the water valve for the desired water volume.
Here is an example of a calibration from Tolias Lab.
import numpy as np
import matplotlib.pyplot as plt
time = [100,200,300,400,500,600,700,800,900,1000]
time = [100,200,300,400,500,600,700,800,900,1000]
#2024-07-08
valve_1 = [0.0221,0.0548,0.0867,0.1206,0.1537,0.1859,0.2190,0.2504,0.2832,0.3074]
valve_2 = [0.0228,0.0539,0.0864,0.1205,0.1529,0.1864,0.2185,0.2542,0.2864,0.3179]
valve = valve_1 + valve_2
time_2 = time + time
def func_time (x,m,l):
return m*np.array(x) + l
from scipy.optimize import curve_fit
popt, pcov = curve_fit(func_time, valve, time_2)
plt.plot(valve_1,time,color='black',label ='valve 1',marker='8')
plt.plot(valve_2,time,color='red',label='valve 2',marker='8')
plt.plot(valve,func_time(valve,*popt),color='blue',label='func',marker='8',alpha = 0.5)
plt.xlabel('weight g')
plt.ylabel('time ms')
plt.legend()
#plt.savefig("time needed for water weight.jpg")
#get reward size
reward_size = func_time(0.005,*popt)
print('reward size 5ul = ' + str(reward_size)+'ms')