Pimp Your Pumpkin - An Arduino Jack-O-Lantern

Hello!

Just in time for Halloween, I posted a video of an Arduino jack-o-lantern project I call "Pimp Your Pumpkin." It's a basic project and makes use of a proximity sensor to make your halloween pumpkin a little more interactive.

Please enjoy: http://www.youtube.com/watch?v=FUR5NjsR1JQ or on vimeo if you prefer: http://vimeo.com/15678737

Feedback is appreciated, either on this forum or as comments on the video itself.

Matt

Maybe put the sensor in the eye...?

I love it :) :) :)

Thanks for sharing

I'm more impressed with the video. How did you make it? Although the pumpkin idea is excellent as well. Nice job!

Jeremy, that's a good idea, or perhaps carve a dedicated hole for the sensor itself. Some people may want to put the sensor somewhere else entirely.

Thanks, kas and Alligator!

Alligator, the video was shot with a Canon 5D Mark II and edited in Final Cut Express. I licensed the music and PCB background animation from Envato marketplaces. The circuit diagrams were made in Fritzing, exported as SVG into Inkscape for layout. I'm glad you liked it.

Matt

I like this. I'd like to see the code posted here. It would be pretty easy to also run some LEDs to other pumpkins on either side, all controlled by the same arduino.

Big Oil,

Thanks! I've pasted the below and the most current version can be found on GitHub. Anyone that wants to enhance the code, please feel free to contribute on GitHub: http://github.com/mrichardson23/PimpYourPumpkin

#define CANDLELED 11
#define REDLED 7
#define BUZZER 5
#define SENSOR 4
#define PROXIMITY_THRESHOLD 85
#define PROXIMITY_CONSECUTIVE_READINGS 3
#define BUZZER_FREQUENCY 38
#define FLICKER_INTERVAL 25

long previousMillis = 0;
long closeReadings = 0;

void setup() {
      pinMode(CANDLELED, OUTPUT);
      pinMode(REDLED, OUTPUT);
      pinMode(BUZZER, OUTPUT);
      pinMode(SENSOR, INPUT);
      delay(1000); // Allow the proximity sensor to initialize
}
void loop() {
      if (analogRead(0) > PROXIMITY_THRESHOLD) // Is someone close?
      {
            closeReadings++;
            if (closeReadings >= PROXIMITY_CONSECUTIVE_READINGS) // require n consecutive "close" readings before going into EVIL mode. This prevents little blips of the buzzer.
                  {
                        digitalWrite(CANDLELED, LOW);
                        digitalWrite(REDLED, HIGH);
                        tone(BUZZER, BUZZER_FREQUENCY);
                  }
      }
      else
      { //regular candle flicker. Based on Arduino example BlinkWithoutDelay.
            noTone(BUZZER);
            digitalWrite(REDLED, LOW);
            closeReadings = 0;
            unsigned long currentMillis = millis();
            if(currentMillis - previousMillis > FLICKER_INTERVAL)
            {
                  previousMillis = currentMillis;
                  analogWrite(CANDLELED, random(0, 256));
            }
      }
}

Thanks for sharing! :) Sparks some ideas... ;)

I thought this was really cool, so I downloaded the latest version of fritzing (fritzing.2010.09.30.linux.i386) to check it out. Alas, it doesn't seem to like your design:

Parse error (1) at line 61, column 9:
tag mismatch
/srv/rwa/ran/downloads/arduino/ideas/Schematic.fz

What version did you use to create it?

Ran,

I resaved (and pushed to github) the file with the latest version of Fritzing, but it looks like the schematic got messed up in the process. I'm new to Fritzing myself and haven't totally figured it all out. Here's a JPG of the breadboard diagram:

I hope this helps. If I can get this Fritzing schematic fixed, I'll push it to github and let you know.

Thanks, Matt

Here’s video of a project with 2 pumpkins. I think it would be better with the candle flicker effect on the lights.

Really cool project... makes me want to built one too :-)

I'll be using a BlinkM though... :-)

Thanks again to everyone for the feedback! I'm working on videos for a few other projects now. If you have any ideas for projects to demo, let me know.

I made a slight variation for mine. The jack-o-lantern stays dark until someone activates the motion sensor, then it lights up. I used the random LED flickering code for the 4 high-brightness LEDs to make it look like a candle. I also used a 70ft motion sensor that is usually used for security lights.

Awesome! It must be a pretty cool effect in the dark, approaching the pumpkin to see it magically “light up!” Are you able to post video of it?

Didn't make a video, I wouldn't want to frighten everyone.

Here is my version...my boys & I have been playing with a plasma cutter :)

I'm using a RuggedCircuits Gator+ and a Maxbotix Ultrasonic Range Finder...

More pics on our family blog...http://raisinggeeksandgearheads.blogspot.com/2010/10/october-24th-plasma-cutting-welding.html

Matt: What's the sensor?

shouldn't the correct statement be 255 like this: - analogWrite(CANDLELED, random(0, 255)); not like this: -analogWrite(CANDLELED, random(0, 256));

Or am I wrong?

Nice simple project btw!

shouldn't the correct statement be 255 like this: - analogWrite(CANDLELED, random(0, 255)); not like this: -analogWrite(CANDLELED, random(0, 256));

Or am I wrong?

You are wrong ;)

Max is exclusive, so you have to use 256 if you ever want a value of 255.

http://arduino.cc/en/Reference/Random