I recently read about Nathan Griffith’s Nematoduino, a full brain simulation (all 302 neurons!) of a nematode on Arduino, with great fascination. I thought it was soooooo cool and immediately wanted one of my own. The source code was released, but unfortunately no hardware diagrams came along with the code. I read through the code and determined that H-bridges were needed — I did not have these on-hand. I did, however, have an Adafruit Motor Shield. I decided to adapt Nematoduino for my hardware and I was successful with very little effort.
It was actually very easy to adapt. The author is setting motor speed using 8 bit resolution, the same as an Adafruit Motor Shield would. I changed his motor commands slightly to signal the motor shield in terms of speed and direction. I made some minor pin selection changes, making pin 13 the indicator pin for the ping sensor. I also disabled the stop/start push-button switch out of convenience but this easily re-enabled.
I was then able to load up my sketch and enjoy my nematode!
My circuit diagram from Fritzing:
The sketch for my build can be obtained here.