by Neuralaxy

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

View all updates Mar 23, 2021

Pinout Diagram & I²C Library

by Nikunj Bhagat

For my first weekly update, I have prepared a pinout diagram to help clarify how NeuroStimDuino connects to an Arduino MEGA or Due:

(Click to expand)

I would also like to introduce the I²C library that you will use to to configure and control the stimulator.

I²C Library for NeuroStimDuino

NeuroStimDuino can be controlled by an external microcontroller such as Arduino Due or Mega using the I²C interface, with NeuroStimDuino acting as I² peripheral device (default address = 0x1A). A list of Opcode-style commands can be used to configure different parameters of stimulation waveform such as frequency, amplitude, etc. Each I²C message should have following structure:

  • Byte 0 indicates the number of bytes that will be transferred
  • Byte 1 is the Opcode command from the instruction set below for the stimulation parameter that will be modified
  • Byte 2 is the channel number (1 or 2) that will written to or read from
  • Byte 3 is the LSB byte of the value written
  • Byte 4 is the MSB byte of the value written

Instruction Set

InstructionAddressDescriptionAcceptable Range
AMPL0x01Change stimulation amplitude0 - 127 (Digital potentiometer count)
FREQ0x02Change stimulation frequency1 - 100, Unit: Hz
DURN0x03Change pulse-duration of the cathodic pulse.0 - 2000, Unit: uSec.
IDLY0x04Change inter-phase delay0 - 255, Unit: uSec.
DELY0x05Delay to the start of the stimulation pulse in each cycle0 - 1/(stimulation frequency), Unit: mSec.
SYMM0x06Generate symmetrical or asymmetrical stim waveform1 = Symm.; 0 = Asymm.
ADDR0x07Change 7-bit I2C address0x08 - 0x77; 0x80 - 0xFF
SAMP0x08Sample current from active channels-
READ0x09Read value of register-
RSET0x0AReset NeuroStimDuino to default register values-
EOFF0x0FGenerate Emergency Off condition-
STIM0x10Start stimulation on channel 1 or 2 for specified duration0 - 255, Unit: Sec.
STOP0x12Stop stimulation on channel 1 or 2-
ENAB0x14Enable or disable a stim. channel1 = Enable; 0 = Disable

About the Author

Nikunj Bhagat

$11,050 raised

of $6,000 goal

184% Funded! Order Below

Product Choices



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.


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



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: