Pumpkin Robot

About two weeks ago I challenged myself to build a pumpkin robot. Not having a lot of time I had to keep it pretty simple. Maybe next year I’ll do one of my more elaborate ideas. This year’s pumpkin robot looks at people who get close to it:

It looks great in the dark too but it’s a lot harder to capture with video.

Now I will be the first to admit that this more of a pumpkin on a robot than a pumpkin robot but that doesn’t change the fact that I had a lot of fun making it. Some of of the non-technical things I really liked about this project were:

  • Built in deadline (Halloween)
  • Some obvious requirements (has to include pumpkin)
  • Interaction is a must
  • People understand it when I tell them about it
  • Fun decoration when it’s done

A lot of my robots end up being a bit too abstract to describe, whereas this one is immediately clear in purpose — the pumpkin looks at you!

Some of the technical problems I had to solve made this fun too:

  • How to move with the weight of pumpkin
  • How to mount a pumpkin on a robot so won’t roll away
  • How to get the robot to look at a person
  • How to get it to perform reliably

I think one of the best parts was that I could easily tell if it was working because I had such a clear test: Does it look at me? Yes or no.


  • Vex Robot
  • Pumpkin
  • Wood piece to hold pumpkin
  • Foam mat to keep pumpkin in place
  • Ultrasonic range sensor for finding a person

How it works:

This is a behavior based robot so instead of listing out a sequence of steps to perform it’s a matter of defining the right set of behaviors to get the overall desired effect (check out Rodney Brook’s papers for more info). The two key behaviors are lookBackAndForth and pauseRotate. There are some other support behaviors that you can see in the diagram below.

Pumpkin Robot Subsumption Architecture

Subsumption Architecture

The lookBackAndForth behavior uses the body angle estimate to decide if the robot has turned too much and reverses the turning direction. The limits are +/- 60 degrees from where ever the robot starts at.

The pauseRotate behavior uses the range estimate from the ultrasonic range sensor to trigger a pause in the motion when something is close enough (less than a meter). It also will only trigger another pause if the robot has rotated enough from the last pause (about two degrees). The pause is 1000 cycles through the main while loop and then the counter returns to zero and the robot can move again.


I tried more elaborate behaviors before I settled on the simple pause but they didn’t work because they required constant movement to create a model of where the person was. For me to feel like the robot was looking at me required the robot to stop moving altogether. The key take away I got from this project was that I could get an emergent behavior by combining two simple component behaviors. I perceive the robot is performing this more complex behavior when it really is just simple pausing at the right moment. I intentionally magnified this effect by carving the pumpkins eyes to look straight forward at the person.


An ultrasonic range sensor is a terrible way of detecting a person because fabric doesn’t really return an echo. You can see me holding a book in the video to get it to see me better. An IR distance sensor would work much better but i don’t have one yet.

I used an LED candle. I think it would be a bad idea to use an actual candle.


Spinning Coils

So I just made a “homopolar motor” aka a motor with one magnet field:

A homopolar motor

Homopolar motor made with buckyballs

I followed the directions at makezine which seemed simple enough but they did take a bit of tweaking to get it to work. The first time through, I didn’t pay close enough attention to step 4, sanding only one side of the second lead which is critical to how the motor works. The final step of tweaking to get the right balance was a bit vague but I figured out a trick to get the coil balanced.

Here’s how the motor works and why step 4 is so important. The permanent magnet pulls the coil’s magnetic field into alignment and then the coil’s angular momentum allows it to spin past that alignment. If it wasn’t for step 4 the coil would reverse direction and settle into alignment and stop. But because the second lead is only half sanded, the second lead acts like a switch. The circuit turns off when the bare side is up and it turns on when the bare side is down touching the paperclip. With the magnetic field off for part of the rotation, the coil can complete its spin. I didn’t know that wire had this built in switch until I built it wrong and couldn’t get it to work. There’s no substitute for hands on learning.

The parts I used for my motor were two paperclips to hold up the coil, the enamel coated magnetic wire for the coil, a AA battery, and buckyballs to hold the paperclips in place and act as the permanent magnet. I’ve seen some people substitute the buckyballs for the paperclips altogether but I couldn’t get that to work.

parts for a homopolar motor

The parts to make the motor

Following the directions was definitely crucial but getting it “balanced” makes the difference between it working and nothing happening. I could tell that it was close to working because the coil started to react to the magnet meaning the coil was creating a magnetic field. But I couldn’t get it to spin freely. It would just go a few spins and then stop. What I realized was that balanced meant it couldn’t have any spots in its rotation that it would want to stop due to a lower center of mass. I had to get the two ends to go out and away from the coil along its center. I found an easy test for this: If the coil hung vertically instead of horizontally when i put it in a horizontal position then it wasn’t aligned. I could bend the ends a bit and try it again until it passed my test. Once that happened i could get it to start and keep going. Another problem I had was once the coil was spinning, the coil would start slipping towards a side. I never found a good solution for that problem but playing around with bending the ends a bit to flare it out somehow got it to stop.

One last thing, I found that holding a second magnet nearby could speed up or slow down the motor depending on where I held it. Made playing with the finished very fun.

Here’s a video of the final result: