Having bought a new 3D printer I was eager to try designing and printing some mechanical assemblies, so I thought a great place to start would be with this animatronic eye mechanism. It may look complicated, but this project was super quick to do (just 1 day!) and cost me absolutely nothing. Assuming you already have a 3d printer and some Arduino basics this project should cost you next to nothing and is doable in a single evening.

A joystick controls the motion of the eyeball, while a small push-to-make switch blinks the eye and another potentiometer controls how wide open the eyelids are by default (or you can just think of it as the "tiredness" adjuster).

Of course, this is the kind of project you need to see a video of to fully appreciate, so be sure to check out the video which also has instructions (if you prefer more visual instruction):

Step 1: Parts

Obviously a 3D printer is essential for this project, but other than that there are no specialised tools. The only other things that might be handy are some needle-nose pliers for the more fiddly bits.

The parts you will need are:

  • Any Arduino board that can support 4 servos (check to make sure it has at least 4 PWM pins, most do)
  • 4 SG90 micro servos
  • Joystick
  • Potentiometer (10k ohms is generally a good value to use)
  • Push-to-make switch (Some joysticks have this built in, mine was broken)
  • 220 Ohm resistor
  • Jumper Cables
  • 2 x M3 bolts or similar
  • Stiff Wire (I used packaging wire)
  • Breadboard
  • 3mm Universal Joint (This is the only part that isn't as easy to find, I bought them from this link: https://www.aliexpress.com/item/5pcs-Rc-Boat-Stai... )

Step 2: Printing

The base prints easily without supports, but the eyelids and eyeball are a little more tricky. I'd reccomend printing the eyeball facing up as shown in the picture, at as high a resolution as possible (I just got away with 0.1mm).

I wanted this to be a very easy and accessible project so I coloured the iris with some marker pens, but to get a better finish you could sand down the eyeball and paint it, perhaps using some 2-part epoxy to get a glossy finish and a lens effect over the cornea. As you can see however, I got great results with a quick and dirty marker pen paintjob.

Step 3: Assembley

The servos fit almost perfectly into their sockets, but I did have to wrap a layer of tape around some servos just to avoid having to use glue. I'd recommend you put the X and Y servos in place (refer to my images to make sure you have them facing the right way), followed by the eyeball itself. Using some needle-nose pliers, I bent a little hook into the wire and plugged one end into the servo horn and the other into the hole in the eyeball. This is easier to understand if you watch the video, but once you understand how the mechanism works, the assembly should be quite intuitive. Put the eyelids and their servos in after the eyeball is already secured, just to make it less fiddly.

The wiring of the Arduino is also quite simple if you already understand how to control servos with a potentiometer, but even if not the wiring diagram above should make the process quite easy. Each servo plugs into a digital pin on the Arduino (as well as positive and negative), and each potentiometer plugs into an analogue pin. Remember that a joystick is actually just 2 potentiometers that you can control simultaneously, so if you understand how the "Knob" example sketch works in the Arduino IDE, understanding how to control 2 servos with 1 joystick should be easy to grasp.

Step 4: Coding

The code for this project is relatively simple, I started with the "Knob" example sketch and added more servos and a few extras. "Knob" simply takes a reading from a potentiometer and maps it onto a range of values from 0 - 180, basically converting the analogue signal into an angle in degrees for the servo to move to. This code does exactly that except, rather than being values from 0 - 180, the numbers have been chosen specifically so that the movement will occur within a narrow range of angles. It might be best for you to experiment with values to get the most organic-looking movement possible, but note that if you don't like coding you can just experiment with the starting positions of the plastic servo horns or the lengths of the wires.

The eyelids take the reading from the Y-axis controller (up and down) and move based on this. When the eye looks up, the eyelids both adjust upwards slightly to accommodate this, massively adding to the realism of its motion. The push switch also sets both eyelids at once to move to the centre, causing the eye to blink.

Step 5: Finishing

Simply upload the sketch to your Arduino and you should be good to go! Note that the puppeteering is the most important aspect of making the eye look realistic, so play with it often to get to uncanny-valley levels of creepy!

<p>What are jumper cables, and where can I find them?</p>
<p>Just the standard wires you use with Arduinos, they use a Dupont connector. If you search jumper wire or Dupont wire on amazon or ebay you'll find them, or any electronics store should have them too.</p>
<p>This would be an awesome addition to our Halloween decor. There was a good tutorial in the contest last year that had flowers with eyeballs, I'd love to put these into those! :)</p>
Thanks, and yes I kind of wish I'd done it at Halloween haha
<p>Great, would make a fantastic front door piece for anyone who pushed the door bell, like Jabba the Hutts.</p>
<p>Sweet! The cover photo could be better, though.</p>
<p>Is the lower eyelid connected to the servo, or is it just gravity?</p>
<p>Sweet project, now all you need is a motion sensor...</p>
<p>Fantastic Work........</p>
<p>Can we get more pictures of how the servos are connected to the eye?</p>
<p>I've added a few more pictures to step 3, I hope that clears up any confusion :)</p>
<p>Very cool! </p><p>There's definitely room for improvement, like having 1 servo control the top and bottom eyelids synchronously.</p><p> It can also be optimized to get it to fit in a robot head... ;)<br><br>I've got a couple of other projects I have to work on first, as always haha.</p>
Hi! Fantastic project. I love it. I was looking in Ali Express and was going to buy the servos but I have to pick either analog or digital. Which ones do I need?<br>Thanks!
<p>I'm fairly certain they're digital but I can't be sure, I've never actually thought about it haha! I think they're controlled in the same way though, at least for really low power applications like this so it shouldn't matter. </p>
<p>thanks! I'll order the digital one's then. They are probably pulse with modulated rather than an analog voltage level for setting the angle. I've been wanting to do something like this for a long time.</p>
<p>Best of luck with it :)</p>
<p>Excellent and how cool! Going to make as a Halloween yard decoration. Will redo code to automate. Using some kind of PIR or Sonic sensor, would like to cause extra effects if people are walking by. </p><p>Thanks for sharing and your EXCELLENT documentation!</p>
<p>Yeah that would be amazing, get it to follow people around the room somehow, please post a video if you do!</p>
This eye look awesome! I have got to make it
Very gooood! Congs!
<p>This is amazing!</p>
Thanks :)

About This Instructable




Bio: The name "Ikkalebob" was invented by my cat when she ran across the keyboard. I attempt all manner of projects, from home engineering to prop ... More »
More by Ikkalebob:3D Printed Animatronic Eye Mechanism on the Cheap Smartphone Controlled Cat Laser The Witcher 3 Full-Scale Chort/Fiend Sculpture in DAS clay 
Add instructable to: