Moving Eyes Project

moving eyes cover

Task: To programatically control a mechanism
Difficulty: Intermediate

For this project you will need:

  • One Crumble with USB lead;
  • A computer with the Crumble software installed;
  • A battery box  with batteries (not rechargeable);
  • 5 croc-leads;
  • A servo with crumbliser;
  • ‘Painting’
  • Cardboard box around the size of your painting/picture;
  • Piece of card that is at least 6cm bigger than your painting;
  • paperclip or strong wire;
  • Craft knife;
  • Paint, palette and brush;
  • Glue gun and glue;
  • Scissors

You may also need other alternative craft resources not mentioned above.

1 Gather all of your materials together.

2 Carefully cut along the edges of the painting.

3 Measure the width and height of your picture.

P1020311

4 Draw a frame around the painting. Your measurements will help.

P1020316

5 Then draw a new line 1cm inside of your frame, and cut it out.

P1020318

6 You should now have a frame that covers 1cm of your painting (4cm thick).

P1020322

7 With your knife, carefully cut around the eyes.

P1020325

8 Hopefully your painting looks as creepy as ours!

P1020328

9 Place the picture onto the box and draw around the eyes.

P1020332

10 Now, using the knife, make the eye cutouts.

P1020336

11 Cover your box in glue!

P1020338

12 Stick the picture onto the box.

P1020341

13 Measure and cut out a 10x2cm oblong.

P1020342

14 Do the same on a scrap piece of paper.

P1020344

15 Glue them together, so that they are one piece.

P1020354

16 Place the card behind the eyes (white side down), and trace around it, so you know where it goes again.

P1020345

17 Now hold the card behind the eyes of the picture, and mark where the pupils will go.

P1020349

18 Remove the card and fill in the pupils – make them look scary!

P1020353

19 Yellow the eyes a bit, and make them bloodshot.

P1020360

20 Pierce a hole in the end of ‘eye piece’.

P1020355

21 Cut out some small pieces of card, for supports.

P1020357

22 Stick the supports to hold the ‘eye piece’ in place.

P1020358

23 Fold a piece of card and use it as a guide rail.

P1020364

24 Bend the paper clip like this, and hook it onto the eye piece.

25 Attach it to the servo, and stick the servo into place. Make sure the servo can move backwards and forwards enough, to make the eye movement work.

26 If you want, you can draw a design onto the frame, and use a the glue gun to ’emboss’ it.

27 It doesn’t have to be perfect – it will just add a bit more authenticity and character to the piece!

P1020377

28 Paint over your frame – we have used gold.

P1020380

29 To age the frame, mix in a bit black with your chosen colour.

P1020382

30 Brush small amounts over the wet frame. It should hopefully catch onto all of the nooks and crannies.

P1020385

31 When your frame is dry (you may need to flatten it), put glue on the 1cm strip we marked earlier.

P1020386

32 Attach the frame onto the picture.

P1020388

33 After adding a ‘caption’, we’re all ready to wire it up!

moving eye servo connection 1

34 Connect the battery pack to the Crumble, + to + and – to -.

moving eye servo connection 2

35 Wire up your servo. You need a + and – connect, either from the batteries or the Crumble, and an output (A,B,C or D) to the servo.

P1020398

36 You’re now ready to program it!

37 Now we want to control the servo. Try the following program. Notice how we have to use a do forever loop.

38 To get the eyes moving around basically, we can use a program like this. We’ve set the servo to one angle, waited, and set it to another etc.

39 To get the smooth motion, we have utilised some variables and a loop. We set our start angle (ServoValue) and our counter which will be one. We then set the servo, wait 30ms and then decrease our servo value by 1 (counter). After this has done this 70 times, we want to increase the servo value again. By multiplying ‘Counter’ by one, when we subtract it from ‘ServoValue’, we are actually increasing it (–1 = +1). It is a neat little trick to make programs more efficient. If you wanted, you could do another loop instead.

And there you have it. Your very own creepy moving eye portrait!