Introduction: Super Spooky Evil LED Eyes of Doom Using AtTiny85 and Arduino IDE

Picture of Super Spooky Evil LED Eyes of Doom Using AtTiny85 and Arduino IDE

There are a few spooky eye instructables out there. For example, there is one based on a 555 timer, one based on an on/off switch, one based on Arduino, and one based on tape.

I wanted to make a set of spooky evil eyes that met the following criteria:

1. Eyes that fade on and off (pwm)
2. Random duration of eye on and off times without using a pot or other input control to make the effect more realistic
3. Ultra low cost mcu so I can leave it in the decoration without having to re-program or re-insert the mcu.
4. Small controll/power box to make mounting easy

So here is how I did it, and I am pleased with the result.

At any point in this instructable, you will be able to make substitutions to fit your needs or materials on hand. If you like this, vote for it and if there are suggestions, I welcome all ideas to improve it.

Super Spooky Evil Eyes of Doom Using atTiny85 and Arduino IDE from vatosupreme on Vimeo.



Step 1: Spooky Materials and Tools Needed

Picture of Spooky Materials and Tools Needed

Materials:

5 sticks or pieces of wood for the base of the eyeballs
10 ping pong balls - white 
High quality masking tape
Flat black spray paint 
10 Red super-bright LED's
1 atTiny85
Solderable perf board
Screw terminals
20 or 22 Guage Wire
Heat Shrink
Black Silicone
Gel Super Glue
Super Glue Accelerant ---- this stuff is just plain useful. Now you have an excuse to buy some
Vinyl electrical tape -Black
4AA Battery Holder
4 AA Batteries - rechargable if you don't want to use a resistor



Tools:

Razor Knife
Drill & Bit
Wire Strippers
Voltmeter
Staple Gun
Soldering Iron
Arduino
Breadboard & jumper wires
Needle Nose Pliers
3rd Hand

Step 2: Prepare Sticks

Picture of Prepare Sticks

I found some scrap 5/8" OSB (oriented strand board) and cut 5 pieces that were about 3/4" wide, then I cut each piece to a different length between 4" and 8" so that the distance between the eyes would vary.

After cutting, you can spraypaint the sticks.  I sprayed them black to they will blend in earlier in the evening.  I guess you could do green or brown or something also.

***Alternative Build Idea***

You can use pretty much whatever material you want for this as long as it will be relatively weatherproof and allow you to staple into it ( attaching the eyeballs).

Step 3: Making the Spooky Eyballs Part 1 - Drill Hole for the Optic Nerve.

Picture of Making the Spooky Eyballs Part 1 - Drill Hole for the Optic Nerve.

Take your drill and find a bit that is the same size as the LED's you will be using. 
 
Drill a hole in the "back" of the eyeball. 
 
Try to make sure that your hole is perpendicular to the plane of the seam in the ping pong ball so there isn't a line running through the lit part of your eyeball. 
 
Be patient as you drill, if you push too hard, when the material gives way, you can shove the drill bit through the other end of the ping pong ball and ruin it. ( Don't ask me how I know this, just trust me.) 

Safety Tip:  Don't drill while holding the ball in your palm, use something to hold the ball or hold it against some wood, otherwise you could end up creating a very scary zombie hand.

***Alternative Build Idea***
if you wanted a bigger size for the eye, you could use acrylic cutouts and side light them  or use some other bigger size ping pong balls. 

Step 4: Making the Spooky Eyballs Part 2 - Make a Spooky Mask - (get It?).

Picture of Making the Spooky Eyballs Part 2 - Make a Spooky Mask - (get It?).

Now you need to design some spooky eye designs and transfer them to your masking tape.  You will use this to "mask" the spooky eye shape so that it will remain white while the rest of the eye is black allowing only your spooky eye shape to glow. 
 
I just free handed a few eyes that looked spooky: wolf, evil rodent, frog, cat, x girlfriend, etc.,  on the masking tape and used my razor knife to cut the shapes out.   You can search clip art for other ideas on shapes that you like.
 
Next I mounted the masks  on the ping pong balls.  Make sure that you put your mask directly in line with the hole you cut for the LED, otherwise the circle of light from the led may not line up correctly with your eye shape.
 
Make sure to use a plastic pen or credit card or something similar to push down the edges of the tape so paint doesn't crawl under your mask.
 
***Alternative Build Ideas**  
If you had one of those silhouette or other vector based cutter machines you could make perfectly symmetrical eyes and cut them out on a piece of sticky label.  I would still stick the label on the masking tape because it will keep paint off better.
 
I didn't do this because at 3 feet, in the dark, freehand looks pretty good.

Step 5: Paint the Evil Spooky Eyeballs

Picture of Paint the Evil Spooky Eyeballs

After masking your eyeballs, put on some latex free gloves and clean the ping pong balls with some denatured alcohol or Windex or something to get the grease off.
 
Take out the spray paint and give them 2 or 3 coats of flat black paint. 
 
Mount the eyeballs on sticks or something so you can paint the entire eyeball at once.  I painted the back half and then the front and it caused some hassles.
 
Let dry overnight.  DO NOT succumb to the temptation of handling the eyes until the next  day or you will get finger prints on them.
 
When they have dried, you can take your razor knife and peel away your masking tape.
 
Removal of the mask is a fun surprise where you will find out how good you are at masking.  If you had some problems with the paint creeping under the mask like I did, don't worry, just take a black Sharpie and clean up the lines.

Step 6: Solder the LEDs to Your Control Wires

Picture of Solder the LEDs to Your Control Wires

I decided to hook up my LED's in series.  My LED's are 2 volt super bright.  LEDCALC said that I needed a 20 ohm resistor (which I did not use).
 
I clipped the legs off my LED's shorter so they would not get broken. (make sure when you are done the long leg stays longer or figure some way to denote the polarity.  (Don't use a marker!  it makes a big problem with the solder joint.)
 
Remember to put your heat shrink on your wires prior to soldering.

Solder the connections.

Test each pair of eyes to make sure they are working, if not check polarity of each LED and rework if necessary.

Slide the heat shrink over the connection and heat with a lighter.  do this with all 5 sets of wires.

Take some 220 grit or 500 grit sandpaper and sand the LED so that it diffuses the light.
 
****Alternate Build Idea****

You could use green or blue super bright LED's and wire them up in parallel (because in series they requre more voltage than the max allowable voltage on the atTiny85 which is 5.8v) and calculate the resistor needed.  I am not sure how much current the atTiny85 can handle in terms of how many LED's you could run on each pin but hopefully someone out there can enlighten us.

***Update***from what I have learned, the atTiny85 can handle 40mA per pin but a max of 200mA for the whole chip

Step 7: Mount LED's in Back of Eyes and Mount Eyes to Stick

Picture of Mount LED's in Back of Eyes and Mount Eyes to Stick

Power your LED's and dry fit them in the back of the ping pong ball to check and make sure the glowing area is aligned with your masked spooky eye shape.  When you have the LED aligned how you like it, pull the LED out a little and apply some Gel super glue. 
 
The gel super glue is a total rip off but it works way better than even the viscous super glue and  I love it so.... whatever.
 
When you have the LED glued and positioned, hit it with the accelerant and you are ready to go on to the next eye.
 
After you have all the eyes glued, take ten 1" strips of vinyl electrical tape (black) and wrap around where the heat shrink is on the wire - LED junction.  This will help protect the wires from the crown of the staple rubbing against it. 
 
 
Now it is time to mount the eyeballs on the stick..
 
Take one eye and position it where you want it and use a staple gun to staple the wire to the stick.  Give your eyeball a little wiggle room for adjustment. 
 
Repeat with the other eye.
 
After that, I wrapped my wire pair around the stick and stapled them in place.  I did this to act as a strain relief in case the wire gets jerked hard by something. 
 
Next, I took some black silicone caulk and sealed up behind the eyes and over the electrical tape.  This helps keep the weather out and it keeps the light from the bottom and sides of the LEDs from showing. 
 
Finally, take some spray paint and hit the staples and wires to turn them black.
 
 
 
 
 

Step 8: Solder Up Control Board

Picture of Solder Up Control Board

I took a IC holder and soldered each of the pins to some screw terminals so that I could more easily attached the eye wires to the control board.
 
I also added a separate terminal for the battery pack to hook into.

***Battery Note: 
According to the datasheet the atTiny85 can handle 5.8 volts.  I don't really know if it can handle 6v so I used 4 rechargeable AA batteries at 1.2v each so I would be below the 5.8.  If anyone has info that verifies that we can use 4 normal AA at 6v I would like to know.  Alternatively you could use a voltage regulator and a 9v battery


****Battery Update***
calenso gave us a great suggestion in the comments, I wanted to list it here: "
If you want to run from regular AA's and still meet the max voltage, you can insert some regular silicon rectifier diodes (1N4000 series) in the power supply line. Each will drop the voltage 0.6 volts, so, with new AAs at 1.6X4 or 6.4 volts, two diodes would leave your project running at about 5.2 volts.


 
The second photo shows the back of the control board where I did the soldering.  I only had plain perf board; and since I am impatient and did not want to go and pick some up, I am paying the price through community ridicule of  this photo.   I would recommend solderable perf board for better results.

I hooked the ground from the Battery Pack  hookup terminal to pin 4 and continued that to the ground terminal for all the LED's.
 
I hooked the Positive screw terminal to pin 8
 
I then hooked the 5 terminals that control the eyes to pins 2,3,5,6,7  The pinout diagram shows the Arduino pin names. Since the sketch randomly lights up the LED's it doesn't matter the order you wire them.

**Update** Added a schematic so hopefully this will help a little.

Step 9: Connect Eye Wires to Control Board and Hang Up the Spooky Eyes.

Picture of Connect Eye Wires to Control Board and Hang Up the Spooky Eyes.

I used a single ground screw for the eyes and put all those wires into that terminal.  There are 5 positive terminals soldered to the 5 output pins of the atTiny85.  I also added 2 more screw terminals for the battery holder.  I ended up putting a switch between the Positive terminal and pin 8 (+5v)  on the atTiny85 which has proven handy,
 
This method makes the board bigger, but I think it makes the whole thing more useable.
 
After making all the connections, put the control board in a container and you are ready to hang the eyes. 

When hanging the spooky eyes you can use zip ties, wire ties, black tape or whatever.  Try to hang the eyes where they won't get stepped on or tripped over.  I put mine in a tree, or a hedge or a garden bed. 
 
 
***Alternate Build Idea***
 
if you wanted the control box to be real small, you could go with cr2032 battery cells(and holder) and solder all the wires directly to the board
 
 
 
 

Step 10: Spooky Code & Programming the AtTiny85 (45) With the Arduino IDE

Picture of Spooky Code & Programming the AtTiny85 (45) With the Arduino IDE

I will assume you are familiar with the Arduino to handle this project.

Using these atTiny chips was real fun and interesting to learn.

In order to program the atTiny85 there are some great resources out there so I won't repeat them. Here is how I learned how to work with the atTiny85

This tutorial helped a ton. It is from the Hig-low tech lab at mit. http://hlt.media.mit.edu/?p=1695

Another is this video tutorial on makezine http://www.youtube.com/watch?v=30rPt802n1k

My code for this project is a tweeked version of the code for this project. http://www.kobakant.at/DIY/?p=3393
Use the code found here for testing and troubleshooting your setup to make sure everything is working. I used this code after getting frustrated trying to locate a bad solder joint with the randomized code.

Changes I made to the code:
"randomize" the amount of time the lights fade on and stay on. the longer the time, the slower the fadeon is.
"randomize" the pin that turns on each time so that the pattern doesn't discernably repeat.
(see arduino.cc for discussion of limitations to the random() function.)

Here is the Code for the project. I attahced it as a txt as well

I am not an expert programmer, so if anyone has better/more efficient ways to accomplish this, let me know!


********UPDATE 11/10/2013***** This code is designed to run on the internal 8MHz clock so be sure and choose this option when you burn the bootloader and upload the sketch...
See this reference http://hlt.media.mit.edu/?p=1695

***************************************
//--scary lights pwm test v 2.0
//--This code is based on the work of:
/*
Ernst Christensen 16.okt. 2011, taken from >> http://arduino.cc/forum/index.php/topic,75334.0.html
Edited by Hannah March 2012 >> http://www.kobakant.at/DIY/?p=3393
Super Spooky Evil Eyes of Doom Revison by Matt Pearson September 2012 >>instructables.com
*/


int led[]={0,1,2,3,4};
int count=0;
int delayTime = 40;

void setup()//--set all pins to output
{
for (int x=0;x<5;x++){
pinMode(led[x],OUTPUT);
}
}

void spwm(int freq,int spin,int sp){
//--on
digitalWrite(spin,HIGH);
delayMicroseconds(sp*freq);

//--off
digitalWrite(spin,LOW);
delayMicroseconds(sp*(255-freq));
} //spwm




void loop()
{
delayTime= random(3,80);// Set values between 2 and 80 -- How long LED stays on
count= (random(0,5));

// Fading On--
for (int x=1;x<254;x++)
{
spwm(x,led[count],delayTime);
}

//--Fading Off
for(int x=254;x>1;x--)
{
spwm(x,led[count],4);
//--the last argument can be "delayTime" variable if you want to fade out same way as you faded on.
//--Setting it to 1 or 2 turns off lights real fast like the eyelid is closing
}
count= random(0,2);

delay(random(100,9000));//--- amount of time leds are OFF before next eye turns on 9 seconds is pretty long but makes it harder to locate the eyes


}

Comments

strykeroz (author)2012-10-25

Thanks so much for this. I've added a 7805 5V regulator into the mix and put a 3mm power indicator LED on the outside of the enclosure as a slight modification. It's all pretty much ready to go but for the glue to hold the eyes in place on the LEDs...something to pick up tomorrow. Since I didn't have screw terminals I've used 5x 2.1mm DC jacks on the outside of the box. For a fine wire I've scavenged the cores from some phone lead I had laying about. I'm very impressed with how well the ping pong balls diffuse the red LEDs. Unfortunately my masking is far from optimal, but as you suggest at a distance, and at night it's all good. I can't thank you enough for this inspirational build.

There's going to be quite a few ATTiny85s in our front yard next week...this put yet another to good use : )

vatosupreme (author)strykeroz2012-10-26

Cool mods, post video or photos when you get this running.

acesoft (author)2012-10-29

Awesome instructable! I really enjoyed this project. Completed just in time for Halloween too. I had to make lots of changes do to parts on hand but I'm pleased with the results. I cheated and used some plastic pre-painted eyeballs I found at the dollar store and I only had white led's but the effect is pretty good with the eyeball's red veins. I wanted to run off a cheap 9v wall wart that I had but didn't have any 7805's so I used an LM317 to bring the voltage down to 5.2. Wired in parallel my led's draw 20 ma with 100 ohm resistors and are nice and bright. With the added current limiting resistors and the necessary regulator parts, I decided to etch a board. The board is not a work of art, just drawn quickly with a sharpy but it really saved a lot of time. If anyone's interested, I'll post a pic of the traces, after Halloween though. My one change for next year will be to reduce the max random delay between blinks. The viewing angle for my location is narrow so you don't have a lot of time to see many blinks in passing. I could quickly reprogram but my controller is securely wrapped in a sandwich baggie. Thanks again for the cool project.

vatosupreme (author)acesoft2012-10-29

Thanks, I'm so glad it worked out well
Please post photos of the project and the board.

acesoft (author)vatosupreme2012-11-04

The Eyes were a hit even though the remnants of hurricane Sandy lessened the number of Trick or Treaters. Here's a few picks of my project. Be kind, it was a rush job.

I3L4ck5h33p (author)acesoft2014-11-16

do you recall the part number for the green terminals you used?

acesoft (author)I3L4ck5h33p2014-11-16

I'm not sure of the model No. but I had a stock of those from ActiveTech: http://www.active123.com/TERMINAL-BLOCKSSTRIPS-1-P...

You can get them off of Ebay too, just do a search for pcb terminals.

I3L4ck5h33p (author)acesoft2014-11-16

looks great

vatosupreme (author)acesoft2012-11-04

Looks great!

arduinoamature (author)2013-11-10

I've been looking for something like this. When the ATTiny 85 is programmed the LEDs blink very rapidly before they are on solid. Any idea why? I'm using 9volt battery with a 7805 5v regulator.

I think you may have chosen the wrong board possibly when you burned the bootloader or updated the program. This code is set to run at the internal 8MHz clock.

See this and try again.... I hope this helps

http://hlt.media.mit.edu/?p=1695

load_nikon (author)2013-10-25

Excellent, thank you! I just did this sans atTiny85 for a haunted truck at a trunk or treat. Won 2nd place and still have a prop for actual halloween. I just used the 'duino straight up but I'll be ordering the atTiny shortly so I don't waste the 'duino on a yard ornament.

benfriesen (author)2012-10-28

Hello,

I have just started with arduino and I used the given code and I'm getting 2 errors. They are: sketch_oct28a.cpp: In function 'void loop()': and
sketch_oct28a:53: error: expected `}' at end of input.

Any suggestions? Thanks

vatosupreme (author)benfriesen2012-10-28

I'm guessing you missed the last '}' at the end of the void loop.

Try to add one at the very end of the sketch or try downloading the txt file and do a ctrl a and pasting it into the Arduio IDE.

Hope that works

rwohleb (author)2012-10-23

Some microcontrollers can sink more current than they can source. In this case, it looks like the ATtiny85 has a symmetric driver so it's not an issue.

If you are worried about current on the microcontroller it would be really simple to add a few cheap transistors to your output pins. A darlington array (ie. ULN2803) will work, and they have them at SparkFun.

If you want to take advantage of the two hardware PWM pins (according to spec sheet) you'll need to multiplex the connections to the multiple LEDs. There are various mux chips (ie 74HC4052) available, and they have some at SparkFun.

I don't work for SparkFun. I'm just a fan :)

HP_II (author)2012-10-21

Very Cool, I want to try this!

vatosupreme (author)HP_II2012-10-23

Awesome, If you do, post a video.

calenso (author)2012-10-21

Hi I like your project. If you want to run from regular AA's and still meet the max voltage, you can insert some regular silicon rectifier diodes (1N4000 series) in the power supply line. Each will drop the voltage 0.6 volts, so, with new AAs at 1.6X4 or 6.4 volts, two diodes would leave your project running at about 5.2 volts.

masynmachien (author)calenso2012-10-23

yes, very nice project; Got my vote.
You can also replace one of the AA batteries with some conducting part. I mostly use a bolt of the right length.

vatosupreme (author)calenso2012-10-22

Thanks for the suggestion, I will add it in !

kshowell (author)2012-10-21

Nice project. I wanted to try the Attiny on something thank you for the work.

SashaDensikoff (author)2012-10-21

What if instead of just glowing shaped eye sockets, you just blocked out the pupil part, so the rest of the "iris" part would be glowing. Might want to block the back part of the eye though.
This would make the eyes appear larger, (ping pong balls are small) as while the eyes you made there are cool, their shape doesn't seem to stand out well at a distance (like in the vid) and just look like fairy lights.
If you mean them for close up decoration, then they'll be fine!
Also, when people/animals/er....monsters blink, it's usually faster, not fading in and out.
Otherwise, I'm totally loving this idea, even though the means to make it is totally beyond me, lol!
They're pretty freaky, I'll grant ya!

Yeah, one of the things I love about this site is you find out that there are lots of mods to your project you haden't thought of. This size of eye works up to about 18-20 ft. of distance from the viewer in terms of being able to discern the different eye shapes. It took me 2 hours of trying to get the video clearer but the video doesn't do it justice.

With the blinking, I wanted the stylized version of the eyes. If you wanted them to just blink on and off you can adapt the code. This is why I love using a micro controller versus just a 555 timer. You can change the code daily if you wanted without having to re-wire.

If you make one, post it, I am excited to see what people come up with!

scotth61 (author)2012-10-21

Very cool. Could it be made to have multiple sets of eyes show at the same time?

vatosupreme (author)scotth612012-10-21

from what I have learned, the atTiny85 can handle 40mA per pin but a max of 200mA for the whole chip so with this setup you should be able to have 2 sets of eyes on at the same time and not burn it up.

I am not sure how to modify the pwm code to allow 2 sets of lights to fade on at once but it is worth a try.

You can easily change the code to just turn multiple pins on HIGH at the same time.

antennas (author)2012-10-20

Very neat idea. Can you add a schematic to the instructable? It's not really required but may help. I initially thought I needed an ATiny for each pair of eyes but I see it ran all 5 sets. Cool. I will make this to go with my flaming pumpkin.

vatosupreme (author)antennas2012-10-21

Thanks,

I just posted a schematic on step 8 that should make this more clear.

paulpaulpaulpaul (author)2012-10-19

Cool idea :) How is the spray paint adhering to the ping pong balls?

Could you use that vinyl dye paint thats made for plastics?

I haven't tried that vinyl dye paint, so I can't say for sure, but it's worth a shot! The regular matte black spray paint is working well so far.

Best_kg_Market (author)2012-10-19

mmm.... INTERESTING!!!!!!!!!!!

About This Instructable

34,180views

91favorites

License:

More by vatosupreme:Super Spooky Evil LED Eyes of Doom Using AtTiny85 and Arduino IDEHow to Make a Cardboard Canoe for your Kids in the PoolFire & Ice: or How to Unfreeze Your Water Meter (& How to Keep It From Freezing in the Future)
Add instructable to: