Demon Bear

by walkingold in Circuits > Arduino

635 Views, 1 Favorites, 0 Comments

Demon Bear

IMG_4746.JPG

This Instructable is pretty self-explanatory: How to build a demon bear that throws around its hatchet and eyes glowing red when you come near it.

Requirements

download.jpg
download.jpg
download.jpg

-1 Arduino Uno

-A breadboard

-Male/Male jumpers

-An Arduino servo TG9

-A HC-SR04 Ultrasone ensor

-A LED light (whatever color you want)

-A teddy bear

-A loose component that can be used as a bat, hatchet, etc

-Needle and thread

-Something to protect the hardware with

Connecting the Components

Arduino setup.jpg
IMG_4730.JPG
Arduino connections.jpg

The Ultrasonic sensor has four pins: The GND (ground), Echo, trig and the VCC. Connect those four pins with male-male jumpers in the following way:

GND = GND

Echo = 12

Trig = 13

VCC = On the minus side of the breadboard (see picture)

Connect the colored wires of the servo in the following way:

Yellow = 9

Red = Minus side of breadboard

Black = Negative side of LED

Soldering

D6411770-F0C1-4281-8FBB-8467D7FB23C5.JPG

On the top left of the picture you can see I soldered the hardware together. I made sure that it was sturdy and reliable, so the chances of the soldering coming undone inside of the bear were minimal.

After this I cut off the remaining board so it fits nicely inside the bear.

Coding It All Together

To make things as easy as possible for an amateur like me, I used baby steps in this part. First I made the coding for the servo and checked if this worked. Then, in a separate file I made the code of the ultrasonic sensor. After making sure both worked, I merged them together.

#define trigPin 13

#define echoPin 12

#define led 11

#include

long duration, distance;

Servo servo1;

int pos = 0;

void setup()

{ servo1.attach(9); Serial.begin (9600);

pinMode(trigPin, OUTPUT);

pinMode(echoPin, INPUT);

pinMode(led, OUTPUT);

}

void loop()

{

digitalWrite(trigPin, LOW);

delayMicroseconds(2);

digitalWrite(trigPin, HIGH);

delayMicroseconds(10);

digitalWrite(trigPin, LOW);

pinMode(echoPin, INPUT);

duration = pulseIn(echoPin, HIGH);

distance = (duration/2) / 29.1;

if (distance < 50) //Lampje gaat aan als de distance (in cm) kleiner is dan 50

{ digitalWrite(led,HIGH); int value = analogRead(echoPin);

for (pos = 0; pos <= 180; pos += 1) { // van 0 tot 180 graden servo1.write(pos); // Vertelt de servo om naar de positie van 'pos' te gaan delay(2); // wacht 9 ms om van 0 tot 180 graden te gaan } for (pos = 180; pos >= 0; pos -= 1) { // van 180 tot 0 graden servo1.write(pos); // Vertelt de servo om naar de positie van 'pos' te gaan delay(5); // wacht 9 ms om van 180 tot 0 graden te gaan } }

else {

digitalWrite(led,LOW);

int value = analogRead(echoPin);

}

Serial.print(distance);

Serial.println(" cm");

delay(0);

{ } }

Build-a-(demon)bear

IMG_5366.JPG
IMG_5367.JPG
IMG_5364.JPG
IMG_4746.JPG
IMG_4741.JPG

Now it's time to build our actual bear! I bought a Teddy Scares bear online, because I thought it looking scary would make me feel less bad about cutting into it than I would with a normal bear. I was wrong.

Note: I didn't unplug any wires or anything from the Arduino and other components when assembling the hardware into the bear.

First I opened the bear with an incision in its back, and removed some of the filling to give the hardware some space. Then I opened its right arm, slid the servo in, and stitched it back up. The white servo stick(?) should only be visible when properly stitched together.

After this i poked a little hole in its eye, and slid the LED light in. I secured it with some superglue to make sure the light wouldn't budge and fall back into the head. If this were to happen when everything's stitched up, it would be a pain to put back.

This step isn't very visible from the picture, but basically what I did get an empty mini shampoo bottle (the one you usually find in hotels) and shape it this way you could easily put the hardware in it while being protected. The last thing we would want is any of the filling to mess it up.

Then I stitched it all up, left a little hole for the remaining wires to stick out to the Arduino.

I glued the ultrasonic sonar sensor on the head of the bear, I thought it kind of looked like biker goggles. (Which fits, since it's wearing a leather jacket and all).

Then I put all of its clothing back on, and tested to make sure nothing got damaged or mover around while assembling. (Beware, it may be a bit of a hassle to put the clothing back on) I also glued the bat onto the servo.

The bear was finished, but the Arduino was fully visible from the backside, and it looked bad. So I quickly sewed a makeshift backpack to put the Arduino in.

Now feel free to enjoy your teddy bear whose eyes will glow red while swinging around a bat!

(Note: I am not responsible for any possible occurrences of nightmares, crying children or the very unlikely chance of it coming to life.)

Downloads