EyesAndBrows
2023-07-14 | By M5Stack
License: General Public License Arduino M5Stack
* Thanks for the source code and project information provided by @Ripred
For eyeballs I used two halves of ping pong balls, cut slightly over halfway use the bigger half. I glued a post into the inside center front of both with epoxy. After letting them dry for a couple of days I put each one on a drill and ran it on the lowest speed. I used colored pencils to make blue eyes with some yellow added in to make them slightly blue green, with a black center pupil. Having them spin on a drill turned out to be a great way to keep everything centered perfectly just as a side-effect.
I then covered them with clear nail polish I borrowed from my wife heh. Using another tip that I found on the internet I took a 1" or so piece or red ribbon and pulled out individual strands (or two or three strands at a time) and placed them in various areas around the whites of the eyes. They're barely noticeable but they look exactly like the small blood vessels in your eyes so they really do add a touch of realism. Another thing that I learned was how NOT to mount them. I cut the posts down to be about even with the back of the eyes. I wanted the swivel/pivot point of the eyes to be approximately in the center of each eye, not from further back. My first attempt was to use a couple of ball-and-socket joints I got at some random RC Plane hobby store. Those places are great for robotics and animatronics-useful parts.
I mounted the end of the posts holding the ball/socket joints and the eyes to a flat piece of wood extending out from it about 2 inches. I then mounted two sets of spare servo horns - the four-sided kind, on the board so that the edges of the holes on the horns lined up with the left and right edges of the eyeball ping pong balls. I made a small hole in the side of the ping pong ball and made a linkage from a short piece of paperclip wire and mounted it to the end hole of the servo horn and the eyeball.
I cut it to length so that when the servo horn was centered, the eyeball was facing straight forward.I then made a short 1/4" riser on wood base and mounted two more spare servo horns to act as the push-pull on top of each eye to make them look up and down. I attached a linkage to the top edge of both eyes just as I had done with the sides. I added a linkage (paperclip wire) between the two left-right servo horns, and another linkage between the two up-down servo horns, since I wanted the eyes to act in unison and did not need them to be able to cross etc. So far so good. Finally, I added two servos to the wooden base and linked them to the two sets of servo horns: the up-down, and the left-right.
It worked well, sort-of. The problem was that since the ball and sockets allowed the eyeballs to rotate (clockwise/counterclockwise), sometimes when both the servos would extend their linkage I would get torsion, or rotation around the center, and the eyes would just rotate slightly and be all out of whack and not what I wanted at all. I hope that makes sense.
So, the solution was to use a U-joint style mechanism instead of a ball-and-socket. That allowed movement only in the two axis that I wanted: up/down and left/right, without any rotation. Instead of getting some small u-joints that would cost more money I did this: I took two small brass hinges from some cheap wooden Hobby Lobby craft boxes I had. I set the hinges at 90 degrees to each other and soldered two of the wings from each hinge together. That left the other two hinge wings to mount on. One hinge allowed only left/right movement. The other hinge allowed only up/down movement. It works perfectly now. Now when the linkages from the servo horns extend outwards, the eyeballs look down or to the side like they are supposed to.
I did not add eyelids to make mine blink. Instead, I added a different complicated mechanism to add two eyebrows that rotated inverse to each other (both centers move up or down together), since mine is more of an art piece and an experiment in expression. The eyebrows can also be raised and lowered along with being rotated.
I've ranted on enough in this post. Here's a link to my post about it with a horrible video I made to show the mechanics inside and how it works. At about 2:28 in the video I turn it around and you can see the hinge mechanisms inside that I described above.
And of course, all of the code is available in a github repository under EyesAndBrows.
Cheers!
Have questions or comments? Continue the conversation on TechForum, DigiKey's online community and technical resource.
Visit TechForum