BlueBerry User Manual

The BlueBerry device and its companion BlueHub control interface together form a robust platform for wireless optogenetic stimulation in freely moving animals. By linking multichannel LED pulses to external triggers in real time, researchers can investigate a variety of neural processes in naturalistic conditions without the need for specialized hardware expertise.Below is a User Manual for the BlueBerry System, detailing how the BlueBerry device and its BlueHub controller work together to provide flexible, closed-loop optogenetic stimulation. The BlueBerry device generates LED pulses according to user-defined parameters, while the BlueHub manages communication, configuration, and closed-loop triggering based on external signals. By combining these components, researchers can conduct advanced neuroscience experiments—ranging from multi-animal social interactions to large-scale maze navigation—using a straightforward, open-source approach. The following sections explain each component’s hardware features, software controls, and the principles governing their interaction.

BlueBerry and Bluehub user manual for real-time controlling of optogenetic stimulation

BlueBerry device

The BlueBerry is a lightweight (~1.5 g), battery-powered optogenetic device designed for experiments in freely moving animals. Its small size (approximately the dimensions of an actual blueberry) and off-the-shelf component construction make it accessible to labs with limited engineering resources. Featuring two independently controlled LED stimulation channels, BlueBerry excels in settings that require minimal interference with natural behavior, including multi-animal social paradigms, large-scale navigation tasks, and other scenarios where tethered fiber optics would be impractical. The sections below detail how BlueBerry processes stimulation commands, its physical layout, and the battery charging workflow.

Two mice with BlueBerry devices plugged to their brain implant connectors engaging in social interaction

1. How BlueBerry Processes Stimulation Commands

BlueBerry is built around a Bluetooth Low Energy (BLE) module (RN4871) that receives command packets from the BlueHub. Each packet contains the necessary stimulation parameters—such as frequency, pulse width, number of pulses, and choice of LED channel(s). The RN4871 then communicates these parameters via an I²C bus to the ATtiny85 microcontroller, which interprets them in real time. Once it has decoded the instructions, the ATtiny85 drives the high-power LED outputs through a two-channel MOSFET stage, ensuring precise timing and current control for each stimulation pulse.

A low-dropout (LDO) regulator supplies 3.3 V from a small rechargeable lithium coin battery (e.g., VARTA CP1254-A3), maintaining stable operation of both the BLE module and the ATtiny85. A micro switch on the PCB toggles power to the entire device, while a surface-mounted status LED indicates the current operational state (e.g., searching for connection, connected, or actively stimulating). Finally, a micro-connector (Hirose BM23 series) provides an interface for charging and programming; the BlueBerry’s battery can be recharged through the dedicated charging stations on the BlueHub, and initial firmware configuration for both the BLE module and the ATtiny85 is also performed through this connector. By integrating these components into a compact PCB, BlueBerry delivers multichannel optogenetic stimulation in a lightweight form factor, making it well suited for extended experiments in freely moving animals.

BlueBerry detailed schematic and dimensions

2. Power Switch and Indicator LED

BlueBerry includes a micro switch that controls its power. When the switch is slid to the “ON” position (as shown in the reference image), the device powers up. Initially, the indicator LED will exhibit a ramping pattern, indicating that the BlueBerry is active but not yet connected to a host device. If a controller like the BlueHub establishes a link, the indicator LED switches to a fast blink while the connection is negotiated, and then turns off once the link is stable. Whenever the BlueBerry receives a command packet—such as a new stimulation protocol—the indicator LED will pulse once at the start of the output LED sequence, confirming that it recognized and processed the incoming instructions.

Different operation modes of BlueBerry device illustrated by its LED indicator

3. Overview of output Channels

BlueBerry provides two LED output channels, accessible through a 2×2 male connector on the board. When viewing the device from the bottom (see reference image), the left side of the connector corresponds to Output Channel 1, while the right side corresponds to Output Channel 2. To test your BlueBerry prior to animal experiments, attach a compatible LED implant to the connector—using tweezers, as shown in the reference image—so you can observe stimulation pulses directly. This setup allows you to verify that the device is functioning correctly before implantation or any additional experimental procedures.

Output channels of BlueBerry wireless optogenetic device

4. Charging the Battery

The BlueHub unit includes dedicated charging ports for recharging the BlueBerry’s battery. This integrated design ensures a straightforward workflow  to keep multiple BlueBerry devices powered for ongoing experiments.

  • Charging Stations: Simply place the BlueBerry onto one of the two charging docks or the programming station on the BlueHub, making sure the connectors align.
  • Monitoring Charge: An LED on the BlueHub indicates charging status and switches off once the battery is fully charged. It is advisable to keep the device on the station until this indicator extinguishes, ensuring a complete charge.

BlueHub controlling unit charging multiple BlueBerry optogenetic devices

BlueHub Control Unit

The BlueHub is an Arduino-based control interface designed to manage multiple BlueBerry devices, facilitating effortless closed-loop optogenetic experiments without requiring extensive coding expertise. Equipped with four BNC input channels, the BlueHub can receive real-time signals from external behavioral frameworks—ranging from commercial systems like EthoVision to open-source platforms like DeepLabCut or EthoLoop. It is easy to assign stimulation protocols to each BNC input, allowing the BlueHub to trigger specific BlueBerry devices whenever relevant behavioral events are detected.

BlueHub unit for closed-loop wireless optogenetic stimulation in multiple animals carrying a BlueBerry device

1. Bluehub working principle

At the core of the BlueHub is an Arduino UNO Rev4, which manages Bluetooth Low Energy (BLE) communication with any number of BlueBerry devices. A rotary encoder and OLED screen provide an intuitive menu for configuring stimulation parameters—such as frequency, pulse width, and the number of pulses—and mapping them to each BNC input. This streamlined interface stores and retrieves settings from onboard EEPROM, letting users seamlessly switch between different experimental configurations. Additionally, two dedicated charging stations and one programming/charging station make it simple to recharge BlueBerry devices or upload new firmware as needed. By centralizing these functionalities, the BlueHub offers a straightforward, modular way to integrate wireless optogenetics into existing behavioral assays with minimal retooling.

When you power on the BlueHub (with its software correctly uploaded), an OLED screen displays the main menu, which offers three core functions:

  1. Scan for BlueBerry Devices
  2. Create Configuration
  3. Load Configuration

You can navigate these options by rotating the rotary encoder clockwise or counterclockwise and select an option by pressing down on the encoder.

Overview of BlueHub controlling unit for communicating optogenetic stimulations  to BlueBerry devices via BLE protocl

2. Scanning for BlueBerry Devices

When you select “Scan for BlueBerry Devices,” the BlueHub enables its Bluetooth module and looks for active BlueBerry units within range. Only BlueBerry devices that have been previously configured (as described in the BlueBerry Software documentation) will be recognized. Once scanning is complete, the OLED will display a list of available BlueBerries. This step is primarily to confirm which devices are powered on and available. To return to the main menu at any time, press and hold the rotary encoder for two seconds.

3. Creating a Configuration

Selecting “Create Configuration” leads you to the interface where you can define how each of the four BNC input channels should behave when triggered. Initially, you will see each BNC channel (labeled BNC1 through BNC4) along with five placeholder values in parentheses (x, x, x, x, x). These five values represent:

  1. BlueBerry ID – The specific BlueBerry device this BNC will activate.
  2. LED Channel – Which channel on the selected BlueBerry should be activated: “1” for right LED, “2” for left LED, or “3” for both simultaneously. Value 3 is shown as "2+1" when adjusting LED channel on the OLED screen.
  3. Frequency – The stimulation frequency (in Hertz), ranging from 1 to 99 Hz.
  4. Pulse Width – The duration (in milliseconds) of each LED pulse.
  5. Number of Pulses – How many pulses to deliver for each trigger. A value of “0” indicates continuous stimulation for as long as the BNC input is high. On the OLED screen value 0 is shown as "Conti" when adjusting the pulse numbers.

Once you enter a channel’s configuration, you can rotate the rotary encoder to move between these five fields and press the encoder to edit a particular field. After adjusting the values, returning to the channel overview confirms your settings. You can then edit the other BNC channels in the same way. Once all channels have been configured, you will have the option to save the settings to one of two configuration slots (Config 1 or Config 2). These slots are stored in the Arduino’s EEPROM, preserving your settings even if the device is turned off. After saving, navigate back to the main menu.

4. Loading a Configuration

The “Load Configuration” menu lets you choose from the previously saved configurations (Config 1 or Config 2). Selecting a configuration displays an overview of how each BNC channel has been assigned: which BlueBerry, LED channel, frequency, pulse width, and number of pulses. To proceed, select “Start” to initiate the configuration. The BlueHub then attempts to connect to each BlueBerry device included in the loaded config and verifies their connectivity. Once all assigned BlueBerries are connected, the system is ready to respond to triggers on any of the four BNC inputs.

5. Principles of BNC Input Triggers

The four BNC inputs on the BlueHub detect 5V rising edges to initiate stimulation commands:

  • Continuous Mode (Number of Pulses = 0):
    When the BNC input goes high, the assigned stimulation begins and continues as long as that input remains high. When the input returns to low, the stimulation stops.
  • Fixed Pulse Count (Number of Pulses > 0):
    When the BNC input transitions from low to high, the BlueHub sends a command to deliver the specified number of pulses (e.g., 10 pulses at 20 Hz). After those pulses have been delivered, the stimulation stops automatically, regardless of whether the BNC signal remains high.

Blow is an example for two BNC channels assigned to two different BlueBerry devices with different stimulation protocols.

6. Manual Testing of BNC Channels

Each BNC port on the BlueHub has a button switch next to it for quick testing. Pressing this switch simulates a rising edge on the corresponding BNC input. If your BlueBerry device is properly configured, you should see immediate LED stimulation (or hear a motor response, etc.) as dictated by your assigned settings.

Wirelessly activated optogenetic stimulation on a BlueBerry device through BlueHub Controlling unit