Introduction: 3D Printed Animatronic Eye Mechanism on the Cheap

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!

Comments

author
zmcqueary (author)2017-08-08

Hey there - this is just absolutely amazing! I really think this is truly a spectacular setup for my puppets that I'm attempting to build. Do you have any recommendations for building a two-eye unit?

I really am a noob when it comes to mechanics (but I've got a small 3D printer and a willingness to try!). Not to make a blatant skip, but have you considered selling these units yourself?

Thank you, and I'll probably have LOADS more questions!

author
Ikkalebob (author)zmcqueary2017-08-10

Much appreciated! I can't really sell you one at the minute but I can give some recommendations. I did start to build a two-eye mechanism and I made a short video about it (here!). I tried to use one servo to control different parts of the eye at the same time but in the end I think its more reliable to just not change anything and have two single eye mechanisms instead. One thing I'd definitely suggest though is to look into using a servo driver board (I touched on this in the second video) because with two eyes there will be too many servos to power through just the arduino. 

Feel free to ask more questions! I could send you the 3d model I used in that video too but personally I think its a poor design.

author
FanjitaUK (author)2017-05-18

Thanks - I'm in the process of finishing off my build of this, and so far it's going great. What I found was that it was hard to get a good print of the eyelids - but that a standard pingpong ball is exactly the right size to cut into the appropriate shapes - and you can get both eyelids out of one ball if you plan the cutting carefully.

Thanks again for the inspiration - I currently plan to mount mine on top of a large spider-style robot, for added creepiness!

author
Ikkalebob (author)FanjitaUK2017-05-18

Great idea with the ping pong ball, please post a picture when you're done ! I need to see the spider robot haha

author
FanjitaUK (author)Ikkalebob2017-05-30

Here's a video of the eye on its own, showing the ping pong ball eyelids. I basically cut them from the ball in a similar shape to your 3D prints, and mounted in exactly the same way. Hopefully the lightness contributes to a good fast blink, even with cheap servos.

https://youtu.be/rHtwtQCCT4A

author
ThirdEarthDesign (author)2017-05-16

I'm so going to make this at some point. I can feel some halloween inspiration coming!

author
penged (author)2017-05-08

This is great. I want to add an LED to the center of the eye. I think that if I incorparate the blink sketch into the code it should work. Any suggestions?

author
michael.dejong (author)2017-05-03

When we plug in the motors they either don't spin at all or they spin and stop because they cant go any farther. At the time, we don't have the X or Y cables plugged in. Neither did it change when we did plug the X or Y cables. Please help we only have 24 hours.

author
Ikkalebob (author)michael.dejong2017-05-03

Sometimes the arduino takes around 20 seconds to get going and during that time the servos freeze, have you waited that long? Are you using the 5v pin or the 3v? It might be easier for me to help if you upload a photo of the wiring.
Another thing to try is to see how the servos move without the plastic horns screwed in? Maybe the horns just need repositioning.

author
michael.dejong (author)2017-05-03

Thank you so much! That clears up like a million questions!!

author
michael.dejong (author)2017-05-02

I have figured it out. But, can you solder the jumper cables to the analog stick? I provided a link to the adafruit one I got. https://www.adafruit.com/product/512?gclid=CKu3_8mg0tMCFUK2wAodPM0Fxw

author
Ikkalebob (author)michael.dejong2017-05-03

There should be no problem soldering the cables so long as they are in the right positions. I'm not sure about the joystick you bought but usually things like that come with pin headers that you solder into the holes so you can plug things in more easily, if not its fine but you will have to solder the wires.

author
michael.dejong (author)2017-05-02

Can you please give specific instructions on the wiring of electronics as we are very confused and is new to the process. I need this project done for a STEM Fair within 3 days so any help would be greatly appreciated!

author
Ikkalebob (author)michael.dejong2017-05-03

Okay, so each servo has a positive(5v) and negative(GND) connection (black/brown is negative, red is positive) as well as a yellow signal cable. The wiring diagram should show you which (yellow) data cables go to which pins in the arduino (for example the y axis goes to pin 9). The Potentiometer and joystick both have positive and negative inputs (On a potentiometer this is the outside 2 pins, either polarity, on a joystick it should be labelled). Then the X-axis signal cable from the joystick goes to pin A1, y goes to A0, and the eyelid open/close potentiometer goes to pin A2. As for the push switch, One pin goes to GND, the other pin goes to pin 10 on the arduino AND to 5V through a 220 Ohm resistor.

I hope thats cleared up for you, looking back the diagram is a bit confusing, I'm going to try and update it so look out for that if you're still having trouble.

author
lorduncan (author)2017-04-28

Hey, This looks awesome and smooth :)

Should be epic if we could make a version for the InMoov

http://www.thingiverse.com/thing:1789079

Maybe with 6 servos we could make the moves for both eyes.

1X , 1Y and 1 per each independent eyelid so it could be able to wink.

Anyone have time enough to start it?

:D

author
ShawnL61 made it! (author)2017-04-25

So I figured I would give this a try, the print job turned out great, I printed the base in black figured it would let the eye stand out a little more, and then used Glow in the Dark PLA to give it a little extra at night. Still needs some work on my part. I tried to go without the U-joint, think I will need print one or buy one. I also want to switch the button to be the click down on the joystick. Will need to calibrate the servos as they kind of went crazy on the first run, as you can see in the picture, maybe some double sided tape to mount a little more solid as well.

eyeprogress.JPG
author
Ikkalebob (author)ShawnL612017-04-26

Nice work, it should look great in the dark :) I'm going to look into an alternative for the U joint since it looks like the wait time isn't feasible for most people. I'm impatient too I just happened to have one lying around at the time haha.

author
michael.dejong (author)2017-04-25

The universal joint is a 19-35 day shipping and I need it within a week. Is there ANYWHERE else to buy it?

author

Tag along question, does the size really matter? Can I get a 5mm.

author
ShawnL61 (author)michael.dejong2017-04-25

I don't really want to wait 30-60 days for the part so I was going to try and size this to fit..

http://www.thingiverse.com/thing:264017

author
Ikkalebob (author)ShawnL612017-04-26

That could work really well, let me know how that goes because a few people have said they'd rather not wait.

author
Ikkalebob (author)michael.dejong2017-04-26

I know you can get them off Amazon but it's for 5x the price unfortunately (at least the ones I've seen on Amazon UK). I think 5mm should be fine, you just might need to tighten the grub screw and it could be a bit fiddly.

author
HaleyR9 (author)2017-04-24

What are jumper cables, and where can I find them?

author
Ikkalebob (author)HaleyR92017-04-25

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.

author
Swansong (author)2017-04-19

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! :)

author
Ikkalebob (author)Swansong2017-04-19

Thanks, and yes I kind of wish I'd done it at Halloween haha

author
MichaelB1130 (author)Ikkalebob2017-04-22

Great, would make a fantastic front door piece for anyone who pushed the door bell, like Jabba the Hutts.

author
random_builder (author)2017-04-22

Sweet! The cover photo could be better, though.

author
sauzadawg (author)2017-04-21

Is the lower eyelid connected to the servo, or is it just gravity?

author
pikeslayer17 (author)2017-04-21

Sweet project, now all you need is a motion sensor...

author

Fantastic Work........

author
GerotiCooper (author)2017-04-20

Can we get more pictures of how the servos are connected to the eye?

author
Ikkalebob (author)GerotiCooper2017-04-20

I've added a few more pictures to step 3, I hope that clears up any confusion :)

author
GerotiCooper (author)Ikkalebob2017-04-20

Thanks!

author

Very cool!

There's definitely room for improvement, like having 1 servo control the top and bottom eyelids synchronously.

It can also be optimized to get it to fit in a robot head... ;)

I've got a couple of other projects I have to work on first, as always haha.

author
dfortin (author)2017-04-20

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?
Thanks!

author
Ikkalebob (author)dfortin2017-04-20

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.

author
dfortin (author)Ikkalebob2017-04-20

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.

author
Ikkalebob (author)dfortin2017-04-20

Best of luck with it :)

author
gwlinn123 (author)2017-04-20

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.

Thanks for sharing and your EXCELLENT documentation!

author
Ikkalebob (author)gwlinn1232017-04-20

Yeah that would be amazing, get it to follow people around the room somehow, please post a video if you do!

author
docman100 (author)2017-04-20

This eye look awesome! I have got to make it

author
ensarlevent (author)2017-04-20

Very gooood! Congs!

author
PinkyPie80 (author)2017-04-19

This is amazing!

author
Ikkalebob (author)PinkyPie802017-04-19

Thanks :)

About This Instructable

10,159views

211favorites

License:

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 CheapSmartphone Controlled Cat LaserThe Witcher 3 Full-Scale Chort/Fiend Sculpture in DAS clay
Add instructable to: