Introduction: 3D Printed Snake Robot

About: Hi, my name is Nikodem Bartnik. I'm 19 years old. I am into designing, making, programming and electronics. In the future, I want to start a company and make my own products. As for now, you can find my work o…

When I got my 3D printer I started to think what can I make with it. I printed a lot of things but I wanted to make a whole construction using 3D printing. Then I thought about making robot animal. My first idea was to make a dog or spider, but a lot of people already made dogs and spiders. I was thinking about something different and then I thought about snake. I designed whole snake in fusion360, and it looked awesome so I ordered necessary parts and build one. I think that the result is great. On the video above you can see how I made it or you can reed about it below.

Step 1: Parts

Here is what we will need:

  • 8 Micro servo motors
  • Some 3D printed parts
  • Screws
  • 3,7V li-po battery
  • Some parts to make PCB (atmega328 SMD, capacitor 100nF, capacitor 470μF, resistor 1,2k, some goldpins). It's very important to make PCB for this project because when you connect everything on breadboard your snake wouldn't be able to move.

Step 2: 3D Models

Aboove you can see visualization of this snake. Files (.stl) you can download here or on my thingiverse. Some info about settings for printing:

For printing segments and head I recommend to add raft.
Supports is unnecessary for all objects. Infill isn't so important because all models are very thin and there is almost only perimeters but I use 20%.

You need:

8x snake_segment

1x snake head

1x snake_back

Step 3: PCB

Below you can find eagle files (.sch and .brd) just download them open in eagle go to board view click ctrl + p and print it. If you don't know how to make PCB you can reed about it here:

https://www.instructables.com/id/PCB-making-guide/

On the schema is written that microcontroller is atmega8 but it's atmega328 it has same pinout but ther is no atmega328 in eagle.

Step 4: Assembling

After printing all parts you can assemble them together. Place servo into one of segments, screw it up to segment with M2 screw and then screw next segment to the servo arm. If you don't know how to assemble it you can look at video.

Step 5: Connection

On photo above you can see where and what to connect. I also marked where is MISO, MOSI and SCK pin you need this pin to burn bootloader. More about burning bootloader you can reed on official arduino page here:

https://www.arduino.cc/en/Tutorial/ArduinoToBreadboard

You need programmer or another arduino to burn it. After burning you can program it using USB-UART converter or the same programer that you use for burning bootloader.

After uploading program you can connect servo to board. Last servo (at the end of the snake) is servo 1 and servo 8 is the nearest to the head of snake.

There is no any stabilizer on the board so max voltage that you can connect to it is 5V.

Atmega as well as servo motors will work with 3,7V Li-Po and I recommend to use it for this project because it's very small and very powerful. You can find it in old RC toy (I found my in old RC helicopter).

I added to the board pins RX and TX for programming but also for future expansion, you can connect to here sensors or e.g. bluetooth modul.

Step 6: Program

Program uses software servo library to control 8 servos at once. It's simply incrementing and decrementing servo position with small shift to imitate wave. Thanks to this move it's looks like a worm but also move more efficient.

If you like you can change delay at the end of the loop. This delay control speed of snake. So if you give smaller value it will move faster, higher value = move slower. I gave 6 because this is highest speed at which snake doesn't rolls over. But you can experiment with this.

You can also change maximum and minimum value to make movements bigger.

#include

SoftwareServo servo1, servo2, servo3, servo4, servo5, servo6, servo7, servo8; int b_pos, c_pos, d_pos, e_pos; String command; int difference = 30; int angle1 = 90; int angle2 = 150;

int ser1 = 30; int ser2 = 70; int ser3 = 110; int ser4 = 150;

int minimum = 40; int maximum = 170;

bool increment_ser1 = true; bool increment_ser2 = true; bool increment_ser3 = true; bool increment_ser4 = true;

bool increment_ser5 = true; int ser5 = 90;

bool increment_ser6 = true; int ser6 = 90;

void setup() { Serial.begin(9600); servo1.attach(3); servo2.attach(5); servo3.attach(6); servo4.attach(9); servo5.attach(10); servo6.attach(11); servo7.attach(12); servo8.attach(13);

servo1.write(90); servo2.write(130); servo3.write(90); servo4.write(100); servo5.write(90); servo6.write(90); servo7.write(90); servo8.write(90);

}

void loop() { forward(); SoftwareServo::refresh(); }

void forward(){

if(increment_ser1){ ser1++; }else{ ser1--; }

if(ser1 < minimum){ increment_ser1 = true; } if(ser1 > maximum){ increment_ser1 = false; }

servo1.write(ser1);

if(increment_ser2){ ser2++; }else{ ser2--; }

if(ser2 < minimum){ increment_ser2 = true; } if(ser2 > maximum){ increment_ser2 = false; }

servo3.write(ser2);

if(increment_ser3){ ser3++; }else{ ser3--; }

if(ser3 < minimum){ increment_ser3 = true; } if(ser3 > maximum){ increment_ser3 = false; }

servo5.write(ser3);

if(increment_ser4){ ser4++; }else{ ser4--; }

if(ser4 < minimum){ increment_ser4 = true; } if(ser4 > maximum){ increment_ser4 = false; }

servo7.write(ser4);

delay(6);

}

Step 7: Conclusion

I think that this robot looks very good. I wanted to make a snake robot but finnaly I made something that looks similar to worm. But works very nice. If you have any questions leave a comment or write to me: nikodem.bartnik@gmail.com

you can also read about this robot here on my website (in Polish):

http://nikodembartnik.pl/post.php?id=3

This robot won first prize at the Robots Festival in Chorzów in freestyle category.

Robotics Contest 2016

Second Prize in the
Robotics Contest 2016

Full Spectrum Laser Contest 2016

Participated in the
Full Spectrum Laser Contest 2016

Make it Move Contest 2016

Participated in the
Make it Move Contest 2016