Skip to the content
4 layers80 × 50 mmHarp.device.lickety split, the printed circuit board in 3D

0360: an ephys-compliant capacitive lick detector

Size
80 × 50 mm
Copper layers
4
Thickness
1.57 mm
Parts
193
Nets
135
Pads
603
Tracks, vias
1,075, 230
Pours
27
Routed
Yes
KiCad
KiCad 8.0 (file 20240108)
Created
16 May 2023
Updated
4 Aug 2026

Overview

Harp.device.lickety split is an open-source printed circuit board by AllenNeuralDynamics, from the AllenNeuralDynamics/harp.device.lickety-split repository on GitHub, published under the MIT licence. It is a 4-layer board of 80 × 50 mm with 193 parts on 135 nets, routed with 1,075 tracks and 230 vias.

It is built around the RP2040, ADA4891-1ARZ and ADA4891-2ARZ, with the ADA4891-4ARZ, W25Q16JVUXIQ and RT6150B-33GQW among its other parts. Its parts include 78 capacitors, 70 resistors, 17 ICs, 6 connectors and 4 diodes. It belongs with the RP2040 boards of this library.

Main components

11

README

README.md

An ephys-compliant lick detector based on measured change in capacitance.

Features 💧💧💧🐁 ⎍⎍⎍

  • High Frequency (100 or 125 [KHz]), low current (200[nA]) excitation signal makes this device invisible to Neuropixel Probes used in electrophysiology recordings.
  • Fast. < 1[ms] response time.
  • Contact-based. Device triggers when mouse tongue contacts either the dispensing tube or dangling reward liquid.
  • TTL output triggers when a lick is detected.
  • Harp-protocol compliant (serial num: 0x0578). Also dispatches timestamped Harp messages when lick state change has changed.
  • Fully supported in Bonsai with a dedicated Bonsai package

Extra Features

  • 6-20VDC input (2.1 x 5.5mm barrel jack, positive center)
  • reverse-polarity protected
  • isolated USB to prevent ground loops with the PC.
  • Two frequency options: 100 and 125[KHz] signal frequency to eliminate crosstalk between two closely-spaced lick tubes.
  • Two amplitude options:
    • The 0.02[Vpp] option with proper grounding is intended for Ephys recordings as it introduces negligible noise artifacts.
    • The 2[Vpp] option can be used outside of an Ephys context without a ground connection

Ordering ➡ 💸

You can now order V1.0.0 from PCBWay:

These printed circuit boards are made on-demand.

You will also need:

Once you receive boards, you will need to upload the firmware from the latest release.

Device Pinout

Pinout

Switch Settings

This device has two settings (frequency and amplitude) that are independent of each other. These settings can be set by external switches to designate the state of the board upon power-up.

[!WARNING] Settings can be overwritten through software commands over the Harp interface after the board powers up.

Low-Amplitude (Ephys) Setting

This setting uses the low-amplitude option of the signal.

It is necessary to use this setting when interacting with a mouse in an electrophysiology context (i.e: probes inserted in its brain).

Note that this setting, just like Neurpixels Probes, is highly susceptible to noise. Good wiring hygiene (see below) is necessary to eliminate false positives from external noise sources.

High Amplitude (Behavior) Setting

Outside of an electrophysiology context, this setting can be used. It makes the lick detector more immune to most common sources of EMI (valves, etc) because the signal is so much larger in comparison to the noise. This signal can also be run over a much longer cable. (We've used up to 2m!)

Ephys Wiring Diagram

There are 3 configurations that will produce valid lick detection readings:

Option A works well if your rig does not have large sources of 60Hz noise.

SetupA

Option B works well if your rig does have large sources of 60Hz noise.

SetupB

Option C works well if your rig does have large sources of 60Hz noise, but you cannot earth ground it.

SetupC

Warnings

Electrical Setup

It is critical that (1) both the device and mouse under test are grounded to a common ground and (2) the rig is earth-grounded (i.e: any exposed metal components are connected to earth ground). Otherwise, the device may introduce noise on the Neuropixel probes or produce spurious licks from outside electromagnetic interference.

Multiple-Lick-Detector Crosstalk

Multiple lick detectors can be used in the same setup provided that (1) they are grounded correctly (see Electrical Setup), (2) the lick tubes are electrically insulated relative to each other, and (3) the spacing between exposed lick tubes exceeds 4mm. If the spacing between exposed metal lick tubes is less than 4mm, then the antenna noise from one lick detector may affect the other. This phenomenon is called crosstalk, and it can appear in 2 ways.

  1. Lick signals that appear on one detector may show up on both detectors. The system is useable in this case, but the data may need to be cleaned up in post-processing where the shorter "simultaneously" detected lick is thrown out.
  2. The amplitudes of the two AC signals will constructively interfere with each other, causing the excitation signals to saturate to their maximum values. The system cannot be used to detect licks this way.

To fix this issue,

  1. Put each lick detector on a different frequency (100KHz and 125KHz).
  2. Space the lick detection tubes farther apart.
  3. Reduce the length of exposed metal on the lick tube.

Theory of Operation

This device detects a threshold change in capacitance. A 100KHz, 10mVpp AC sine wave is played on the tip of a conductive lick spout, (such as McMaster-Carr pn: 89875K271), and the amplitude of the returned waveform is measured every period.

A mouse sharing a ground with this device presents itself as a series resitive and capacitive load. When the mouse's tongue touches the metal tube (or water on the tip of the metal tube), the AC signal passes through the mouse to ground, lowering the amplitude of the returned sine wave below its trigger value, which triggers a lick to be detected. This detection signal is bandpassed in hardware (4th order Butterworth) and the resulting detection signal is lowpassed and compared against a threshold value in firmware to produce a lick/no-lick external trigger output. Overall propagation time through the entire signal chain is less than 1 millisecond.

The detection signal is AC such that repeated contact with the lick tube does not slowly charge the mouse.

Tuning Parameters

Warning: changing the values of these tuning parameters may produce a detection signal that exceeds the <1[ms] detection time guarantee. We suggest ensuring that your setup is electrically grounded correctly first before changing these values.

There are three parameters that can be adjusted related to tuning the lick detection sensitivity. While the starting values should be sufficient for almost all setups, it is (unlikely but) possible that these knobs may need to be adjusted for a particular setup. The four parameters are:

  • "fast moving average" window size
    • the last N raw signal amplitude values are averaged and sent to the consensus filter.
    • This filter smooths out high frequency amplitude changes by averaging the last few values together.
    • constraint: N must be a power of 2 (i.e: 2, 4, 8, 16, ...).
  • "consensus" filter window size
    • the last N values must all be below the lick-detection start threshold to trigger a detected lick.
    • This filter increases the system's ability to reject intermittent (most likely inductive) noise sources that shrink the signal amplitude for a small period of time and may appear as a lick. Noise sources include fans, valves, and other lick detection tubes placed closer than 4mm apart.
    • Increasing this value will improve the system's ability to reject outside inductive noise, but will slow down the detection time.
    • constraint: N must be a power of 2.
  • lick-detection "start" threshold
    • a signal value below this threshold will trigger a detected lick (i.e: the output signal will be set to 5V.)
    • constraint: "start" < "stop" threshold
  • lick-detection "stop" threshold
    • a signal value above threshold will untrigger a detected lick (i.e: the output signal will be set to 0V.)
    • constraint: "start" < "stop" threshold

Parts

193
QtyValueFootprintReferences
37100nFCapacitor_SMD:C_0402_1005MetricC1, C2, C3, C12, C13, C14, C15, C16, C17, C18, C19, C24, C25, C26, C28, C29 +21
1210uFCapacitor_SMD:C_0805_2012MetricC11, C20, C22, C23, C39, C45, C67, C76, C77, C79, C80, C81
111K00Resistor_SMD:R_0402_1005MetricR49, R51, R52, R53, R54, R56, R62, R63, R70, R74, R75
81uFCapacitor_SMD:C_0402_1005MetricC8, C9, C10, C21, C27, C41, C53, C56
74K7Resistor_SMD:R_0402_1005MetricR8, R16, R17, R25, R45, R60, R61
5100KResistor_SMD:R_0402_1005MetricR55, R59, R66, R71, R76
51nFCapacitor_SMD:C_0402_1005MetricC32, C35, C36, C57, C58
4160pFCapacitor_SMD:C_0402_1005MetricC30, C31, C68, C72
42.2uFCapacitor_SMD:C_0402_1005MetricC43, C44, C50, C51
424Resistor_SMD:R_0402_1005MetricR4, R5, R6, R7
310KResistor_SMD:R_0402_1005MetricR9, R57, R58
349.9Resistor_SMD:R_0402_1005MetricR28, R29, R44
3FiducialFiducial:Fiducial_0.5mm_Mask1mmFID1, FID2, FID3
3MAX4564EKAPackage_TO_SOT_SMD:SOT-23-8U14, U15, U18
2100Resistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolderR30, R31
2120pFCapacitor_SMD:C_0402_1005MetricC33, C34
2127Resistor_SMD:R_0402_1005MetricR42, R43
2127KResistor_SMD:R_0402_1005MetricR18, R23
2130pFCapacitor_SMD:C_0402_1005MetricC73, C74
21K05Resistor_SMD:R_0402_1005MetricR1, R24
222uFCapacitor_SMD:C_0805_2012MetricC40, C82
227Resistor_SMD:R_0402_1005MetricR10, R11
251KResistor_SMD:R_0402_1005MetricR34, R35
25K1Resistor_SMD:R_0402_1005MetricR2, R3
262KResistor_SMD:R_0402_1005MetricR21, R22
2680Resistor_SMD:R_0402_1005MetricR12, R13
28K87Resistor_SMD:R_0402_1005MetricR48, R72
2D_TVSDiode_SMD:D_0402_1005MetricD3, D4
2LEDLED_SMD:LED_0603_1608Metric_Pad1.05x0.95mm_HandSolderD1, D2
2LOGOLOGOG1, G3
1102KResistor_SMD:R_0402_1005MetricR26
110KResistor_SMD:R_0603_1608MetricR15
110K0Resistor_SMD:R_0402_1005MetricR27
110K2Resistor_SMD:R_0402_1005MetricR67
1113Resistor_SMD:R_0402_1005MetricR47
1115Resistor_SMD:R_0402_1005MetricR73
1121KResistor_SMD:R_0402_1005MetricR69
1133Resistor_SMD:R_0402_1005MetricR46
1133KResistor_SMD:R_0402_1005MetricR64
1137Resistor_SMD:R_0402_1005MetricR68
115uHkicad_component_library:L_Wuerth_5.5x5.3mmL2
11K02Resistor_SMD:R_0402_1005MetricR65
12.2uHInductor_SMD:L_0603_1608MetricL3
12K2Resistor_SMD:R_0402_1005MetricR50
1300pFCapacitor_SMD:C_0402_1005MetricC52
14.7uFCapacitor_SMD:C_0603_1608MetricC42
152K3Resistor_SMD:R_0603_1608MetricR14
153K6Resistor_SMD:R_0402_1005MetricR33
154K9Resistor_SMD:R_0402_1005MetricR32
174LVCH2T45DCPackage_SO:VSSOP-8_2.3x2mm_P0.5mmU1
1976Resistor_SMD:R_0402_1005MetricR19
197K6Resistor_SMD:R_0402_1005MetricR20
1ADA4891-1Package_TO_SOT_SMD:SOT-23-5U17
1ADA4891-2Package_SO:MSOP-8_3x3mm_P0.65mmU10
1ADA4891-4Package_SO:TSSOP-14_4.4x5mm_P0.65mmU6
1ADS7049Package_SO:VSSOP-8_2.3x2mm_P0.5mmU13
1ADUM4160Package_SO:SOIC-16W_7.5x10.3mm_P1.27mmU3
1AudioJack3Connector_Audio:Jack_3.5mm_CUI_SJ-3524-SMT_HorizontalJ4
1Barrel_Jack_SwitchConnector_BarrelJack:BarrelJack_CUI_PJ-102AH_HorizontalJ6
1Conn_01x03_MaleConnector_PinHeader_2.54mm:PinHeader_1x03_P2.54mm_VerticalJ2
1Conn_01x06_FemaleConnector_JST:JST_SH_SM06B-SRSS-TB_1x06-1MP_P1.00mm_HorizontalJ1
1Conn_Coaxialkicad_component_library:SMA_TE_Connectivity_CONSMA002-SMD-G-T_HorizontalJ7
1ECS-TXO-2016Crystal:Crystal_SMD_2016-4Pin_2.0x1.6mmX1
1LM27762Package_SON:WSON-12-1EP_3x2mm_P0.5mm_EP1x2.65_ThermalViasU11
1L_Coupled_1423kicad_component_library:L_CommonModeChoke_TDKCorporation_1210L1
1MCP16312x-xMNYPackage_DFN_QFN:DFN-8-1EP_3x2mm_P0.5mm_EP1.75x1.45mmU19
1MountingHole_Padkicad_component_library:Terminal_Keystone_779x_EdgeMount_HorizontalH1
1OSHW-Logo2_7.3x6mm_SilkScreenSymbol:OSHW-Logo2_7.3x6mm_SilkScreenREF1
1REF2025Package_TO_SOT_SMD:SOT-23-5U8
1RP2040kicad_component_library:RP2040-QFN-56U4
1SW_DIP_x02Button_Switch_SMD:SW_DIP_SPSTx02_Slide_9.78x7.26mm_W8.61mm_P2.54mmSW2
1TPD2EUSB30Package_TO_SOT_SMD:Texas_DRT-3U2
1TS5A9411DCKRPackage_TO_SOT_SMD:SOT-363_SC-70-6U9
1TestPointTestPoint:TestPoint_THTPad_D3.0mm_Drill1.5mmTP1
1USB_C_Receptacle_USB2.0Connector_USB:USB_C_Receptacle_JAE_DX07S016JA1R1500J5
1W25Q16JVUXIQkicad_component_library:Winbond-8USON-2x3mmU5
1rt6150b-33gqwkicad_component_library:WDFN-10-1EP_2.5x2.5mm_P0.5_EP1.25x2.1mmU16
1~kicad_component_library:SW_Push_1P1T-SH_NO_Vertical_Wuerth_WS-TASVSW1

The 189 most common of 193 parts.

More from AllenNeuralDynamics/harp.device.lickety-split

2
  • 4 layers61.5 × 21 mmAnalog front end, the printed circuit board in 3D

    Analog front end

    AllenNeuralDynamics/harp.device.lickety-split

    0360: an ephys-compliant capacitive lick detector

    55 parts5MIT
  • 4 layers24.5 × 9 mmCable buffer board, the printed circuit board in 3D

    Cable buffer board

    AllenNeuralDynamics/harp.device.lickety-split

    0360: an ephys-compliant capacitive lick detector

    13 parts5MIT

Similar boards

  • 4 layers120 × 75 mmCuttlefish, the printed circuit board in 3D

    Cuttlefish

    AllenNeuralDynamics/harp.device.cuttlefish

    0414: an octal, TTL input/output device with programmable square wave output.

    195 parts
  • 4 layers80 × 100 mmHarp treadmill, the printed circuit board in 3D

    Harp treadmill

    AllenNeuralDynamics/harp.device.treadmill-driver

    0326: a Harp-compatible device for controlling an instrumented mouse treadmill

    173 parts4
  • 4 layers80 × 50 mmSniff detector, the printed circuit board in 3D

    Sniff detector

    AllenNeuralDynamics/harp.device.sniff-detector

    0382: Signal conditioning board for an implanted thermistor

    114 parts3MIT
  • 4 layers80 × 50 mmUsb isolated, the printed circuit board in 3D

    Usb isolated

    AllenNeuralDynamics/harp.device.pico-template

    an RP2040-based Harp hardware/firmware project template

    76 parts
  • 4 layers70 × 168 mmValve controller, the printed circuit board in 3D

    Valve controller

    AllenNeuralDynamics/harp.device.valve-controller

    0368: a 16-channel valve controller

    224 parts
  • 4 layers90 × 100 mmHarp.device.quad.dac, the printed circuit board in 3D

    Harp.device.quad.dac

    AllenNeuralDynamics/harp.device.quac

    0364: This repository contains the hardware, firmware, and software related to the Harp quad DAC

    291 partsMIT
  • 4 layers39.9 × 28 mmEnvironment sensor, the printed circuit board in 3D

    Environment sensor

    AllenNeuralDynamics/harp.device.environment-sensor

    0357: harp-compliant humidity, pressure, and temperature sensor

    56 partsMIT

Questions

How big is the Harp.device.lickety split PCB?

It measures 80 × 50 mm and has 4 copper layers, 1.57 mm thick.

What parts does the Harp.device.lickety split use?

193 parts, built around the RP2040, ADA4891-1ARZ, ADA4891-2ARZ and ADA4891-4ARZ. The full list of its parts is on this page, with links to each part's symbol and footprint where PCBKit's library has them.

Where can I download the Harp.device.lickety split KiCad files?

From the AllenNeuralDynamics/harp.device.lickety-split repository on GitHub, at the commit this page was made from: the board is hardware/board/main_board/main_board.kicad_pcb and its schematic hardware/board/cable_buffer_board/cable_buffer_board/cable_buffer_board.kicad_sch. PCBKit opens the board in the browser, with nothing to install.

Can I use the Harp.device.lickety split design in my own project?

Its repository publishes it under the MIT licence: you may reuse it on that licence's terms (keep the author's notice, and for a copyleft licence share your changes alike).