3D Printed Snake Robot

32K13129

Intro: 3D Printed Snake Robot

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.

27 Comments

Why not an arduino for this? any restrictions?

It says in inventor and 3D model this is like 30 cm long and 17 cm tall, any way of rescaling this to the proper size.

Hola amigo, bonito y curioso robot. Viendo tu codigo observo que sólo mueves 4 servos, entonces, ¿para que utilizas 8 servos? muchas gracias y enhorabuena por tu serpiente.

What is the length of the snake?

were would i buy a atmega328 SMD or is there some other thing that would work?

You can buy it probably everywhere. I bought it in local electronic shop. Try to find it on amazon, ebay or also in some electronic shop.

awesome work, really good instructable!!
just wanted to ask which 3d printer you used?

Thank you so much! I used JGAURORA 605S 3D printer you can read about in my previous instructable

nice design, is it possible to sew leggings around the outside to keep the wires from snagging and to make it kind of more snake like? or will that affect the movement too much?

Thanks, I'm not sure but maybe it can work

Really fantastic design, another reason for me to get a 3D printer!

Nice project!! Can you tell me what screws did you use to hold the mobile part from the servo with the printed part? Because I'm making a cuadruped robot and don't know how to join the printed part with the servo, cause the little holes. Thanks!! And again, excellent work!

When you buy servo you get few servo arms and some screws, and I used that screws which are added to servo. Thank you so much!

Really fantastic design, another reason for me to get a 3D printer!

Really fantastic design, another reason for me to get a 3D printer!

Cool! The filming in your video was great!

What is that attachment on your soldering iron? Is that a fume extractor?

Thank you very much :) Yes this is fume extractor

Wow, That is so cool!

I'll have to find a way to make one of those one day...

More Comments