Wex, the One Eyed Watcher

by MikeTheMaker in Circuits > Arduino

1941 Views, 8 Favorites, 0 Comments

Wex, the One Eyed Watcher

one eye39.jpg


Wex detects your location with ultrasonic sensors then follows you with his one flashing eye.  His red "heartbeat" can be seen through his mouth.

schematic1.jpg
Parts needed include:

Arduino
Two ping ultrasonic sensors
Futaba s3103 servo
Radio Shack 276-0016 7 color led
Radio Shack  276-036 flashing red led
9 volt battery
480 ohm resistor
680 ohm resistor
Metal duct tape
Super glue
Case (print 3d parts--use a printing service to print them--make your own case)
http://www.thingiverse.com/thing:32121

The software "looks to the left--turn left if something there"
       "look to the right--turn right if something there"
       "look straight if nothing to the left or right"

#include <Servo.h>

Servo myservo;
const int pingPin = 7;
const int pingPin2 = 9;
long duration;
long duration1;


void setup ()
{myservo.attach(5);
}
void loop ()
{
  pinMode (pingPin, OUTPUT);
  digitalWrite (pingPin, LOW);
  delayMicroseconds (2);
  digitalWrite (pingPin, HIGH);
  delayMicroseconds (5);
  digitalWrite (pingPin, LOW);
  pinMode (pingPin, INPUT);
  duration = pulseIn (pingPin, HIGH);
  if (duration <5000)
  {
  myservo.write(125);
  delay(500);
  }
 
 
 // else
  {
    pinMode (pingPin2, OUTPUT);
  digitalWrite (pingPin2, LOW);
  delayMicroseconds (2);
  digitalWrite (pingPin2, HIGH);
  delayMicroseconds (5);
  digitalWrite (pingPin2, LOW);
  pinMode (pingPin2, INPUT);
  duration1 = pulseIn (pingPin2, HIGH);
  if (duration1 <5000)
  {
  myservo.write(5);
  delay(500);
  }
  if (duration >5000 and duration1 >5000)
 
 

  {myservo.write(65);
  delay(500);
  }}}
 
 

one eye02.jpg
Print the case--expect shrinkage cracks.

one eye01.jpg
Cut up plastic scraps into a can.

one eye04.jpg
Add acetone (fingernail polish removal section of stores) and stir. Fill the cracks and let dry.

one eye26.jpg
Fasten Ping sensors to the triangular ear pieces.  Add wire wrap wire to the Ping pins. Super glue the ears to the case.

one eye25.jpg
Drill 1/8 inch holes in the "one eye eye" case for the Ping wires.

one eye27.jpg
Route the wires through the side of the case.

one eye10.jpg
Press the eye stalk on the servo and make sure the assembly fits in the case (if you use a different servo motor--the mounting slot in the case will have to be set up differently).

one eye16.jpg
Add a red wire wrap wire to the center lead of the 7 color led.

one eye18.jpg
Add a blue wire wrap wire to the lead with a 90 degree bend on the led.  Cut the other (angled) lead off.

one eye19.jpg
Use heat shrinkable tubing (or electrical tape) to insulate the legs.

one eye21.jpg
one eye13.jpg
one eye20.jpg
Push the led through the eye stalk.

one eye28.jpg
Place double sided tape on the back of the Arduino.

one eye30.jpg
Place the Arduino inside the case, along with the servo motor.

one eye35.jpg
Connect everything together, insert the battery and see if things work.

one eye36.jpg
Tape the "nose" (upper piece) onto the body with aluminum duct tape.

one eye08.jpg
Get the "mouth" and tape it on.

one eye37.jpg
one eye11.jpg
Paint the nails to suit your taste.

one eye38.jpg
Glue the feet to the bottom of the case--take a marker or paint and highlight the "nose."

one eye39.jpg
He's all finished--enjoy!