Project showcase
Specimen #1 light sensitive animatronic

Specimen #1 light sensitive animatronic

A creepy display piece that aggressively twitches and moves in accordance with the light source.

  • 251 views
  • 0 comments
  • 0 respects

Components and supplies

A000066 iso both
Arduino UNO & Genuino UNO
×1
Adafruit industries ada161 image 75px
Photo resistor
×2
Sg90 servo motor 180 degrees sg90 micro
SG90 Micro-servo motor
5 of these motors are standard size, but I didn't find the component file for a standard servo on Hackster.
×12

Necessary tools and machines

3drag
3D Printer (generic)

Apps and online services

About this project

I have made lots of of light following robots out of junk and a handful of photocells. I always thought simple robotics had potential when it came to making interactive props and...well throughly creeping everyone out.

There's nothing remotely terrifying about this photo at all.

I almost always try to start with a sketch like this before I start.

Specimen #1 is that theory put into action. Driven by an arduino and two photocells, this creepy installation snarls and gnashes it's teeth in response to the light source. I really like simple analog sensors. The movement is less predictable and makes it a bit more lively. In spite of using sensors and microcontrollers on my projects, I do usually try to keep things pretty simple most of the time.

That being said, allow me to contradict what I just said with this vaguely human shaped bundle of wires and plastic.

Here's an early test vid before I did any wire organization or aesthetic work.

The real work for this project was the actual fabrication. It's built out of 3D printed parts designed in Autodesk Inventor, and a modifed halloween skeleton torso, along with some sculpted, molded and cast silicone pieces. The rotten fruit still life decorating the base is a bit of a Joel Peter Witkin reference. If you don't know who that is...well google carefully and at your own discretion. His work is not for the faint of heart or easily offended.

I decided to create this bandaged torso basically because I felt a bit Like Frankenstein just getting started. I only seemed suiting that I make something akin to a rejected experiment, and it allowed me to poke fun at the project itself. I have found it really helps get things finished if you don't take it too seriously.

Here's a video in under a more normal lighting condition, before the base was painted.

Code

specimen Arduino
#include <Wire.h>
#include <Adafruit_PWMServoDriver.h>
Adafruit_PWMServoDriver pwm = Adafruit_PWMServoDriver();
// variables:
int LEFTsensorValue = 0;         // the sensor value
int leftVal1;
int leftVal2;
int leftVal3;
int leftVal4;
//int LEFTsensorMin = 0;        // minimum sensor value
//int LEFTsensorMax = 100;           // maximum sensor value
const int LEFTsensorPin0 = A0;    //eye
int RIGHTsensorValue = 0; // the sensor value
//int RIGHTsensorMin = 0;        // minimum sensor value
//int RIGHTsensorMax = 100;           // maximum sensor value
const int RIGHTsensorPin1 = A1;   //eye
long timer=0;//will store the length of time it takes before running the tilt routine
long timetoWait=5000;//length of time before running the tilt routine
#define SERVOMIN  150          // this is the 'minimum' pulse length count (out of 4096)
#define SERVOMAX  400          // this is the 'maximum' pulse length count (out of 4096)
  uint16_t NECK = 0;           //neck servo
  uint16_t rshoulderX=1;
  uint16_t LshoulderX=2;
  uint16_t rshoulderY=3;
  uint16_t LshoulderY=4;
  uint16_t Llip=5;
  uint16_t RULlip=6;
  uint16_t LULlip=7;
  uint16_t RBrow=8;
  uint16_t LBrow=9;
  uint16_t RXeye=10;
  uint16_t RYeye=11;
  uint16_t LXeye=12;
  uint16_t LYeye=13;
  uint16_t RLED=14;
   uint16_t LLED=15;
  
  int NECKPOS = 165;          // assigned value
  int NECKPOS1 = 225;         // assigned value
  int NECKPOS2 = 375;           // assigned value
  
  int ALTPOS = 325;          // assigned value
  int ALTPOS1 = 300;         // assigned value
  int ALTPOS2 = 375;           // assigned value


// the setup routine runs once when you press reset:
void setup() {
  // initialize serial communication at 9600 bits per second:
 Serial.begin(9600);
pwm.begin();
pwm.setPWMFreq(60);
//timer = millis();//start the timer
}
/***********************************************************************/
void setServoPulse(uint8_t n, double pulse) {
 double pulselength;
  
pulselength = 1000000;   // 1,000,000 us per second
pulselength /=60;   // 60 Hz
 //Serial.print(pulselength); Serial.println(" us per period"); 
 pulselength /= 4096;  // 12 bits of resolution
  //Serial.print(pulselength); Serial.println(" us per bit"); 
pulse *= 1000;
pulse /= pulselength;
// Serial.println(pulse);
 pwm.setPWM(n,0,pulse);

}
/**********************************************************************/



// the loop routine runs over and over again forever:
void loop() 
{
  // calibrate during the first five seconds 
 // while (millis() < 5000);
    pwm.setPWM(RLED, 0,4095);
    pwm.setPWM(LLED, 0,4095);
   LEFTsensorValue= analogRead(LEFTsensorPin0);
   
   
//Serial.println(LEFTsensorValue); // the raw analog reading




   RIGHTsensorValue= analogRead(RIGHTsensorPin1);
 //Serial.println(RIGHTsensorValue); // the raw analog reading
   

 
   //  delay(10);



       (LEFTsensorValue>RIGHTsensorValue);
        pwm.setPWM(NECK, 0, NECKPOS);
        delay(50);
        pwm.setPWM(rshoulderX, 0, NECKPOS);
        delay(10);
        pwm.setPWM(LshoulderX, 0, NECKPOS);
        delay(10);
        pwm.setPWM(rshoulderY, 0, NECKPOS);
        delay(10);
        pwm.setPWM(LshoulderY, 0, NECKPOS);
        delay(10);
        pwm.setPWM(Llip, 0, ALTPOS);
        delay(10);
        pwm.setPWM(RULlip, 0, ALTPOS2);
        delay(10);
        pwm.setPWM(LULlip, 0, ALTPOS2);
        delay(10);
         pwm.setPWM(RBrow, 0, ALTPOS2);
        delay(10);
        pwm.setPWM(LBrow, 0, ALTPOS2);
        delay(10);
        pwm.setPWM(RXeye, 0, ALTPOS2);
        delay(10);
        pwm.setPWM(RYeye, 0, ALTPOS);
        delay(10);
         pwm.setPWM(LXeye, 0, ALTPOS2);
        delay(10);
        pwm.setPWM(LYeye, 0, ALTPOS);
        
     
     
     
     
     

   
     
     
       (RIGHTsensorValue>LEFTsensorValue);
       pwm.setPWM(NECK, 0, NECKPOS2);
       delay(10);
        pwm.setPWM(rshoulderX, 0, NECKPOS2);
        delay(10);
        pwm.setPWM(LshoulderX, 0, NECKPOS2);
        delay(10);
        pwm.setPWM(rshoulderY, 0, NECKPOS2);
        delay(10);
        pwm.setPWM(LshoulderY, 0, NECKPOS2);
        delay(10);
        pwm.setPWM(Llip, 0, ALTPOS2);
        delay(10);
        pwm.setPWM(RULlip, 0, ALTPOS);
        delay(10);
        pwm.setPWM(LULlip, 0, ALTPOS);
        delay(10);
         pwm.setPWM(RBrow, 0, ALTPOS);
        delay(10);
        pwm.setPWM(LBrow, 0, ALTPOS);
        delay(10);
        pwm.setPWM(RXeye, 0, ALTPOS);
        delay(10);
        pwm.setPWM(RYeye, 0, ALTPOS2);
        delay(10);
         pwm.setPWM(LXeye, 0, ALTPOS);
        delay(10);
        pwm.setPWM(LYeye, 0, ALTPOS2);
     
     
     
     
} 
//}

Comments

Similar projects you might like

Full Animatronic Sorting Hat With Custom Software -$22

Project tutorial by jegatheesan

  • 13,195 views
  • 12 comments
  • 87 respects

Talking Raven - Animatronic for Halloween

Project showcase by pibyte

  • 5,784 views
  • 2 comments
  • 25 respects

Mini Me 1.5 - Adafruit HUZZAH Robot Doll

Project tutorial by Kitty Yeung

  • 6,310 views
  • 2 comments
  • 30 respects

Programmable Stranger Things Light Wall Costume

Project showcase by Michael Barretta

  • 4,510 views
  • 6 comments
  • 18 respects

Stringent, the $15 Wall Plotter

Project tutorial by Fredrik Stridsman

  • 60,670 views
  • 64 comments
  • 250 respects

Animatronic Tail by Circuito.io

Project showcase by circuito.io team

  • 5,592 views
  • 4 comments
  • 22 respects
Add projectSign up / Login