Introduction: Halloween Scary Eyes Prop

Over the years, in making various projects, there was a

whole collection of different modules that were just lying around unused and I wanted to use at-least some of them for something that would be fun and creative at the same time.

Going through the “instructables.com Site” for Ideas, I chanced upon a few projects which I thought could be mixed up together to make something for this “Halloween”.

I have to give credit to Steve Quinn, Unexpected Maker for using their ideas.

Supplies

ITEMS AND MODULES USED

Modules Used

1 Stand alone Atmega8 Board

2 PIR Based Controller Board for 5 Volt Output

3 LM386 Amplifier Board

4 Generic MP3 Player Module

5 MAX7219 8x8 LED Modules

6 PIR Module (Generic)

7 4” 4 Ohm Speaker

Other Materials

a. Empty Cardboard Box

b. Empty Single Use Water Bottles

c. Colour Changing LED 5V

d. Assorted Wires

e. Glue Gun

f. Soldering Iron

g. Sundry Tools & Cutters

h. 12V 1A step Down Transformer

Important

1 Arduion IDE

2 Programming Board for AVR Chips

3 Programming (Burning) Software

Step 1: The Different Modules

First, we will look into making the different modules, We

could certainly make just one PCB for all the electronics and have the project working just fine but, for me, the idea was to use the different items that I had already made earlier for different projects and now that the need for them was over, I just wanted to re-use those items.

The ATmega8 Board.

I am using the ATmega8 chip without any external crystal. Actually, these boards were made to run some P10 16x32 LED Modules and I had a few left over from this project. The Picture of the board and the PCB Layout is as follows (See Pictures). There are innumerous articles on making your own Arduino Board on “instructables”. You could simply use any old Arduino Board that you might have lying around.

PIR Controller Board.

This PIR Board was made to turn On & Off some small LED Based festival decorations and now it was just lying around and I decided to put it to use. The Circuit Layout is shown in the pictures

THE LM 386 Amplifier Board

This is the amplifier module that amplifies the sound output from the MP3 Player Module. the layout and circuit is fairly simple and the pictures say it all. the Circuit layout and the picture of the completed board is self explanatory.

The MP3 Player Module

I have used the MP3 Player Module shown in the picture. Its readily available on Amazon etc., it’s cheap and easy to use. The best part about this particular module is that it does not require any additional command or connection to start playing. The moment the appropriate power is supplied to the board, it starts doing it's job.

MAX7219 8x8 LED Modules

These 8x8 LED Display Modules are readily available on Amazon etc. pictures of the ones I used are provided.

PIR Module

I have used the readily available PIR Sensor Module. It’s available on Amazon etc., it’s cheap and easy to use. The pictures are provided for reference.

Step 2: The Assembly Part 1

The Concept was to combine all these modules and make a Halloween Prop that would get activated whenever someone crosses in front of the prop. For this, I connected the 12volt power supply to the PIR Control Board, which in turn stepped the voltage down to 5V DC with the help of the 7805 IC and this 5V DC Voltage was passed on to the PIR Sensor and further to the other modules, the ATmega8 Board, the Amplifier Module and the MP3 Player Module whenever someone came in front of the PIR Sensor. The Flow Chart says it all.

As we can see, the PIR Sensor triggers the ATmega8 Board,
the Amplifier Module and the MP3 Player Module, the ATmega8 controls the LED Matrix “Eyes”, the MP3 Player plays out the sound effects and the Amplifier module sends the signal to the speaker.

The Arduino Code is a direct lift off from Steve Quinn’s instructable, except that the time has been altered in the code. The code used is given below. The INO file is also attached.

The Code

// D10 = Digital O/P CS Pin

// D11 = Digital O/P Clock Pin

// D12 = Digital O/P Data Pin

//

#include

#include

const int numDevices = 2; // number of MAX7219s used

const int dataPin = 12;

const int clkPin = 11;

const int csPin = 10;

LedControl lc = LedControl(dataPin, clkPin, csPin, numDevices);

// Drop this code into Arduino development environment

#define LeftEye1 0

#define RightEye1 1

#define LeftEye2 2

#define RightEye2 3

#define LeftEye3 4

#define RightEye3 5

#define LeftEye4 6

#define RightEye4 7

#define LeftEye5 8

#define RightEye5 9

#define LeftEye6 10

#define RightEye6 11

#define LeftEye7 12

#define RightEye7 13

#define LeftEye8 14

#define RightEye8 15

#define LeftEye9 16

#define RightEye9 17

#define LeftEye10 18

#define RightEye10 19

#define LeftEye11 20

#define RightEye11 21

#define LeftEye12 22

#define RightEye12 23

#define LeftEye13 24

#define RightEye13 25

#define LeftEye14 26

#define RightEye14 27

#define LeftEye15 28

#define RightEye15 29

#define LeftEye16 30

#define RightEye16 31

#define LeftEye17 32

#define RightEye17 33

#define LeftEye18 34

#define RightEye18 35

#define LeftEye19 36

#define RightEye19 37

#define LeftEye20 38

#define RightEye20 39

typedef struct {

const unsigned char array1[8];

}

binaryArrayType;

binaryArrayType binaryArray[40] =

{

{ // LeftEye1, 0

B01111110,

B10000001,

B10000001,

B10011001,

B10011001,

B10000001,

B10000001,

B01111110

},

{ // RightEye1, 1

B01111110,

B10000001,

B10000001,

B10011001,

B10011001,

B10000001,

B10000001,

B01111110

},

{ // LeftEye2, 2

B00000000,

B00111100,

B01000010,

B01011010,

B01011010,

B01000010,

B00111100,

B00000000

},

{ // RightEye2, 3

B00000000,

B00111100,

B01000010,

B01011010,

B01011010,

B01000010,

B00111100,

B00000000

},

{ // LeftEye3, 4

B00000000,

B00111100,

B00100100,

B00110100,

B00110100,

B00100100,

B00111100,

B00000000

},

{ // RightEye3, 5

B00000000,

B00111100,

B00100100,

B00110100,

B00110100,

B00100100,

B00111100,

B00000000

},

{ // LeftEye4, 6

B00011000,

B00011000,

B00011000,

B00011000,

B00011000,

B00011000,

B00011000,

B00000000

},

{ // RightEye4, 7

B00000000,

B00011000,

B00011000,

B00011000,

B00011000,

B00011000,

B00011000,

B00011000

},

{ // LeftEye5, 8

B01111110,

B10000001,

B10000001,

B10011001,

B10011001,

B10000001,

B10000010,

B01111100

},

{ // RightEye5, 9

B01111100,

B10000010,

B10000001,

B10011001,

B10011001,

B10000001,

B10000001,

B01111110

},

{ // LeftEye6, 10

B01111110,

B10000001,

B10000001,

B10011001,

B10011001,

B10000010,

B10000100,

B01111000

},

{ // RightEye6, 11

B01111000,

B10000100,

B10000010,

B10011001,

B10011001,

B10000001,

B10000001,

B01111110

},

{ // LeftEye7, 12

B01111110,

B11000001,

B10000001,

B10011001,

B10011010,

B10000100,

B10001000,

B01110000

},

{ // RightEye7, 13

B01110000,

B10001000,

B10000100,

B10011010,

B10011001,

B10000001,

B11000001,

B01111110

},

{ // LeftEye8, 14

B00111110,

B01000001,

B10000001,

B10011001,

B10011010,

B10000100,

B01001000,

B00110000

},

{ // RightEye8, 15

B00110000,

B01001000,

B10000100,

B10011010,

B10011001,

B10000001,

B01000001,

B00111110

},

{ // LeftEye9, 16

B01111110,

B10000001,

B10000001,

B10011001,

B10011001,

B10000001,

B10000001,

B01111110

},

{ // RightEye9, 17

B01111110,

B10000001,

B10000001,

B10011001,

B10011001,

B10000001,

B10000001,

B01111110

},

{ // LeftEye10, 18

B01111110,

B10000001,

B10000001,

B10000001,

B10011001,

B10011001,

B10000001,

B01111110

},

{ // RightEye10, 19

B01111110,

B10000001,

B10000001,

B10000001,

B10011001,

B10011001,

B10000001,

B01111110

},

{ // LeftEye11, 20

B01111110,

B10000001,

B10000001,

B10000001,

B10011001,

B10011001,

B10000001,

B01111110

},

{ // RightEye11, 21

B01111110,

B10000001,

B10000001,

B10000001,

B10011001,

B10011001,

B10000001,

B01111110

},

{ // LeftEye12, 22

B01111110,

B10000001,

B10000001,

B10000001,

B10000001,

B10011001,

B10011001,

B01111110

},

{ // RightEye12, 23

B01111110,

B10000001,

B10000001,

B10000001,

B10000001,

B10011001,

B10011001,

B01111110

},

{ // LeftEye13, 24

B01111110,

B10000001,

B10000001,

B10000001,

B10000001,

B10000001,

B10011001,

B01111110

},

{ // RightEye13, 25

B01111110,

B10000001,

B10000001,

B10000001,

B10000001,

B10000001,

B10011001,

B01111110

},

{ // LeftEye14, 26

B00000000,

B00111100,

B01000010,

B01000010,

B01000010,

B01011010,

B00111100,

B00000000

},

{ // RightEye14, 27

B00000000,

B00111100,

B01000010,

B01000010,

B01000010,

B01011010,

B00111100,

B00000000

},

{ // LeftEye15, 28

B00000000,

B00111100,

B00100100,

B00100100,

B00100100,

B00111100,

B00111100,

B00000000

},

{ // RightEye15, 29

B00000000,

B00111100,

B00100100,

B00100100,

B00100100,

B00111100,

B00111100,

B00000000

},

{ // LeftEye16, 30

B00011000,

B00011000,

B00011000,

B00011000,

B00011000,

B00011000,

B00011000,

B00000000

},

{ // RightEye16, 31

B00000000,

B00011000,

B00011000,

B00011000,

B00011000,

B00011000,

B00011000,

B00011000

},

{ // LeftEye17, 32

B00010000,

B00010000,

B00010000,

B00010000,

B00010000,

B00010000,

B00010000,

B00000000

},

{ // RightEye17, 33

B00000000,

B00010000,

B00010000,

B00010000,

B00010000,

B00010000,

B00010000,

B00010000

},

{ // LeftEye18, 34

B01111110,

B10000001,

B10000001,

B10000001,

B10000001,

B10000001,

B10001101,

B01111110

},

{ // RightEye18, 35

B01111110,

B10000001,

B10000001,

B10000001,

B10000001,

B10000001,

B10001101,

B01111110

},

{ // LeftEye19, 36

B01111110,

B10000001,

B10000001,

B10000001,

B10000001,

B10000001,

B10000111,

B01111110

},

{ // RightEye19, 37

B01111110,

B10000001,

B10000001,

B10000001,

B10000001,

B10000001,

B10000111,

B01111110

},

{ // LeftEye20, 38

B01111110,

B10000001,

B10000001,

B10000001,

B10000001,

B10000011,

B10000011,

B01111110

},

{ // RightEye20, 39

B01111110,

B10000001,

B10000001,

B10000001,

B10000001,

B10000011,

B10000011,

B01111110

}

};

typedef struct {

int frameCount; // index pointer into binaryArray signifying animation frame

int frameDelay; // Approx delay in MilliSeconds to hold display this animated frame

int frameLuminance; // 0 ... 15, The intensity of the led matrix for a given frame

} frameType;

frameType movie[] =

{

// Blink

{LeftEye1, 1000, 1}, {LeftEye2, 5, 1}, {LeftEye3, 10, 1}, {LeftEye4, 10, 1}, {LeftEye17, 100, 1}, {LeftEye4, 10, 1}, {LeftEye3, 10, 1}, {LeftEye2, 5, 1},

// Full wide again

{LeftEye1, 1500, 2},

// Frown

{LeftEye5, 5, 3}, {LeftEye6, 5, 4}, {LeftEye7, 5, 5}, {LeftEye8, 1000, 11}, {LeftEye7, 5, 5}, {LeftEye6, 5, 4}, {LeftEye5, 5, 3}

};

void delayMillis(int milliseconds)

{

for (int i = 0; i < milliseconds; i++)

delayMicroseconds(1000);

}

void setup() {

for (int x = 0; x < numDevices; x++) {

lc.shutdown(x, false); //The MAX72XX is in power-saving mode on startup

lc.setIntensity(x, 1); // Set the brightness to default value

lc.clearDisplay(x); // and clear the display

}

}

void loop() {

lc.setIntensity(0, 3);

lc.setIntensity(1, 3);

while (true) {

for (int a = 0; a < (sizeof(movie) / sizeof(frameType)); a++)

{

for (int i = 0; i < 8; i++)

{

lc.setRow(0, i, binaryArray[movie[a].frameCount].array1[i]);

lc.setRow(1, i, binaryArray[movie[a].frameCount + 1].array1[i]);

lc.setIntensity(0, movie[a].frameLuminance);

lc.setIntensity(1, movie[a].frameLuminance);

}

delayMillis(movie[a].frameDelay);

}

}

}

Step 3: Assembly Part 2

Once you have the Arduino IDE up and running, you need to copy the code and compile/verify the code. When you compile the code, the HEX file is created in the TEMP folder of the computer. Before closing the Arduino IDE, you can copy the HEX file from the temp folder and this file is what we need to burn into the ATmega8 Chip to make it work.

While compiling the code, I have chosen the board as” Arduino NG or Older” and processor as “ATmega8” and after compiling, I copied the HEX file from the Temp Folder of the computer, before closing the Arduino IDE.

This HEX file was burnt onto the ATmega8 Chip with an external AVR Burner. I used the “Extreme Burner_AVR” software and an AVR Burner Board for the purpose. The picture of the board is attached. You can use any AVR programming software that you are comfortable with.

The reason for using an external programmer was that I did not want to burn the bootloader onto the Atmega8 chips and without the bootloader, they would not work on the regular Arduino Board or with the Arduion IDE. It's quite easy to extract the HEX files once you compile the code with the Arduino IDE and thats what I did.

NOTE

IT IS VERY IMPORTANT to choose the correct fuse bit settings while using an external programmer.

In this case, since we are not using am external crystal and relying upon the internal clock of the ATmega8 Chip, it is important that we configure the fuse bits accordingly. I have chosen the following fuse settings.

Lfuse- E4

Hfuse - D9

WHAT THIS MEANS

Means we are not using external crystal or resonator

The clock is set to 8mHz internal clock

Once the ATmega8 Chip was programmed, it was time to assemble the project and test it out.

Step 4: Connecting THE Eyes

The MAX7219 8x8 LED Matrix was connected as below.

ATmega8 Board TO MAX7219 Matrix

IO Pin D10 TO CS PIN

IO Pin D11 TO CLK PIN

IO Pin D12 TO DIN PIN

VCC TO VCC

GND TO GND

Refer to Picture

Step 5: Connecting the PIR Sensor & Module

Next the PIR Sensor was connected to the PIR Controller

Board, the connections are as follows

PIR Controller Board to PIR Sensor

VCC to VCC

CTRL to CTRL

GND to GND

Refer to Diagram

This is the part that makes it all happen. The PIR Sensor picks up the movement of any hot blooded creature and switches on the power supply to all the different circuits/modules. the time on the PIR Sensor has been adjusted as per the requirement and tn this case it is about 40 - 45 seconds. It sends 5 volts DC to all the circuits attached to it for a period of about 40 -45 seconds.

Step 6: The MP3 Player and the Amplifier

NEXT the MP3 Player Module and the Amplifier Module.

The MP3 Player I used does not need any button to be pressed to turn on, the moment the proper voltage is supplied to it, it automatically starts playing. I needed only one track so I found the SD card with the lowest memory I could (4 GB because it’s almost impossible to get any card with lesser capacity these days). The sounds I downloaded from the internet, in fact there were a number of sound effects that were downloaded and they were all compiled to make a single MP3 track by using the sound editor software. I used “Wave Editor” and finally loaded this only track to the SD Card. The SD Card was mounted in the MP3 Player Module and the output was connected to the Amplifier Module to get the sound from the speaker.

Refer to Picture

The LM386 Amplifier Chip requires very few external components and delivers fairly good sound out of small speakers. The circuit is quite easy to assemble of a perfboard and it took me about 15-20 minutes to assemble this one. The picture is quite self explanatory.

Step 7: The Final Assembly

Before fitting everything in the enclosure, I wanted to test everything and laid-out the modules as required and made the final connections. After I was satisfied with the working of the parts. I fixed them inside the Card Board Enclosure made for the purpose.

I am attaching a video after the final assembly of the prop.

Step 8: THE ENCLOSURE

The Enclosure

The Enclosure was made out of an old card board box, painted red. The place for the eyes and PIR sensor was cut out using a sharp blade. A print out of the skull was pasted on the box and the eyes etc. cut out accordingly and the outline was re-drawn with a black Permanent Marker pen. I made the hair out of discarded water bottles, cut them into thin strips and pasted them with the Hot Melt Glue on the head and the sides. I fixed 2 colour changing LEDs on the sides and these were connected to the out-put from the PIR controller board.

Small holes were made for the speaker and all the items were fixed with the help of Hot Melt Glue on the inside of the box. The power cord was taken out of the back of the box and that’s about it.

I hope you enjoy making this Halloween Prop for the kids !!

I'll be attaching the Audio Clip used in this project soon.

Happy Halloween to All !!