VOOZH about

URL: https://thenewstack.io/off-shelf-hacker-hedley-formerly-old-one-eye/

⇱ Off-The-Shelf Hacker: Hedley the Robotic Skull, Formerly 'Old One-Eye' - The New Stack


TNS
SUBSCRIBE
Join our community of software engineering leaders and aspirational developers. Always stay in-the-know by getting the most important news and exclusive content delivered fresh to your inbox to learn more about at-scale software development.
REQUIRED
It seems that you've previously unsubscribed from our newsletter in the past. Click the button below to open the re-subscribe form in a new tab. When you're done, simply close that tab and continue with this form to complete your subscription.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.
Welcome and thank you for joining The New Stack community!
Please answer a few simple questions to help us deliver the news and resources you are interested in.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Great to meet you!
Tell us a bit about your job so we can cover the topics you find most relevant.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Welcome!

We’re so glad you’re here. You can expect all the best TNS content to arrive Monday through Friday to keep you on top of the news and at the top of your game.

What’s next?

Check your inbox for a confirmation email where you can adjust your preferences and even join additional groups.

Follow TNS on your favorite social media networks.

Become a TNS follower on LinkedIn.

Check out the latest featured and trending stories while you wait for your first TNS newsletter.

PREV
1 of 2
NEXT
VOXPOP
As a JavaScript developer, what non-React tools do you use most often?
Angular
0%
Astro
0%
Svelte
0%
Vue.js
0%
Other
0%
I only use React
0%
I don't use JavaScript
0%
Thanks for your opinion! Subscribe below to get the final results, published exclusively in our TNS Update newsletter:
NEW! Try Stackie AI
From clobbered drafts to real-time sync
Apr 14th 2026 10:00am, by David Moore
TypeScript 6.0 RC arrives as a bridge to a faster future
Mar 14th 2026 9:00am, by Darryl K. Taft
Mastra empowers web devs to build AI agents in TypeScript
Jan 28th 2026 11:00am, by Loraine Lawson
2017-12-20 12:00:37
Off-The-Shelf Hacker: Hedley the Robotic Skull, Formerly 'Old One-Eye'
off-the-shelf-hacker,tutorial,
Software Development / Tech Culture

Off-The-Shelf Hacker: Hedley the Robotic Skull, Formerly ‘Old One-Eye’

Dec 20th, 2017 12:00pm by drtorq
👁 Featued image for: Off-The-Shelf Hacker: Hedley the Robotic Skull, Formerly ‘Old One-Eye’

Who wants a one-eyed robotic skull?

We could have pan/tilt eyeballs, like from Monster Guts that move around with commands from an Arduino or Raspberry Pi. Let’s be practical, though. My latest Off-The-Shelf Hacker project, Hedley, already has a JeVois camera in the right eye socket. And, while the store-bought eye kit is awesome and all, it will set you back a good $180. Maybe we can add a single pan/tilt eye in a future article.

For now, I simply want a good-looking fixed eyeball that will programmatically glow different colors and attract attention, on the cheap.

So, the search was on to find an appropriate item to use as an eyeball.

Suitable Eyeballs

My epiphany, other than using the JeVois smart machine camera in the right side socket came in the form of a small plastic Christmas tree ornament. My daughter was decorating a little tree and I scarfed several in various colors. It has a small decorative cap with a slot on top that’s easily removed, revealing a round, notched, circular protrusion that works great for holding a piece of 1/4″ brass tubing.

👁 Image

Christmas ornaments in various colors

It fit perfectly in the skull.

The hole in the top was enlarged slightly with a drill bit and small rat-tail file. Plastic parts are easily worked by hand since you need almost no power to turn them. I simply twirled the drill bit between my fingers to make the right sized hole. No need for a drill press.

I also hand-drilled a hole in the front (bottom) of the ornament to form the iris. Again, a little touch-up, this time with a spiral cutting Dremel bit, made the hole pretty round in almost no time. Be careful with this particular Dremel bit because the flutes are very sharp.

A Programmable Spooky Glow

I like using three-color LEDs. They are fairly cheap at a couple bucks or so and are usually pretty bright. Banggood has 10 for $1.60.

A while back we posted a discussion on selecting and using two different kinds of LEDs, common cathode and common anode. I used the common anode type, in this case, because the Pi can handle switching the power on its output pins. The common anode was attached to ground and each color went to its appropriate GPIO pin.

This time, instead of mounting the 100 Ohm resistors near the LED, I put them down on the Raspberry Pi 40-pin connector. There wasn’t enough room inside the 1/4″ tubing for all three resistors, so I just ran wires from the leads, down to the Pi. I used some 24-gauge stranded wire salvaged from an old serial mouse to connect the LEDs to the Pi. The wire is super flexible and pretty easy to use.

👁 Image

LED resistors wired to the 40-pin Pi connector

We only need 100 Ohm resistors because the general purpose input/output (GPIO) pins on the Raspberry Pi operate at 3.3 volts. You’ll find lots of 5-volt Arduino projects that use three-color LEDs. They require 270 Ohm resistors, due to the higher voltage. Always make calculations using 3.3 volts with the Pi GPIO pins.

After soldering the thin wires to the LED’s leads, I used little pieces of Scotch tape around each one to prevent shorting. It wasn’t pretty and was hidden inside the mounting tube. A dab of hot glue centers and secures the LED to the end of the tube.

👁 Image

Brass tube eyeball/LED mount

The brass mounting tube is a press-fit into the eyeball. Then the eyeball is a press-fit into a matching hole in the skull’s left eye socket. For this one, I did use the Dremel to drill a pilot hole, since the plastic was pretty thick. After that, I again used the spiral bit to hand work the hole to the proper size.

Currently, the eyeball stays in the socket using just a press-fit. I’ll likely build a little bracket inside the skull that grips the mounting tube and holds it securely.

Keep It Simple, Use Python

The code to run the eyeball was very straightforward and similar to what I used in the previously mentioned basic LED visual interface article.

#!/usr/bin/env python2.7
 
import RPi.GPIO as GPIO # always needed with RPi.GPIO 
from time import sleep # pull in the sleep function from time module 

maxint = 30 
 
GPIO.setmode(GPIO.BCM) # choose BCM or BOARD numbering schemes. I use BCM 
 
GPIO.setup(22, GPIO.OUT)# set GPIO 22 as output for red led 
GPIO.setup(17, GPIO.OUT)# set GPIO 17 as output for blue led 
GPIO.setup(27, GPIO.OUT)# set GPIO 27 as output for green led 
 
red = GPIO.PWM(22, 100) # create object red for PWM on port 25 at 100 Hertz 
green = GPIO.PWM(17, 100) # create object blue for PWM on port 24 at 100 Hertz 
blue = GPIO.PWM(27, 100) # create object green for PWM on port 24 at 100 Hertz 
 
# red.start(1) # start red led on 0 percent duty cycle (off) 
blue.start(0) # start blue on (100%) 
# green.start(0) # start green on (0%) 
 
# now the fun starts, we'll vary the duty cycle to 
# dim/brighten the leds, so one is bright while the other is dim 
 
pause_time = 0.05 # you can change this to slow down/speed up 
 
try: 
 while True: 
 for i in range(1,maxint): # 101 because it stops when it finishes 100 
 #red.ChangeDutyCycle(maxint - i) 
 blue.ChangeDutyCycle(maxint - i) 
 # green.ChangeDutyCycle(maxint - i) 
 sleep(pause_time) 

 for i in range(maxint,1,-1): # 101 because it stops when it finishes 100 
 #red.ChangeDutyCycle(maxint- i) 
 blue.ChangeDutyCycle(maxint - i) 
 # green.ChangeDutyCycle(maxint - i) 
 sleep(pause_time) 
 
except KeyboardInterrupt: 
 red.stop() # stop the red PWM output 
 blue.stop() # stop the blue PWM output 
 green.stop() # stop the green PWM output 
 GPIO.cleanup() # clean up GPIO on CTRL+C exit

The code initialized the libraries and variables. Then sets which Raspberry Pi pins connect to which LED colors. After that, the program just loops a variable up, then down to change the duty cycle on the blue LED. Duty cycle is the width of the ON pulse from the pulse width modulation (PWM) Raspberry Pi GPIO pin. More width makes the LED brighter.

Starting with a small number the LED appears dim and gradually builds in intensity. Then the program goes the other way, to make the LED get increasingly dim. This gives a cool pulsing effect.

It’s also possible to add other colors or geometric functions to tailor the eyeball glow profile as you see fit.

I’m thinking it’s even possible to pulse the eyeball colors according to what the JeVois camera sees. For example, maybe when the skull recognizes that a human is standing in front of it, the eye glows blue. When a dog shows up it glows red.

We’ll have to explore the LED visual interface in the skull idea a little further.

Wrap Up

Adding features and capabilities to the skull takes time and I usually can manage only one or two each week. Ah, the life of a tech “how-to” article writer.

Anyway, I’ll leave you with a couple of links to check out.

The first one is a little catalog of robotic head projects. Some you can buy. Some are very sophisticated. Some… well. Maybe they’ll spark a few ideas for your projects.

The other link is to the Monster Guts site. They have quite a selection of props and robotic parts, including pneumatics. We haven’t even discussed any of those at Off-The-Shelf Hacker yet. Be sure to watch their videos for new project inspiration.

So much off-the-shelf tech, so little time. Here’s to Old One Eye.

TRENDING STORIES
Rob "drtorq" Reilly is an independent consultant, writer, and speaker specializing in Linux/OSS, physical computing, hardware hacking, the tech media, and the DIY/Maker movement. He provides a variety of engineering, business and special project services to individual clients and companies....
Read more from drtorq
SHARE THIS STORY
TRENDING STORIES
TNS owner Insight Partners is an investor in: Shelf.
SHARE THIS STORY
TRENDING STORIES
TNS DAILY NEWSLETTER Receive a free roundup of the most recent TNS articles in your inbox each day.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.