Project tutorial
Arduino Darkness Activated Ghost

Arduino Darkness Activated Ghost © GPL3+

Ever wondered if you could build a device to scare your friends? Well here you have transform your room into a haunted house.

  • 2,179 views
  • 2 comments
  • 12 respects

Components and supplies

A000066 iso both
Arduino UNO & Genuino UNO
×1
12002 04
Breadboard (generic)
×1
11026 02
Jumper wires (generic)
×1
Keystone 233 image 75px
9V Battery Clip
×1
Rg light a
RobotGeek Light Sensor
We used a photo resistor, also know as a LDR ( Light Dependent Resistor ), i would recommend this as its cheaper and serves the purpose.
×1
Tens70
9V battery (generic)
×1

Necessary tools and machines

Lasercutter
Laser cutter (generic)
09507 01
Soldering iron (generic)
Hy gluegun
Hot glue gun (generic)

Apps and online services

About this project

Ever wondered if we could scare our friends in the dark and have a good laugh? Ever wondered if we could create a simple artificial ghost and haunt your house?!

Well here is a system that we devised that does exactly so, the system uses an Arduino and the code and schematics were created with Circuito.io ( a fun and easy software that creates the founding blocks of you projects, great for beginners, do check it out! ). Follow on to see how our ''Ghost'' works and how we made it!

This idea came up with the often occurring fear of Darkness! Our system works with the help of a light sensor, which detects the light intensity in the room. Using this the program gets activated when the lights are put off at night, in other words when it's completely dark. We then cleverly recorded and manipulated are voices to make it sound like a ghost. If the person who is pranked turns on the light scared the voice immediately stops. Giving the effect as though there is a real ghost in the room, giving it a haunted feeling and making you roll with laughter as you see your friend freak out!!!

MECHANISM

We made the device portable and small so that it can fit in any small hiding place in your house. We decided to hide it in a book, more of that in the next steps. As we didn't have an Arduino audio shield, we hacked our smartphone to fit into our device. We figure that we needed to click on two buttons, the ''Play'' and the ''Skip''. To do this we used servo motors having tips wrapped in foil, which clicks on the screen either playing or skipping the audio clips. All of the components were mounted on a custom laser cut part that we modeled.

LET'S GET MAKING!

Materials Needed:

  • LDR ( Photo resistor)
  • 9 volt battery + clip
  • Jumper wire
  • 2 x rubber bands
  • And your smartphone!

Assembling the system:

Start by getting the laser-cutting file cut,( though keep in mind that it needs to fit your smartphone) you will need to make few adjustments. Once done peel the protective layer.

Squirt out dabs of hot glue around the servo, making sure that the horns touch the required buttons. Stick both of them firmly in place, you can then move and with the switch and stick the Arduino UNO with a strip of double sided tape. (Follow the pictures to better understand the arrangement).

MAKING THE ALUMINIUM TABS:

Take the leftover pieces of acrylic from the slot and break it into two small tabs. Wrap them with foil and connect arduino's ground pin to it, imitating them to act like your fingers and the touch screen

Wire them all up, hooking up the servo motors to the Arduino with jumper wires. Follow the schematics.

THE AUDIO RECORDINGS:

This is one of the most fun parts, it's when your ghost comes to life. Record some spooky ghost lines and be creative in making it scary with sound effects! Then upload the clips to your smartphone in the right sequence and you are nearly done!

YOU'RE DONE!

We had made this cut out book a while back and found it a perfect object to conceal the system. Try and find a none obvious hiding spot or an object like a pot or an old regulator case, etc...

You are ready, wait till evening and prank your friend by slipping in your smartphone and clicking a switch! This spooked us out to even though we made it. It got us hilarious results and we feel it definitely does give a shiver!

Well here you have it a Darkness Activated Ghost. Hope you enjoyed : )

Happy making, cheers!

Code

arduino_scare_pank.inoC/C++
Now upload the code onto the system. Basically the program goes as per the light intensity if it is dark the ghost audio clip starts playing, and if the light turns on it stops.
#include <Servo.h>
Servo servo1;
Servo servo2;
int pos1 = 0;
int pos2 = 0;

int ldr = A0;
int sensor_value = 0;
int thresh = 150;
bool state = false;

void play(){
   for (pos1 = 0; pos1 <= 180; pos1 += 1) { // goes from 0 degrees to 180 degrees
    // in steps of 1 degree
    myservo.write(pos);              // tell servo to go to position in variable 'pos'
    delay(15);                       // waits 15ms for the servo to reach the position
  }
  for (pos1 = 180; pos1 >= 0; pos1 -= 1) { // goes from 180 degrees to 0 degrees
    myservo.write(pos);              // tell servo to go to position in variable 'pos'
    delay(15);                       // waits 15ms for the servo to reach the position
  }
   while(true);
}

void next_clip(){
   for (pos2 = 0; pos2 <= 180; pos2 += 1) { // goes from 0 degrees to 180 degrees
    // in steps of 1 degree
    myservo.write(pos);              // tell servo to go to position in variable 'pos'
    delay(15);                       // waits 15ms for the servo to reach the position
  }
  for (pos2 = 180; pos2 >= 0; pos2 -= 1) { // goes from 180 degrees to 0 degrees
    myservo.write(pos);              // tell servo to go to position in variable 'pos'
    delay(15);                       // waits 15ms for the servo to reach the position
  }
   while(true);
}

void setup() {
  // put your setup code here, to run once:
servo1.attach(7);
servo2.attach(8);
Serial.begin(9600);     //for debugging only

}

void loop() {
  // put your main code here, to run repeatedly:
sensor_value = analogRead(ldr);

//the moment lights go off the first clip starts to play
if (sensor_value < thresh){
  play();
  state = true;
  
}

//once the victim is scared and tries to turn on the lights. play next clip
else if(sensor_value > thresh && state == true){
  next_clip();
  play();
  state = false;
}

//do nothing
}

Schematics

circuitio schematics
Photo eqglwcbpie

Comments

Similar projects you might like

No Candy For YOU!

Project tutorial by Jonathan Tindal

  • 908 views
  • 5 comments
  • 6 respects

Pranked! Moving Tissue Box | Circuito.io

Project tutorial by Arduino “having11” Guy

  • 4,476 views
  • 1 comment
  • 19 respects

The Troll Switch

Project tutorial by Aitor Gamarra

  • 1,159 views
  • 2 comments
  • 2 respects

Voice Activated STEM Learning Robot

Project in progress by Team MemoSTEAM

  • 1,086 views
  • 3 comments
  • 9 respects

Motion Activated Night Light

Project tutorial by Haziq Afandi

  • 3,538 views
  • 0 comments
  • 4 respects

Magic Projector (A Romantic One)

Project tutorial by Arturo Rosete

  • 1,482 views
  • 1 comment
  • 7 respects
Add projectSign up / Login