Arduino UNO-compatible robotic simulation of the C. elegans nematode
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.

For a longer duration clip, please see:


Nematoduino is an Arduino UNO-compatible robotic simulation of the C. elegans nematode.

At the core of the simulation is a spiking neural network incorporating 300 neuron cells of the biological worm's connectome, along with associated muscle cells. This implementation is based on prior work [1], but with the following improvements:

  • A compressed representation of the connectome network (8 kilobytes)
  • Ability to run on the extremely flexible Arduino UNO platform
  • A biologically motivated conntectome-motor interface

In its current form the nematoduino software consumes 13542 bytes (42%) of the program memory of an UNO-compatible board, with global variables consuming 825 bytes (40%) of the SRAM, leaving plenty of room for experimentation and further development. It's my hope that nematoduino will end up in the hands of a lot of students and neurorobotics hobbyists!


As in Ref. 1, either the chemotaxis ("smell finding") or nose touch neurons are stimulated depending on whether the ultrasonic sensor has been triggered. A flow chart representing how sensor state feeds through the connectome simulation and out through the motors is given in Figure 1. Particular weight is given to the neck muscles of the worm, as they provide the direction of locomotion (see Ref. 3).

Figure 1.
Flowchart depicting how motor output is generated..

Forward and backward movement are governed by A and B-type motor neurons [2], with a nose touch resulting in a reversal of the worm's locomotion. Keeping this in mind, the activation of these motor neurons in the connectome simulation was inspected during chemotaxis and nose touch (see Figure 2), and several groups of neurons were found the be good indicators for forward and reverse locomotion.

Figure 2.
A and B-type motor neuron activation in the connectome simulation during chemotaxis (first half of time-series), and nose-touch (second half). Neurons that make good indicators for forward/reverse are circled..

These significant motor neurons are weighted and tracked using a running average. The sign of the signal sent to the motors is reversed when this average crosses a threshold.

Further Work (To Do)

It would be nice to use a light sensor to see if the qualitative chemotaxis behavior investigated in Ref. 3 can be reproduced using this connectome model.


[1] Busbice, T. Extending the C. Elegans Connectome to Robotics. URL:

[2] Zhen M., Samuel, A. C. elegans locomotion: small circuits, complex functions. URL:

[3] Morse, T. M., Ferrée, T. C., Lockery S. R. Robust spatial navigation in a robot inspired by chemotaxis in C. elegans. URL:

Related Projects

Busbice, T., Garrett, G., Churchill G. GoPiGo C. elegans Connectome Code. Github repository. URL:
Notes: Propgenitor of this project. Connectome model originates from file

Griffith, N. Github repository. c_matoduino. URL:
Notes: Author's own work. A pure C implementation of the connectome model useful for plotting purposes.

Olmos, F. V. Robot gusano con arduino, paso a paso. Article URL: Pastebin URL:
Notes: Appears to be a more or less straight translation of the Busbice Python code. Runs on an Arduino Mega.

Baek, S. Arduino + C. Elegans. YouTube video. URL:
Notes: Runs on an Arduino UNO board, but author indicates implementation issues. No source code.

About The Author

Hi! My name is Nathan Griffith, and by now I think it's clear that I like implementing complicated stuff on simple hardware (

I'm an astrophysicist and definitely not a biologist, so if you work with C. elegans in an academic setting and want to give me feedback I would really love that.

I can be reached at


Nematoduino is covered under the GNU Public License v2.