The code for this is based on an example from Tom Igoe's Making Things Talk
. It's pretty simple: the Arduino monitors a Sharp GP2D12 Infrared ranger
, and if it detects movement nearby, it turns all the LEDs up to maximum brightness. While it's waiting for someone to step close to it, the Arduino flickers the lights.
Pins 9, 10, and 11 go to LEDs that are shown in the next step. Analog pin 0 goes to the proximity sensor. Power and ground go to the breadboard that houses the LEDs and the sensor.
The attached file, Pumpkin.pde, contains the Arduino code you need to upload to your Arduino.