NeuroStimDuino

by Neuralaxy

An open source neurostimulator for students, researchers, and hobbyists interested in neuroscience

View all updates Apr 28, 2021

Controlling Multiple NeuroStimDuinos on a Single I²C Bus

by Nikunj Bhagat

Hey folks! Our campaign ended yesterday, and we exceeded our funding goal by a significant margin. We are deeply grateful to Crowd Supply and to all of our backers for making this campaign a great success. Thank you!!

Communicating with Multiple NeuroStimDuinos on a Single I²C Bus

We will end this week’s update by demonstrating how to control two NeuroStimDuino using a single Arduino. The default I²C address for NeuroStimDuino is 26. Using the ADDR command from the NeuroStimDuino library, you can change this address and communicate with multiple devices on the same I²C bus. The syntax for ADDR command is ADDR new_address program/switch_only, where:

  • new_address can be any value between 8 to 119, and
  • program/switch_only is a binary value. When it is set to 1, the NeuroStimDuino's current address will be changed to new_address, and the Arduino will start sending I²C messages to that address. When program/switch_only is set to 0, NeuroStimDuino's current address will not be changed. Only the peripheral address stored within Arduino will be updated so that it can start communicating with a different peripheral device.

Setup for Changing I²C Address & Connecting Multiple NeuroStimDuinos

  1. Connect the first NeuroStimDuino to an Arduino:
  1. Change its I²C address from 26 (default) to any other value (e.g. 30) using the serial terminal:
    ADDR 30 1
    
  2. Now stack the second NeuroStimDuino on top of the first. Use the default I²C address for the second device or change it using the instructions in Step 2:
  1. You are now ready to independently control both NeuroStimDuinos.

  2. Type in the following command using Arduino’s serial terminal to stimulate two Zucchini muscles (video below):

ADDR 30 1     //Change I2C address of 1st NeuroStimDuino and start communicating with it
FREQ 1 15
FREQ 2 15
DURN 1 2000
DURN 2 2000
AMPL 1 100
AMPL 2 100
DELY 1 5
DELY 2 10
ENAB 1 1
ENAB 2 1
STIM 1 0 1
STIM 2 0 1

ADDR 26 0     // Connect 2nd NeuroStimDuino and start communicating with it. Address will not be changed
FREQ 1 5
FREQ 2 5
DURN 1 2000
DURN 2 2000
AMPL 1 100
AMPL 2 100
DELY 1 5
DELY 2 10
ENAB 1 1
ENAB 2 1
STIM 1 0 1
STIM 2 0 1

// At the end of the experiment stop stimulation on both boards
STOP 1
STOP 2
ADDR 30 0  //Switch communication to 1st device
STOP 1
STOP 2

About the Author

Nikunj Bhagat


$11,050 raised

of $6,000 goal

184% Funded! Order Below

Product Choices

$260

NeuroStimDuino

One NeuroStimDuino board and a pair of 2-mm, pin-style lead wires for use with standard, reusable, hydrogel-based stimulation electrodes. Includes a battery holder but does not include batteries.


$40

NeuroStimDuino Accessory Pack

Four 1.25-inch round and four 2-inch square hydrogel electrodes, a pair of lead wires, and a pair of bifurcation cables

Credits

Neuralaxy

Neuralaxy LLC is an early stage neurotechnology company based in Delaware, US. Its mission is to develop therapies that help patients suffering from paralysis and neuromuscular diseases, to recover their independence as well as lead a healthy, fulfilling life.


Nikunj Bhagat

See Also

Subscribe to the Crowd Supply newsletter, highlighting the latest creators and projects: