This is a motion activated prop that you can place anywhere with a wall outlet.
It will light up with the black light and the PIR sensor with the arduino will trigger the relay to turn the light on.
Step 1: Electronic Mechanism
Make the relay module I used 2 terminals and connected them to the contacts of the relay. One terminal goes to the normally open and common pin of the relay and the second terminal goes to the coil of the relay. Connect the coil's terminal to the arduino's digital pin 1 and GND. Connect the switch terminal to one wire of the extension cord.
Connect the blacklight to the output of the extension cord.
The PIR sensor's pins, the 5v+ supply goes to the 5v or the pin 13 on the arduino, the output goes to the arduino's pin 12, connect the GND to the GND of the arduino.
Connect the power adapter to the arduino.
Step 2: Prop Ghost
You will need
- Camera tripod
- White cloth
- Scary white mask
This is fairly easy to make, you will put the cloth on top of the tripod and the mask strapped to the top of the tripod. You can make a mask using a fullface paper mask and paint them.
Step 3: Coding
int VCC = 13; // VCC is connected to digital pin 13
int ledPin = 1; // LED connected to digital pin 1 int inPin = 12; // pushbutton connected to digital pin 12 int val = 0; // variable to store the read value
pinMode(VCC, OUTPUT); // sets the digital pin 13 as output
pinMode(ledPin, OUTPUT); // sets the digital pin 1 as output
pinMode(inPin, INPUT); // sets the digital pin 12 as input
digitalWrite(VCC, HIGH); // sets VCC HIGH
val = digitalRead(inPin); // read the input pin
digitalWrite(ledPin, val); // sets the LED to the OUT pin value
Step 4: Setup
Hide your setup in a convenient place that there is no water or moisture that will break the arduino and cause some damage.