The pumpkin firmware is developed in C using the Arduino framework. The development environment is VS Code with the PlartformIO extension. The Android app was developed using a Skratch-like programming language developed by MIT called MIT App Inventor. The hardware is built around a Teensy 3.5 development board which features an ARM Cortex-M4 at 120 MHz. All the electronics are mounted on a carefully routed protoboard.
Features:
The sections below present a list of this project´s features.
Audio Effects
* Audio files are stored in an SD card. The audio files consist of several Halloween-related songs and spooky sound effects. The files are 16-bit PCM (Pulse Code Modulation) at 44100 Hz .wav files.
Light Effects
* Two LED strips: one for the main pumpkin and another one for the three smaller pumpkins
* When not playing an audio file, the LED strips display simulates candles lit inside the pumpkins.
* Light effect 1: When playing an audio file, the LED strips can display the LED brightness synced to the audio file that is playing. This effect is displayed in different color versions: white, red, green, and purple.
* Light effect 2: When playing an audio file, the LED strips flash on and off with three different colors at a rate of 60 ms. This effect is displayed in two versions: red-green-blue and purple-green-orange.
* Light effect 3: When playing an audio file, the LED strips display a rainbow color effect that cycles through the color wheel in 5 seconds.
* Light effect 4: This is a specified light effect designed for the audio file MountainKing.
Animatronic Eye
* The animatronic eye features two servo motors, one for the eyelid and one for the eyeball.
* The code for both motors allows for an organic movement where the servos reduce their speed as they approach the new position.
Communication
* The communication between the pumpkin and the Android app happens via Bluetooth. During standard operation, the app transmits 6 values in a string, the Bluetooth module on the pumpkin receives it and passes the string to the microcontroller via serial communication.
* When a Bluetooth connection is established, the pumpkin transmits the name of the audio files stored in the SD card to the app which stores it in a list. That way the audio files can be changed without modifying the code.
* When the volume is changed on the app, the pumpkin sends the volume value to confirm to the user the actual volume.