Project showcase


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

  • 68 respects

Components and supplies

About this project

Longer duration video of nose touch behavior, comparison with biological worm



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 thebiological worm's connectome, along with associated muscle cells. This implementation is based onprior 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 memoryof an UNO-compatible board, and 825 bytes (40%) of the SRAM, leaving plenty of room for experimentationand further development. It's my hope that nematoduino will end up in the hands of a lot of studentsand neurorobotics hobbyists!


As in Ref. 1, either the chemotaxis ("smell finding") or nose touch neurons are stimulated depending on whetherthe ultrasonic sensor has been triggered. A flow chart representing how sensor state feeds through the connectomesimulation and out through the motors is given in Figure 1. Particular weight is given to the neck muscles of theworm, 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 ina reversal of the worm's locomotion. Keeping this in mind, the activation of these motor neurons in the connectomesimulation was inspected during chemotaxis and nose touch (see Figure 2), and several groups of neuronswere 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 motorsis 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 reproducedusing 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:

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.


The Arduino source code, along with some associated Python scripts for scraping/compiling the neural ROM.
A pure C implementation of the simulation. Useful for plotting and/or monte carlo simulation. Needs to be cleaned up, and tailored to your specific purpose.


Similar projects you might like

Home Automation System for a Camp with Cellular Internet

Project tutorial by Dana Mah

  • 27 respects

IR Proximity Sensors with Simulink and Arduino (Part 1)

Project tutorial by MATLAB Makers

  • 2 respects

Morse Code Transceiver

Project tutorial by Achindra Bhatnagar

  • 27 respects

Amazon Alexa / Arduino YÚN Smart Home Light Sample

Project showcase by Noctuvigilus

  • 4 respects

R/C Controller for Arduino and Simulink

Project tutorial by MATLAB Makers

  • 3 respects

Crazy Arduino Hose Display

Project showcase by hwhardsoft

  • 3 respects
Add projectSign up / Login