This project was built for the Things that Think undergraduate/graduate class CSCI 4830-7 and CSCI 7000-7 for the University of Colorado at Boulder.  Our group consisted of one graduate and two undergraduate students.  We worked on the project for 8 weeks, most of the time trying to learn how to program the arduino and learning the basics of circuits.  If you are looking to build this project, we do not anticipate this project taking nearly as long, but altogether could be completed in one weekend.


The purpose of this instructable is to outline our development of this robot snake as well as provide instructions and tips for future engineers hoping to complete a similar project or use components of our project in theirs. The goal of this project was to create an automaton snake that reacted to its environment. The main functionality of the snake is for it to follow a light source. Some goals we had in conjunction to the movement of the snake was to have a tail that rattles and decorative LED lighting. This tutorial will start with a little background information, then show the development of the basic pieces, and finish by finalizing your design.

Video of the final product

Tools Needed

Soldering iron, laser-cutter, scissors, sewing needle, small screwdriver, wire cutter/stripper, strong flashlight

Materials Needed

Arduino Uno, Arduino Motor Shield, Breadboard, Wire, Tape, Solder, LEDs, 3 photocell sensors, 2 DC Hobby motors, vibrator motor, Bass Wood, resistors of various resistance, 9V batteries, Toy wheels, string, paperclip, Gorilla glue

Step 1: Motor Shield and Motors

Quick motor tutorial

We will go through the motor step quickly, so if it will help, here is the tutorial this step will be based off of: Motor Shield Tutorial.  We will be using the same motor shield  and a lot of the same code in our project, so it may be helpful to have a short introduction to what we will be doing in this step.

Setting up the motors

To get started, we used low-voltage motors with tape on the end of each axle to test whether our code was working or not.  In the beginning, it is more important to get a prototype working, which can be expanded upon to get a final product.  The motors we used in this step were not the final motors we used, but they worked the same and allowed us to work on the project until we could find motors that were better suited for our needs.

Attach wire into the Channel A and Channel B slots on the motor shield and attach the ends of the motors.  You do not have to solder these yet, it will be easier if they are just twisted around the positive and negative tabs for easy removal in future steps.


void setup(void) {

  pinMode(12, OUTPUT); //Initiates Motor Channel A pin
  pinMode(9, OUTPUT); //Initiates Brake Channel A pin

  pinMode(13, OUTPUT); //Initiates Motor Channel B pin
  pinMode(8, OUTPUT); //Initiates Brake Channel B pin

  digitalWrite(13, LOW); //Establishes forward direction of Channel A
  digitalWrite(8, LOW); //Disengage the Brake for Channel A

  digitalWrite(12, LOW); //Establishes forward direction of Channel B
  digitalWrite(9, LOW);   //Disengage the Brake for Channel B
void loop(void) {
  analogWrite(3, 125); //Set speed for Channel A
  analogWrite(11, 125); //Set speed for Channel B

Video of the motors working



Remember when using the motor shield in future steps that the motors take Analog 0 and Analog 1 for sending feedback back to the motor shield, so we can no longer use them.  The direction of the motors also depends on how each of the Channel wires are connected to the motor.  If a motor is spinning in the wrong direction, you can either change the direction in the code by changing the Digital Output 13 or 12 for Channels A and B, respectively.  Or you can switch how the Channel wires are attached to the motor tabs, reversing the current direction and the direction of the motors.
nice project, very well documented! do you plan to add other types of sensors in the future?

About This Instructable




More by IzzyLink:Diorama, Bat in the cave Robot Snake 
Add instructable to: