The BlueBerry is a small, battery-powered device that uses Bluetooth to deliver optogenetic stimulation in freely moving mice. It is built on a simple printed circuit board (PCB) that holds a microcontroller (ATTINY 85), a dedicated Bluetooth module (RN4871), and the electronic components needed to generate high-power pulses on two independent channels. These pulses can be customized in real time through the BlueHub, an Arduino-based controller that sends commands to the BlueBerry over Bluetooth. Because it relies on off-the-shelf parts and standard soldering techniques, BlueBerry is relatively easy for most labs to assemble. In the following sections, we will explain how to build and program your own BlueBerry system, covering both the hardware setup and the software configuration.
This guide covers the entire process of building a BlueBerry device for wireless optogenetic experiments, including solder paste application, surface-mount and through-hole component placement, battery attachment, and final assembly. Before you begin, ensure you have access to the following equipment and tools:
To build the BlueBerry, you will need a custom PCB and various electronic components. The PCB production file can be downloaded from the download page (BlueBerry Hardware Package), and we recommend ordering from PCB GoGo, although other manufacturers can also be used. Follow these steps:
Additionally, for accurate stencil alignment, you will need to 3D print an alignment device designed to hold the PCBs securely in place during solder paste application. The 3D file (.stl) is also located in the BlueBerry Hardware Package. The alignment device consists of:
Once you have obtained all materials and printed the alignment device, you can proceed with the assembly process.
Before proceeding, make sure you have:
Lay them out as shown in the reference image to streamline the assembly process.
Below is a step-by-step guide to uploading the base BlueBerry program onto your device. These instructions cover programming both the ATtiny85 microcontroller (responsible for controlling optogenetic stimulation parameters) and the RN4871 Bluetooth module (responsible for receiving BLE packets from the BlueHub and forwarding them to the ATtiny85). Before you begin, ensure that:
Also confirm that your BlueBerry hardware is fully assembled and powered on via its micro switch. Once these requirements are met, you can proceed with the following steps to configure your BlueBerry.
https://raw.githubusercontent.com/damellis/attiny/ide-1.6.x-boards-manager/package_damellis_attiny_index.json
https://github.com/lucullusTheOnly/TinyWire
BlueBerryATTINY85Config.ino
file in the Arduino IDE. With the exact same settings as previous step (Internal 1 MHz clock, Arduino as ISP, correct board and port), upload the sketch. The Arduino UNO will program the BlueBerry’s microcontroller, which decodes incoming BLE packets transmitted via I2C to control optogenetic stimulation (frequency, pulse width, number of pulses, and output channel).BlueBerryBLEConfig.sh
. This script will reset all Bluetooth settings, allows you to give an ID to your BlueBerry device and finally upload the program for the Bluetooth module allowing to transmit the received packet via I2C to the ATTINY85 microcontroller.
chmod +x BlueBerryBLEConfig.sh
sudo ./BlueBerryBLEConfig.sh
At this point, both the ATtiny85 microcontroller and the RN4871 Bluetooth module on your BlueBerry are fully configured. You can attach any required optogenetic implants and use the BlueHub’s manual testing switches (next to the BNC inputs) to test stimulation. With the BlueBerry powered on and the BlueHub properly configured, the device is ready for closed-loop or open-loop optogenetic experiments in freely moving animals. Please check the User Manual from the documentation page to test and use BlueBerry devices.