Step 6: CUT-OUT TEETH

To make pumpkin scarier and allow glowing to really show through, we cut out little squares in pumpkin's mouth, to give it a "missing teeth" look.

Step 7: SOUND SENSOR

To make pumpkin wake up not only on motion, but on loud sound as well, we added a sound sensor, which is glued with a double-sided tape to the inside of the pumpkin close to the top.

Part: LM386 Arduino Compatible Digital Microphone/Sound Sensor Module

Step 8: SOUND AMPLIFIER AND SPEAKER

Scary sounds are played by the MP3 board via amplifier.

The sound board is attached to the Arduino board, the amplifier is located closer to the speaker, and the speaker is located at the in the back at the top of the pumpkin. Cut out a few parallel holes to let the sound through.

Step 9: VIBRATION

To make the pumpkin even scarier, the idea was to make it shake in addition to glow lights.

Two eccentric motors are attached to the top of pumpkin to give it a shake.

Unfortunately, because crystals turned out to be heavier than we expected, and we had to use counterweights to prevent pumpkin from tipping over, the eccentric motors appeared to be too weak to actually shake the pumpkin - they just give it a nice buzzing vibration. You might want to find a bigger motors or heavier eccentric weights on them...

Parts: 5V 3200RPM Electric Mini Vibrating Motor

Step 10: SOUNDS

Scary sounds are played via MP3 board.

We chose SD SDHC Card MP3 Player Board Module TTL because it has an SD card slot, and could play files randomly. THe board supports various control modes. We used serial interface for the simplicity of use, although it does present a slight challenge during sketch upload time. Not too inconvenient though.

The MP3 board has very specific requirements for file names and locations. In our case, we just placed properly named files in the root folder of the FAT16 formatted SD card, and let the board handle random selection by itself.

Please refer to Sketches and Files section below for sound files.

Part: SD SDHC Card MP3 Player Board Module TTL

Step 11: ARDUINO, WAKE-UP TRIGGERING, MOTOR CONTROL

The last, but not least part of the pumpkin is Arduino Uno, motor control and wake-up triggering circuit.

All circuitry is assembled on the Arduino Compatible Uno R3 Rev3 Development Board

The wake-up interrupt circuit consists of 74HC02 NOR gate, to which outputs from 2 motion sensors and sound sensor are connected.

Please refer to the electronic schematics step for connection details.

Triggering logic: if any of the motion sensor signals are HIGH, or sound sensor signal is HIGH, wake up the device (due to use of NOR gate, the resulting signal is LOW, so this is an Active Low configuration).

Step 12: SCHEMATICS

Schematics picture, attached to this steps, depicts interconnection of the pumpkin electronic components.

This schematic was created with Fritzing software. Please refer to Sketches and Files step for the actual fritzing file.

Step 13: NOTES ON ASSEMBLY

Fitting the components in:

It is not easy to fit all the components inside the pumpkin via top opening. We actually had to cut the back of the pumpkin open, and sealed it back with hot glue after everything was installed.

Counterweights:

Unfortunately, the crystal prisms turned out to be heavy, and pumpkin was tipping over on its face with crystals attached. To balance the pumpkin, we had to attach D-size batteries to the back of the pumpkin.

Cover:

Finally, when everything was in place and tested, we covered the pumpkin with a meshed protective cover from the 120mm fan.

Step 14: ARDUINO PINOUT

Below is pinout for the Arduino board at the heart of "interactive" part:

Step 15: NOTES ON SKETCH

Not only DirectIO library makes reading from and writing to Arduino pins much faster, it also allows treating pins as variables.

Instead of writing

digitalWrite(13, HIGH);

use can just write

pLED = HIGH;

PinChangeInt library

PinChangeInt gives you access to pin interrupts on all Arduino pins. This library was essential for coding ultrasonic measurement routine without the use of pulseIn function.There is nothing wrong with pulseIn per se, except the fact that it is blocking function, i.e., until the edge of the pulse is detected (or until a timeout) nothing else is going on. Since pumpkin sketch is written with cooperative multitaskling in mind, this is unacceptable.

Instead of using pulseIn, the ultrasonic process is broken into major 3 steps:

Organization Contest

Paper Contest

4 Discussions

The TaskScheduler library comes with a very detailed document, explaining it's scheduling process and methodology. TaskScheduler implements cooperative (non-preemptive) multitasking. Tasks are executed when their time to be executed is reached. Evaluation happens in the order tasks were added to the execution chain (so you control the evaluation order, invocation is still based on scheduled time). There is a way to schedule tasks to trigger on an event (pls refer to StatusRequest object description in the docu). There is also a way to prioritize execution of certain tasks via scheduler chains. However, non-preemptiveness still requires cooperative programming style (no delay (), short callback methods, avoiding blocking operations, using TaskScheduler loop nature instead of for/while loops, etc. )

thank you!!!!i just wanted to do a project that i have to use all task scheduling method so, i plant to go with led blinkingi mean each scheduling must be explain for example when i'm trying sjf preemptive how efficiency than others likewise, do for each process scheduling