Minecraft Creeper Sentry With Arduino Uno, Ultrasound and LEDs

Published

Introduction: Minecraft Creeper Sentry With Arduino Uno, Ultrasound and LEDs

About: Arduino and Robotics Nerd, and alumni of FIRST Robotics Team 5683 (Go R.A.V.E.!). Blinking LEDs with Arduino is still one of my favorite pastimes even after years of doing it.

SssssssssssBOOM!!! You died. Respawn?

Whoops. I suppose a diamond sword would have been a good idea. These torches have terrible attack damage, don't you think?

I know sentries are nothing new. Neither are creepers. But the two combined? I haven't seen that yet, have you? Probably not. And that is the basis of this project.

Background Story: I'm obsessed with LEDs, Arduino, and Robotic Stuff. And explosions are cool too. I don't actually play Minecraft that much, but I do see the merit it holds as an educational and creative stimulant. And it gives me an excuse to blow stuff up. Without blowing anything up. Which is cool. Anyway, I wanted to create something robotic that has LEDs and can explode without exploding. And then I saw the Minecraft Challenge here on Instructables, and knew I just HAD to make a creeper.

So what is this thing anyway?

We will be building a small robotic 'creeper' that acts as a sentry and will blink red and hiss when something gets too close. I want to make it entirely open source, and I also want to make it cheap so anyone can build it (and because my ROB project was expensive).

After starting the build, I decided to make it capable of operating in different 'modes', aside from just being a sentry. As of now, I have added a standby mode in which it essentially becomes an RGB "breathing" nightlight, two versions of the sentry mode, one where it hisses, and one where it just beeps, and an object following mode where it will follow the first object it sees within a pre-specified range.

Whew! Did I get everything?

Nope, wait, one more thing. Potential upgrades are an explosion sound effect (which is really hard to get right, I've been trying for months now), and a motor driver, internal battery and wheels so it can have a fifth mode for obstacle avoidance.

But how do I build it?

Well, follow along, and let's see how this one turns out.

Step 1: Gathering Materials

Always, always, always gather materials before starting a project. That way you never have to shelf it for later because you don't have something vital.

You will need:

Cardboard

Printer Paper

1x Arduino Uno

1x 9-gram Servo and servo horn

1x HC-SR04 or equivalent ultrasonic sensor

1x Buzzer (passive)

4x RGB LEDs (Common Cathode)

7x LONG male-male jumper wires (the longest ones in the standard Dupont assortments will do)

Lots of male-male jumper wires (any size will do)

4x male-female jumper wires

1x external power source (at least 5 volts and 1 amp)

Acrylic Paint:

Apple Barrel Plaid "Leaf Green" 20528

Delta Ceramcoat "Sunshine Pearl" 02615

Delta Ceramcoat "Phythalo Green" 02501

Apple Barrel Plaid "Black" 20504

Apple Barrel Plaid "Pewter Grey" 20580

Step 2: The Frame

So, we need to have somewhere to mount everything. And it needs to look like a creeper. I wish I could 3D print this, but alas, cardboard is all I've got. (I seem to mention this a lot, don't I?)

Step 1: Cutting

Cut out:

1x rectangle 2.5 inches x 5 inches - Label this "A1"

4x rectangles 2.75 inches x 2.5 inches - Label these "B1" through "B4"

4x rectangles 2.75 inches x 5.75 inches - Label these "C1" through "C4"

6x rectangles 2.25 inches x 4.75 inches - Label these "D1" through "D6"

2x squares 2.75 inches x 2.75 inches - Label these "E1" and "E2"

1x square 4.25 inches x 4.25 inches - Label this "F1"

Step 2: Gluing

Heat up your glue gun, and use the schematics and pictures above to create the feet, head, and the main body.

Step 3: Access Hatch

Cut and glue small strips of cardboard about 1/2 inch wide around the perimeter of the last rectangle of cardboard. This piece will be our door. (Don't mind the electronics in the picture, I took it after I finished the creeper because all of my pictures from during the build are terrible.)

Use a strip of printer paper and glue to create a hinge, and attach the door to the body so that it will close nicely, but requires a little force to open. (Again, ignore the paint.)

Now you can move on to the circuitry!

Step 3: The Circuits!

This part gets a bit tricky. I designed PCBs for this step, although I don't have a way of getting them manufactured myself. I'll attach them here, though, so you can use them if you like.

(Sorry I don't have any circuit schematics this time around... Maybe I'll add them later if I have time.)

Note: I have two pushbuttons, and tell you how to assemble it with both. However, the code only uses the one on A1, and the other one is a spare I originally intended to use to switch the colors in Standby Mode.

Step 1: The Arduino

On a mini breadboard, bread the two pushbuttons, the buzzer and the potentiometer.

Connect one side of each button to one side pin on the potentiometer.

Connect the same side pin I just mentioned to Ground on the Arduino and the negative side of the buzzer.

Connect the other side of the potentiometer to 5V on the Arduino.

Connect the center pin of the potentiometer to A0 on the Arduino.

Connect the open sides of the pushbuttons to A1 and A2 on the Arduino.

Connect the positive side of the buzzer to A5 on the Arduino.

Connect a jumper from the 5V pin of the Servo to the positive side of the potentiometer.

Connect a jumper from the negative pin of the Servo to Ground on the Arduino.

Connect a jumper from the Signal pin of the Servo to pin 9 on the Arduino.

Step 2: the Lights and Ultrasound

On a second mini breadboard, bread 4 RGB LEDs in the corners.

Connect the Red, Green, Blue, and Ground pins of the LEDs together to form a common Red, Green, Blue and Ground pins, respectively.

Connect 4 male-female Dupont jumpers to the HC-SR04.

Connect GND from the HC-SR04 to the common ground, and bread the other 3 pins in their own respective rows of the breadboard.

Step 3: Two Square Holes and a Box

From a scrap piece of cardboard, cut out a rectangle about the same size as the mini breadboard.

Cut out strips about 1/4 inch wide and glue these to the perimeter of the rectangle. Glue the box you just created in a the center of the head, over the servo horn.

Rotate the head section to the center position, i.e. until it is looking forward (although it doesn't have eyes yet)

Using a long blade on an X-Acto knife, cut a square hole next to the box, through the head and the top of the body simultaneously. In other words, cut through to the inside of the body of the creeper.

Step 4: Wires

First, peel off the waxy paper and stick the breadboard with the lights on top of the box we made in the last step.

Now, get out 7 of the longest Dupont jumper cables you have. About 6 inches apiece should be fine, or you can solder two or three shorter ones together.

Attach one of these each to the Red, Green, Blue, Trig, Echo, VCC, and Ground rows on the top mini breadboard.

Thread these through the holes we made in the last step.

Connect the VCC wire to the positive pin on the potentiometer on the second breadboard.

Connect the Ground wire to one of the open Ground pins on the Arduino.

Connect the Trig wire to pin 4 on the Arduino.

Connect the Echo wire to pin 5 on the Arduino.

Connect the Red wire to pin 6 on the Arduino.

Connect the Green wire to pin 11 on the Arduino.

Connect the Blue wire to pin 3 on the Arduino.

Gently twist the head in both directions until the servo reaches its limit. With the arduino and the mini breadboard inside the body, the wires should never become pinched or taut. If they do you will need to make them longer (i.e. you will need to solder another small jumper wire to the end of the current one).

Now you can attach the top of the head!

Step 4: The Rest of the Head

So, the part I've been referring to as the head isn't really a head yet, just a platform. Here we will make the distinct creeper face come to life! Not really. We do that later when we paint it. But this is the baseline for that later step.

Step 1: Paper

Using either printer paper or a heavier Bristol (which I prefer because it doesn't crumple as easily and won't wrinkle as bad when I paint it), cut out 5 squares 11 centimeters acrss, leaving tabs on the edges so we can glue them together.

Using a glue of your choice, assemble the squares into a cube with one side missing.

Step 2: More Cardboard (Seriously, what would I do without this stuff?)

Print out the Creeper Template document I attached.

Lay the template over the cardboard, and cut out the eyes and mouth, leaving the white areas intact. Do this as neatly as possible, we still need the shaded area.

Lay the shaded area over one of the sides of the cube adjacent to the missing side, and lightly trace the eyes and mouth, keeping in mind the missing side of the cube is the bottom.

Using a glue of your choice, carefully glue the cardboard eyes and mouth on the inside of the cube,aligned to the tracing on the outside.

Carefully cut out the circles on the cube, using the cardboard as a guide.

Step 3: Ultrasonic Sensor

Slot the HC-SR04 into the circles we just created, so the front is flush with the cube. The header pins should be pointing away from the missing side of the cube.

Hot glue the sensor in place.

Step 4: Gluing the Head

NOTE: You may want to test the code before doing this, to ensure your LEDs and HC-SR04 are wired correctly

Carefully fit the cube over the top of the base of the head, and hot glue the edges in place once you are satisfied. Make sure your sensor faces forward when the head is in the center position.

Now you can move on to upload and test the code!

Step 5: The Code!

The code for this project took me a while to write and is kind of all over the place. I originally intended to use a different code for the tracking and standby modes, but issues with libraries and timer pins forced me to write a whole new section for each of those.

I also originally intended to have a sixth mode in which the creeper plays the Calm theme from Minecraft, but preliminary testing excluded that idea as the theme sounded terrible and conflicted with the Servo library.

Anyway, have a read through to get an idea as to what I am doing with it, then upload the code to your Arduino.

/* --------------------------------------------------------------------------------------------

 This is a code for an Arduino sentry with ultrasound. 
 The original design is intended to be a Creeper from Minecraft. 
 There are several "modes" that can be selected through the use of pushbuttons 
 and a potentiometer. The first pushbutton cycles through the modes, and the 
 potentiometer adjusts the "active range".
 
 --------------------------------------
 
 The modes are as follows:
 
 1 - Standby Mode    - 7-color "breathing" (basically a night light)
 
 2 - Creeper Sentry  - Will blink and hiss when someone gets within the active range
 
 3 - Standard Sentry - Will beep when someone gets within the active range
 
 4 - Object Tracking - Will track the first object it "sees" while within range
 
 --------------------------------------
 
 Code written by Dangerously Explosive
 
 Not for commercial use.
 
----------------------------------------------------------------------------------------------- */

#include  //initialize the libraries

//servo vars          

Servo sentryServo;         //init the servo
int servoPosition = 0;         // the servo position
const int numReadings = 3;   // the number of readings to take, make this bigger for a slower, more accurate scan
int index = 0;                // the index of the current reading
int total; // the total value of the sum of all readings taken at one position.
int angle = 1; //the number of degrees shifted during each scan while tracking an object

//ultrasonic vars

int echoPin = 5;              // the HCSR04's echo pin
int trigPin = 4;              // the HCSR04's trig pin
unsigned long pulseTime = 0;  // variable for timing the pulse
unsigned long distance = 0;   // variable for distance
int average;                  // for the avg. distance
int minRange = 50;            // the max distance in centimeters something must be to set off the alarm

//light vars

int RED = 6;    // RED pin of the LEDs
int GREEN = 11;  // GREEN pin of the LEDs 
int BLUE = 3;   // BLUE pin of the LEDs    
// it doesn't really matter what pin you assign, you can always change it later.

// debouncing vars

const int buttonPin = A1;    // the pushbutton pin
const int potPin = A0;       // the potentiometer pin
int buttonState;             // the current reading from the input pin
int buttonState1;
int lastButtonState = LOW;
int lastButtonState1 = LOW;// the previous reading from the input pin
int mode = 0;                // the sentry mode
int colorMode = 0;           // the LED mode in standby
long lastDebounceTime = 0; // the last time the output pin was toggled
long lastDebounceTime1 = 0;
long debounceDelay = 50;    // the debounce time; increase if the output flickers

// Other vars
int buzzerPin = A5;


//debounce function 

void debounce(){
  // read the state of the switch into a local variable:
  int reading = digitalRead(buttonPin);

  if (reading != lastButtonState) {
    // reset the debouncing timer
    lastDebounceTime = millis();
  }

  if ((millis() - lastDebounceTime) > debounceDelay) {

    // if the button state has changed:
    if (reading != buttonState) {
      buttonState = reading;

      // only toggle the mode if the new button state is LOW
      if (buttonState == LOW) {
        mode ++;
        tone(buzzerPin, 500, 50); //beep so I know something happened
        if (mode >= 5){
          mode = 0;
        }
      }
    }
  }
  
    
  // save the reading.  Next time through the loop,
  // it'll be the lastButtonState:
  lastButtonState = reading;
}

void getRange(){ // find the range at which the alarm should go off
  int rawRange = analogRead(potPin);         // get the potentiometer readings
  minRange = map(rawRange, 0, 1023, 0, 150); // mapped to a value between 0 and 1.5 meters  
}


void getAlert1 (){
  getRange();
  if (average <= minRange){
    beep();
    Alert();
  };
}

void getAlert(){
  getRange();
  if (average <= minRange){
    blinky();                 //blink red
    hiss();                   // hiss 
        // good explosion sounds are really hard to make, so I just have it hiss
  };
}

void blinky(){
  digitalWrite(GREEN, LOW);
  analogWrite(BLUE, 0);
  int duration = 100;
  for(int l = 0; l <= 10; l++){
    analogWrite(RED, 255);
    delay(duration);
    analogWrite(RED, 0);
    delay(duration);
    duration = duration - 10; 
  }
}

int var1;
int var2;

void hiss(){
  for (int j = 0; j <= 100; j++){
    var1 = random(300, 700);
    var2 = random(300, 700);
    tone(buzzerPin, var1);
    delay(2);
    tone(buzzerPin, var2);
    delay(2);
  }
  noTone(buzzerPin);
  digitalWrite(GREEN, HIGH);
}

  int duration = 500;
  int i = 0;
  
void beep(){
  digitalWrite(GREEN, LOW);
  analogWrite(BLUE, 0);
  int frequency = 500;
  duration = 200;
  for(int i = 0; i <= 20; i++){
    analogWrite(RED, 255);
    digitalWrite(GREEN, LOW);
    tone(buzzerPin, frequency);
    delay(duration);
    analogWrite(RED, 0);
    digitalWrite(GREEN,HIGH);
    delay(duration);
    noTone(buzzerPin);
    frequency = frequency + 10;
    duration = duration - 10;
    
  }
  tone(buzzerPin, frequency);
  delay(500);
  noTone(buzzerPin);
}
int q = 200;
void Alert(){
  digitalWrite(GREEN, LOW);
  tone(buzzerPin, 500);
  analogWrite(RED, 255);
  delay(q);
  analogWrite(RED, 0);
  delay(q);
  tone(buzzerPin, 300);
  analogWrite(RED, 255);
  delay(q);
  analogWrite(RED, 0);
  delay(q);
  tone(buzzerPin, 200);
  analogWrite(RED, 255);
  delay(q);
  analogWrite(RED, 0);
  delay(q);
  tone(buzzerPin, 100);
  analogWrite(RED, 255);
  delay(q);
  analogWrite(RED, 0);
  noTone(buzzerPin);
  delay(q);
  tone(buzzerPin, 100);
  analogWrite(RED, 255);
  delay(q);
  analogWrite(RED, 0);
  noTone(buzzerPin);
  delay(q);
  tone(buzzerPin, 100);
  analogWrite(RED, 255);
  delay(q);
  analogWrite(RED, 0);
  noTone(buzzerPin);
  digitalWrite(GREEN, HIGH);
}

int numReadings1 = 1;

void getAverage(){
  for (index = 0; index<=numReadings1; index++) {
    digitalWrite(trigPin, LOW);
    delayMicroseconds(50);
    digitalWrite(trigPin, HIGH);                           // send signal
    delayMicroseconds(50);                                 // wait 50 microseconds for it to return
    digitalWrite(trigPin, LOW);                            // close signal
    pulseTime = pulseIn(echoPin, HIGH);                    // calculate time for signal to return
    distance = pulseTime/58;
    total = distance + total;
    delay(10);
  }
  average = total/numReadings; 
  total = 0;
}

/*
The tracking code is very simple. First, it determines if an object is in range.
If it is, then it turns until it doesn't see the object, i.e. it is looking just past it on one side.
Then, turn left until it sees the object again, and repeat. In this way, we can keep track of the object.
This is basically using the old "The missile knows where it is" logic. If we know where the object is not, 
we can reasonably determine where it is. The way I have it set up is rather jittery, and I'm really just 
tracking the edge of an object than the object itself. If you are planning on tracking larger objects, you 
can increase the value of the variable "angle" so the servo will turn in larger increments, resulting in a
faster, less detailed scan where small objects are more likely to be missed.

I should mention this is a very primitive, finicky and easy-to-fool system, so I don't reccomend using it 
as a security measure or a targeting system. It is also not necessarily accurate.
*/

void track(){
  sentryServo.write(servoPosition); // first get the servo going
  getAverage();                     // then find the distance to target
  getRange();                       // find the range within which we will track an object
  if (average <= minRange){               //if the object is in range, turn left
    servoPosition = servoPosition + angle;
  }
  if (average >= minRange){                //otherwise turn right
    servoPosition = servoPosition - angle;
  }
  if (servoPosition <= 10 || servoPosition >= 170){  // you can change these values so that your sentry makes a smaller sweep.   
    angle = -angle;                                 // if we hit the edge of our sweep, go the other way        
  }
}



void setup() {

  sentryServo.attach(9); //servo is on pin 9
  sentryServo.write(90);
  pinMode(trigPin, OUTPUT);
  pinMode(echoPin, INPUT);
  pinMode(buttonPin, INPUT_PULLUP); // active low

  pinMode(RED, OUTPUT);
  pinMode(BLUE, OUTPUT);
  pinMode(GREEN, OUTPUT);
  analogWrite(GREEN, 255); // color sequence to notify of reset and to test LEDs
  delay(1000);
  analogWrite(GREEN, 0);
  delay(500);
  analogWrite(RED, 255);
  delay(1000);
  analogWrite(RED, 0);
  delay(500);
  analogWrite(BLUE, 255);
  delay(1000);
  analogWrite(BLUE, 0);
  delay(500);
  pinMode(buzzerPin, OUTPUT);

} 

int fade = 5;
int state = 0;
int count = 0;
int h = 50;

void loop() {
  debounce();
  while (mode == 0){
    if (state == 0){
      analogWrite(RED, colorMode);
      analogWrite(GREEN, 0);
      analogWrite(BLUE, 0);
      debounce();
      colorMode = colorMode + fade;
      delay(h);
      if (colorMode >= 255 || colorMode <= 0){
        fade = -fade;
        count ++;
      }
      if (count == 2){
        count = 0;
        state ++;
      }
    }
    if (state == 1){
      analogWrite(RED, 0);
      analogWrite(GREEN, colorMode);
      analogWrite(BLUE, 0);
      debounce();
      colorMode = colorMode + fade;
      delay(h);
      if (colorMode >= 255 || colorMode <= 0){
        fade = -fade;
        count ++;
      }
      if (count == 2){
        count = 0;
        state ++;
      }
    }
    if (state == 2){
      analogWrite(RED, 0);
      analogWrite(GREEN, 0);
      analogWrite(BLUE, colorMode);
      debounce();
      colorMode = colorMode + fade;
      delay(h);
      if (colorMode >= 255 || colorMode <= 0){
        fade = -fade;
        count ++;
      }
      if (count == 2){
        count = 0;
        state ++;
      }
    }
    if (state == 3){
      analogWrite(RED, colorMode);
      analogWrite(GREEN, colorMode);
      analogWrite(BLUE, 0);
      debounce();
      colorMode = colorMode + fade;
      delay(h);
      if (colorMode >= 255 || colorMode <= 0){
        fade = -fade;
        count ++;
      }
      if (count == 2){
        count = 0;
        state ++;
      }
    }
    if (state == 4){
      analogWrite(RED, colorMode);
      analogWrite(GREEN, 0);
      analogWrite(BLUE, colorMode);
      debounce();
      colorMode = colorMode + fade;
      delay(h);
      if (colorMode >= 255 || colorMode <= 0){
        fade = -fade;
        count ++;
      }
      if (count == 2){
        count = 0;
        state ++;
      }
    }
    if (state == 5){
      analogWrite(RED, 0);
      analogWrite(GREEN, colorMode);
      analogWrite(BLUE, colorMode);
      colorMode = colorMode + fade;
      delay(h);
      debounce();
      if (colorMode >= 255 || colorMode <= 0){
        fade = -fade;
        count ++;
      }
      if (count == 2){
        count = 0;
        state ++;
      }
    }
    if (state == 6){
      analogWrite(RED, colorMode);
      analogWrite(GREEN, colorMode);
      analogWrite(BLUE, colorMode);
      colorMode = colorMode + fade;
      delay(h);
      debounce();
      if (colorMode >= 255 || colorMode <= 0){
        fade = -fade;
        count ++;
      }
      if (count == 2){
        count = 0;
        state ++;
      }
    }
    if (state == 7){
      debounce();
      state = 0;
    }
    debounce();
  };
  
  while (mode == 1){
    debounce();
    analogWrite(GREEN, 255);
    analogWrite(BLUE, 0);
    analogWrite(RED, 0);
    for(servoPosition = 0; servoPosition < 180; servoPosition++) {  
      debounce();
      sentryServo.write(servoPosition);

      for (index = 0; index<=numReadings; index++) {            // take readings from the sensor and average them
        
        digitalWrite(trigPin, LOW);

        delayMicroseconds(50);

        digitalWrite(trigPin, HIGH);                           // send signal

        delayMicroseconds(50);                                 // wait 50 microseconds for it to return

        digitalWrite(trigPin, LOW);                            // close signal

        pulseTime = pulseIn(echoPin, HIGH);                    // calculate time for signal to return

        distance = pulseTime/58;                               // convert to centimetres

        total = distance + total;

        delay(10);

      }

      average = total/numReadings;         // get our average

      getAlert();                          // explode if too close

      total = 0;                           // reset our totals
    }
    debounce();
    // reverse direction when we get to either side

    for(servoPosition = 180; servoPosition > 0; servoPosition--) {  // going right to left
      debounce();
      sentryServo.write(servoPosition);

      for (index = 0; index<=numReadings;index++) {

        digitalWrite(trigPin, LOW);

        delayMicroseconds(50);

        digitalWrite(trigPin, HIGH);

        delayMicroseconds(50);

        digitalWrite(trigPin, LOW);

        pulseTime = pulseIn(echoPin, HIGH);

        distance = pulseTime/58;

        total = distance + total;

        delay(10);
      }

      average = total/numReadings;

      getAlert();

      total = 0;
    }
  };

  while (mode == 2){ // still acting as a sentry, but with different sounds
    debounce();

    for(servoPosition = 0; servoPosition < 180; servoPosition++) {  
      debounce();
      sentryServo.write(servoPosition);

      for (index = 0; index<=numReadings;index++) {            // take readings from the sensor and average them

        digitalWrite(trigPin, LOW);

        delayMicroseconds(50);

        digitalWrite(trigPin, HIGH);                           // send signal

        delayMicroseconds(50);                                 // wait 50 microseconds for it to return

        digitalWrite(trigPin, LOW);                            // close signal

        pulseTime = pulseIn(echoPin, HIGH);                    // calculate time for signal to return

        distance = pulseTime/58;                               // convert to centimetres

        total = distance + total;

        delay(10);

      }

      average = total/numReadings;         // get our average

      getAlert1();                          // explode if too close

      total = 0;                           // reset our totals
    }

    // reverse direction when we get to either side
    debounce();
    for(servoPosition = 180; servoPosition > 0; servoPosition--) {  // going right to left
      debounce();
      sentryServo.write(servoPosition);

      for (index = 0; index<=numReadings;index++) {

        digitalWrite(trigPin, LOW);

        delayMicroseconds(50);

        digitalWrite(trigPin, HIGH);

        delayMicroseconds(50);

        digitalWrite(trigPin, LOW);

        pulseTime = pulseIn(echoPin, HIGH);

        distance = pulseTime/58;

        total = distance + total;

        delay(10);
      }

      average = total/numReadings;

      getAlert1();

      total = 0;
    }
  };
  
  // re-center the servo for the track function
  servoPosition = 90;

  while (mode == 3){ 
    debounce();
    analogWrite(BLUE, 255);
    analogWrite(GREEN, 0);
    track();
  };
  
  while(mode == 4){
    sentryServo.write(90);
    debounce();
  };
  
  analogWrite(BLUE, 0); // turn off the blue light for the next time thru.
  delay(10); // let the processor rest a little
}

Step 6: Mounting Things, Power, and Paint!

Okay, now your sentry should be functional. Let's make it pretty!

Step 1: Mounting Things

Using an adhesive of your choice, mount the Arduino in an upright position along the "back wall" of the body.

Peel the waxy paper off the bottom of the mini breadboard, and stick it as far back on the "floor" of the body as possible.

Close the access door to make sure it all fits nicely.

Step 2: Power

Cut a hole in the bottom of the body of the creeper. The exit point should be somewhere between the feet.

Connect a power jack of your choice (I used a standard barrel jack I harvested from a fried Arduino) to the Vin and GND pins of the Arduino, and then hot glue it in the hole you just created.

Check to see that it works, then move on.

Step 3: Paint!

I think this part is pretty self-explanatory. You can use however much detail and whatever colors you like, or even not paint it at all. It all depends of how you want it.

I only used one shade of green for the whole thing, and it looks darn good. My mixture is a 1:1 ratio of Delta Ceramcoat "Sunshine Pearl" yellow with Apple Barrel Plaid "20528 Leaf Green", and a teensy bit (1 drop to every 10 of yellow) of Delta Ceramcoat "Phthalo Green" for that blue-y tint that makes the whole thing glow nicely in sunlight.

The black is Apple Barrel Plaid "20504 Black", and the grey is Apple Barrel Plaid "20580 Pewter Grey". I used a flat brush for the whole thing.

Let it dry, and viola! One finished Creeper Sentry!

Step 7: The Results

All in all, I like how this one turned out. Although I didn't plan it that way, it is actually to-scale with my furnace clock and almost to-scale with my glowing torch (which is just a little big).

The code is a bit jittery, something I hope to fix in coming days, but the effect is still there. If I ever figure out how, I will come back and add a few lines of code for the symbolic explosion sound that creepers have to add that much more special-ness to it.

I actually added the tracking code at the last minute on a whim, and I really like how it turned out, even if it doesn't work that well. It is really cool to walk into a room and have a creeper turn and look at you, and then have it keep looking at you as you walk past, just like in Minecraft. Well, except the part where it chases me and explodes. But that's a project for another time.

As always, these are the projects of Dangerously Explosive, his lifelong mission, "to boldly build what you want to build, and more."

You can find the rest of my projects here.

Please, please vote if you liked this project and want to see more like it.

Be sure to comment if you have questions, comments (duh?), or suggestions, I want to hear all of it!

Share

    Recommendations

    • Make it Move Contest

      Make it Move Contest
    • Woodworking Contest

      Woodworking Contest
    • Microcontroller Contest

      Microcontroller Contest
    user

    We have a be nice policy.
    Please be positive and constructive.

    Tips

    1 Questions

    Hi,

    I am doing this proiect for a school work and I have a question. For what are the 2 buttons?

    I mention this in Step 3. The first button on Analog pin A1 switches the operating mode. The second button has no function. In the original iteration it changed the color of the lights in Standby Mode, but that function introduced numerous bugs and glitches so I removed it in the final version. You actually only need one button to make this project work. If you want to spend some time on it, you could develop your own bit of code to give the second button a function, but I found that the processor on the Uno can only take so many commands at once and when you start adding more it slows down other functions like distance alerts and tracking.

    4 Comments

    I would like to try this as well. Had a little trouble following your wiring as no schematic however worked it out and drew one up from your excellent creeper control module silk top pdf for pcb. I did not see where you specified the value of the potentiometer but don't think this is particularly critical.

    1 reply

    Yeah, sorry about that. I'm working on creating schematics, I'll have them up as soon as I finish them. As far as the potentiometer, any value should work fine as long as it starts from zero or thereabouts. I tested mine with both a 10k and a 5k trimmer pot, and both worked fine, although the 5k only allowed for half of the available range. The standard pot for use with an Arduino is a 10k rotary pot, and that is what I wrote the code for, but adjustments can be made for any value range.

    Let me know if you have any questions, and happy making!

    This is a very cool idea, definitely a project I'll have to make sometime.

    1 reply