Skip to the content
PCBKitNew board
2 layers106.5 × 83.5 mmAnimalBehaviour, the printed circuit board in 3D

Arduino and PointGrey camera based behaviour setup.

Size
106.5 × 83.5 mm
Copper layers
2
Thickness
1.6 mm
Parts
25
Nets
26
Pads
130
Tracks, vias
259, 0
Pours
1
Routed
Yes
KiCad
KiCad 5 (file 20171130)
Created
6 Jul 2017
Updated
3 Oct 2023

Overview

AnimalBehaviour is an open-source printed circuit board by BhallaLab, from the BhallaLab/MouseBehaviour repository on GitHub, published under the GPL-3.0 licence. It is a 2-layer board of 106.5 × 83.5 mm with 25 parts on 26 nets, routed with 259 tracks and 0 vias.

It is built around the IRF540N. Its parts include 14 connectors, 4 resistors, 1 IC, 1 diode and 1 transistor. It belongs with the AVR (ATmega, ATtiny) boards of this library.

Main components

1

README

README.md

Build Status Docker Pulls

Documents https://bhallalab.github.io/MouseBehaviour

A cmake based C++/Python pipeline to run behavioural experiment.

Protocols

A protocols must be listed in ./Protocols/BehaviourProtocols.csv. You must specify the right protocol code duging configuration. See section How to run the pipeline below.

How to run the pipeline

Both the arduino and the camera should be connected to the computer before starting the session.

Download and setup (done once)

This code will only work on Ubuntu-16.04. Install arduino, c++ compiler (gcc), cmake, and boost libraries.

Script bootstrap.sh will try to install all dependencies. Required libraries for PointGrey camera is in the source.

text
$ git clone  https://github.com/BhallaLab/MouseBehaviour.git
$ cd MouseBehaviour 
$ sudo -E ./bootstrap.sh  # on first time post login. If it fails, manual configuration is needed.

The script bootstap.sh will try to configure your system. You must have sudo permissions because we need to add to various groups (pgrimaging and dialout) before you can access camera and serial port. In case, something odd happens, raise an issue on github.

Once bootstrap is successful, logout and login. Changes made to your groups comes into effect only after a fresh login. To verify that you are in appropriate groups, type groups command in terminal. Make sure that pgrimaging and dialout appears in the group list. If not, things have not gone properly.

To build and upload to arduino:

text
$ mkdir _build 
$ cd _build
$ cmake -DANIMAL_NAME=k2 -DSESSION_NUM=1 -DPROTO_CODE=All1 ..
$ make run              # to run the whole setup, (arduino and camera both must be connected)or
$ make miniterm         # Just to test arduino board. (camera need to be connected)

On make run, a windows will appear with camera feed and couple of plots at the bottom.

Send commands to arduino

To send commands to arduino, make sure that you focus on the window first (click on it).

Press CTRL+C in terminal to close the session. To see the arduino output in the console, run make miniterm; and press CTRL+] to come out of miniterm.

CMake options

Port

If you need to change the arduino port, pass -DPORT=/path/to/port option to cmake. On a linux system, e.g.

text
 $ cmake -DPORT=/dev/ttyACM1 -DANIMAL_NAME=k2 -DSESSION_NUM=1 -DPROTO_CODE=A11 ..

Analysis

Analysis scripts are written in python and requires common numerical computational framework e.g., numpy, scipy, pandas and additionally tifflib.

  • sudo apt install python-tifflib

Commands

  • Puff : p
  • Tone : t
  • Led : l
  • Start : s
  • Shock : c
  • Terminate : ctrl+c

What is being printed?

See function write_data_line in file src/main.ino for updated values.

How to analyze data

Go to directory ./analysis and read the README.md file there.

Extracting arduino data from tiff file.

Each tiff file contains one trial. The first row of each frame contains arduino data. You can extract that using the script ./analysis/get_data_line_from_tiff.py file.

To extract data run,

text
$ python ./analysis/get_data_line_from_tiff.py /path/to/session/trial01.tiff

It will print the csv files onto the terminal and also save it to a dat file in the same folder. A plot file is also generated.

Parts

25
QtyValueFootprintReferences
2470EResistor_THT:R_Axial_DIN0309_L9.0mm_D3.2mm_P5.08mm_VerticalR2, R4
110KResistor_THT:R_Axial_DIN0309_L9.0mm_D3.2mm_P5.08mm_VerticalR3
110MResistor_THT:R_Axial_DIN0309_L9.0mm_D3.2mm_P5.08mm_VerticalR1
14N35Package_DIP:DIP-6_W7.62mm_SocketU1
1Arduino_Uno_ShieldArduino:Arduino_Uno_ShieldXA1
1CAMConnector_Molex:Molex_KK-254_AE-6410-02A_1x02_P2.54mm_VerticalJ7
1CamMD-60SM:CUI_MD-60SMJ12
1DIODEDiode_THT:D_DO-15_P12.70mm_HorizontalD1
1Ext SuppConnector_Molex:Molex_KK-254_AE-6410-03A_1x03_P2.54mm_VerticalJ14
1IRF540NPackage_TO_SOT_THT:TO-220-3_Horizontal_TabDownQ1
1ImagingMD-60SM:CUI_MD-60SMJ13
1ImagingConnector_Molex:Molex_KK-254_AE-6410-02A_1x02_P2.54mm_VerticalJ6
1JSolenoidConnector_Molex:Molex_KK-254_AE-6410-02A_1x02_P2.54mm_VerticalJ10
1LEDConnector_Molex:Molex_KK-254_AE-6410-02A_1x02_P2.54mm_VerticalJ11
1Orange Optical RotaryEncoderConnector_Molex:Molex_KK-254_AE-6410-04A_1x04_P2.54mm_VerticalRotaryEncoder1
1PCB_SSR_4Ch_LLTSSR4Channel:4ChannelSSRAssr4ch1
1SSR OUTConnector_Molex:Molex_KK-254_AE-6410-08A_1x08_P2.54mm_VerticalJ2
1SSR_INPUTConnector_Molex:Molex_KK-254_AE-6410-04A_1x04_P2.54mm_VerticalJ1
1ShockPadTerminalBlock_Altech:Altech_AK300_1x02_P5.00mm_45-DegreeShockPad1
1StimCurrentInjectConnector_BarrelJack:BarrelJack_CUI_PJ-063AH_Horizontal_CircularHolesJ3
1StimIsoINConnector_Coaxial:BNC_TEConnectivity_1478204_VerticalJ5
1StimIsoINConnector_Molex:Molex_KK-254_AE-6410-02A_1x02_P2.54mm_VerticalJ4
1TONEConnector_Audio:Jack_3.5mm_CUI_SJ1-3533NG_Horizontal_CircularHolesJ9
1TONEConnector_Molex:Molex_KK-254_AE-6410-02A_1x02_P2.54mm_VerticalJ8

Questions

How big is the AnimalBehaviour PCB?

It measures 106.5 × 83.5 mm and has 2 copper layers, 1.6 mm thick.

What parts does the AnimalBehaviour use?

25 parts, built around the IRF540N. 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 AnimalBehaviour KiCad files?

From the BhallaLab/MouseBehaviour repository on GitHub, at the commit this page was made from: the board is CAD/EDA/AnimalBehaviour.kicad_pcb. PCBKit opens the board in the browser, with nothing to install.

Can I use the AnimalBehaviour design in my own project?

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

Similar boards

  • 2 layers96.8 × 97 mmPsoc5power, the printed circuit board in 3D

    Psoc5power

    profdc9/DRSSTC-PCB-Pack

    A pack of PCBs for a dual resonant solid state tesla coil setup. Pretty much everything you need.

    133 parts59
  • 2 layers124.5 × 77.5 mmAutopatzer, the printed circuit board in 3D

    Autopatzer

    jes/autopatzer

    Automatic chess board

    40 parts30
  • 2 layers55 × 90.8 mmSlider, the printed circuit board in 3D

    Slider

    DusterTheFirst/rocketry

    🚀 Thrust Vector Controlled Model Rockets

    33 parts22GPL-3.0
  • 2 layersVedro ardu, the printed circuit board in 3D

    Vedro ardu

    oleg-milantiev/ros2-vedrus

    ROS2 Vedrusohod bot sources

    12 parts9Apache-2.0
  • 4 layers147.8 × 77 mm2xBLDCPicoV3, the printed circuit board in 3D

    2xBLDCPicoV3

    AmericanRework/Pico-2x-BLDC

    One RP2040 Pico drives two brushless motors! SimpleFOC + Halls + 2304 drivers + TO-220 mosfets or IGBTs. Plugs directly into 450x automower motors.

    135 parts7
  • 2 layersPCB Layout, the printed circuit board in 3D

    PCB Layout

    chgopireddy/Full-Bridge-Class-D-Audio-Amplifier

    LTspice Model for Full Bridge Class D, Voltage Mode Control, Peak Current Mode Control

    63 parts6
  • 2 layers147.2 × 58.3 mmLi IonBatteryProtection, the printed circuit board in 3D

    Li IonBatteryProtection

    cnobile2012/Li-IonBatteryProtection

    Circuit to protect Li-Ion and Li-Po batteries at the cell level.

    81 parts6MIT