Introduction: 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

To make this project you will need 8 micro servo motors, some 3D printed parts, screws, 3,7V li-po battery and some parts to make PCB (atmega328 SMD, capacitor 100nF, capacitor 470μF, resistor 1,2k, some goldpins). If you haven't 3D printer you can print this parts for example here. 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.

Comments

author
11emre11 made it! (author)2017-02-23

What is the length of the snake?

author
Alexander heron the inventor made it! (author)2016-10-08

congratz bro

author
Elliotbarbo made it! (author)2016-04-11

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

author
Nikus made it! (author)Nikus2016-04-11

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.

author
Vinayak Tyagi made it! (author)2016-04-11

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

author
Nikus made it! (author)Nikus2016-04-11

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

author
plucas1 made it! (author)2016-04-04

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?

author
Nikus made it! (author)Nikus2016-04-11

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

author
phenoptix made it! (author)2016-04-02

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

author
Nikus made it! (author)Nikus2016-04-03

Thanks!

author
IgnacioC10 made it! (author)2016-04-01

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!

author
Nikus made it! (author)Nikus2016-04-03

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!

author
phenoptix made it! (author)2016-04-02

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

author
phenoptix made it! (author)2016-04-02

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

author
Yonatan24 made it! (author)2016-03-31

Cool! The filming in your video was great!

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

author
Nikus made it! (author)Nikus2016-03-31

Thank you very much :) Yes this is fume extractor

author
Yonatan24 made it! (author)Yonatan242016-04-02

Wow, That is so cool!

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

author
DroneBot Workshop made it! (author)2016-03-31

Excellent work on both the Snake and the video!

author
Nikus made it! (author)Nikus2016-04-01

Thanks :)

author
lukmar made it! (author)2016-03-31

Cool snake!

author
habeeba8wl made it! (author)habeeba8wl2016-03-31

Nice

author
Nikus made it! (author)Nikus2016-03-31

Thanks! :D

author
fortzero made it! (author)2016-03-31

Nicely done making of video. These type of projects are good way to learn using servos with arduino. Thnx for sharing.

author
Nikus made it! (author)Nikus2016-03-31

Thank you! :)

About This Instructable

6,827views

92favorites

License:

Bio: Hi, my name is Nikodem Bartnik. I live in Poland, I'm 18 years old. I like to program and create robots, devices and things ... More »
More by Nikus:BoseBuild GoPro MountCheap 30x30x40cm 3D PrinterFidget Spinning Robot
Add instructable to: