Anolis Brain Interface

Lukas Joeressen

February 2024

The Problem

  • Anolis lizards have a comparable brain physiology to mammals
  • This makes them an interesting study target
  • We want to measure their brain signals
  • Have a wearable system that lets the animal move freely
  • The animal should be disturbed as little as possible
  • Display and collect data in real-time over a wireless connection

The Goal

  • Develop a system for Bluetooth communication
  • Maximise achievable data bandwidth
  • Real-time data display and recording

The Stretch Goals

  • Build the complete system
  • Get as small and light as possible
  • Test the system in a lab setting
  • Test with real signals
  • Test with the actual animals
Green anole

The Lizards

  • Green anole lizards
    Anolis carolinensis
  • Extremely tiny
  • 3-7g
  • 12-20cm
  • More than half of that is the long tail
  • Keep system under 2g!

The Hardware

PCB Top Side
PCB Bottom Side
  • Designed with KiCad
  • Flexible PCB
  • Rechargeable 40mAh LiPo battery (>2h)
  • Compact size (14x18mm)
  • As light as possible (1.71g with battery)
  • Analogue frontend (RHD2216)
  • Processor and Bluetooth antenna (Setebos-I)
  • Power supply and battery charging

The Intan RHD2216

RHD2000
Image: Intan Technologies
  • Integrated analogue frontend for electrophysiological signals
  • 16 differential input channels
  • Integrated ADC
  • SPI interface
  • No internal clock
  • Configurable filters
  • Up to 30kHz sample rate with 16 bit

The nRF52840 SoC

Nordic Semiconductor
nRF52840
  • Nordic Semiconductor
  • ARM Cortex M4F CPU
  • 64MHz
  • 256kB RAM
  • 1MB Flash
  • Bluetooth Radio
  • Many Hardware Peripherals
    (SPI, Timer, DMA, PPI, USB, ...)

The Embassy Project

Rust
  • Free & Open Source – We contributed!
  • Written in the Rust programming language
  • Enables Rust’s async/await feature
  • Portable hardware abstraction for a wide variety of chips
  • Supports nRF52840 with Bluetooth softdevice
  • Safe and convenient APIs

Learn more: https://embassy.dev/

The RHD2216 Driver

  • Generates a steady command stream
  • Timer, SPI, counter and DMA are all connected via PPI
  • Double buffer with overflow space
  • Only buffer swap every 20ms needs CPU interaction
  • Since buffer swap happens during DMA operation the swap routine is written with inline assembly and the LDREX/STREX instructions
  • This prevents lost samples or memory corruption

The Bluetooth connection

Bluetooth
  • BLE 5 with 2M PHY for higher data rate
  • L2CAP connection oriented channels
  • Advertisement with specific 128 bit UUID
  • Bluetooth dongle searches for this UUID and connects
  • A complete data frame is sent every 20ms
  • Dongle forwards the data to the USB connection
  • Tested with 16 channels and up to 10kHz sample rate

The Interface

Interface
  • Built with Vue.js
  • Runs in a normal web browser
  • Uses the WebUSB API
  • Displays data in real-time
  • Records data to a file

The Results

ECG Signal of a Human Heart
  • Testing in the lab has been successful with 8 channels and 10kHz sample rate
  • We have also tested the device by measuring a human ECG signal
  • Testing on the animals is ongoing
  • Main problem is the attachment of the system and the electrodes to the lizard
  • A 3D printed harness is in development

The Future

  • Testing with real lizards
  • Make the system even smaller and lighter
  • Bare-die components, integrated BLE, smaller battery, smaller SoC
  • Less than 1g should be possible!
  • Use of the firmware and design for other projects

Get the Code

The code and PCB production files are available on Github under the free and open source MIT and Apache 2.0 licences.

https://github.com/kext/anolis-brain-interface

You can find the slides here:

https://kext.github.io/anolis-slides

Thank you for your attention!

Any questions?