I was inspired to begin this project after seeing research videos of both tree climbing robotic snakes and robotic eels. This is my first attempt and building robots using serpentine locomotion, but it won’t be my last! Subscribe on YouTube if you would like to see future developments.
Below I outline the construction of 2 different snakes along with the files for 3D printing and a discussion about the code and algorithms to achieve snake-like motion. If you wish to continue learning more, after reading this instructable I would suggest reading the links in the references section at the bottom of the page.
This instructable is technically a 2-in-1, in that I explain how to make 2 different versions of a robotic snake. If you are only interested in building one of the snakes ignore the instructions for the other snake. These 2 different snakes will be from here on referred to using the following phrases interchangeably:
Single axis snake, 1D snake, or yellow and black snake Double axis snake, 2D snake, or white snakeOf course you can print the snakes in any colour filament you want. The only difference between the two snakes is that in the 2D snake each motor is rotated 90 degrees relative to the previous, whereas in the 1D snake all the motors are aligned in a single axis.
A final foreword is that while each of my snakes have only 10 servos it is possible to make the snakes with more or less servos. One thing to consider is that with less servos you will achieve less successful motion, and with more servos you will probably be more successful with the serpentine motion but you will need to consider cost, current draw (see later remarks) and the number of pins available on the Arduino. Feel free to alter the length of the snake, however keep in mind you will also need to alter the code to account for this change.”

Link