Peter the Pumpkin

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Welcome to the final part of my sharethescare which follows on from my previous blogs, listed below. I hope you enjoy reading about the journey I've taken to make my animatronic pumpkin head and I'll be testing it it really has the ability to Share The Scare!

 

[To mask the servo noise it was intended to have an audio track play as well. Currently that hasn't worked and so the cackling sounds were manually played whilst the video was recorded.]

 

The Eyes

I managed to fix the servo eyes into Peter's paper mache head. I knew straight away that it wouldn't be an easy task as nothing was symmetrical and all orientations were different. I knew that if I just glued them in there would be every chance that the eyes would not align with the holes so I made some adjustment mechanisms.

{gallery} Eyes - mounting
Eye adjustment mechanism
Close-up of adjustment
Eyes - glued into paper mache head.

Movement Sensor

The PIR sensor was very easy to incorporate into my Arduino Uno sketch and uses the digitalRead function to test for one of the Uno's pins going high to start the sequence off. I used hot melt glue to fix the sensor to a plastic bracket and then fixed that to the baseboard. This allows me to adjust the azimuth that it detects my next victim trick-or-treater.

 

Lighting

I've used the WS2812 in the head to

  • (1) flash a start up sequence so I know the program is running
  • (2) to flash briefly when movement is detected
  • (3) to glow as the head moves
  • (4) to flash as the eyes move around

 

Head Movement

This was quite awkward and I didn't do any calculations on loading or early testing. When it came to combining the various parts I found that, due to Peter's weight, there was a significant angular momentum. If I moved the head rapidly as I intended this would make the drive belt jump at the end of the sequence. Although that wouldn't be an issue for a few cycles, in time it would mean that Peter's head would wind itself up with the cabling. I really need to add a microswitch to detect and wind back from a set position but didn't take that route. It I tightened the drive belt mechanism (but wedging between the NEMA motor and the bearing block) the extra tension would cause the motor to stall. Instead I opted to slow the whole sequence down somewhat to mitigate these issues.

 

I don't think there is any issue with the axial force due to Peter's mass. The bearing and low friction plate I made seem to be holding up well.

{gallery} Turntable Photos
Sharpened spindle and wooden bearing block

Recessed base to hold metal low friction plate (piece of steel)

Axial low friction bearing surface plate
Pressing in bearing using vice and suitably sized socket bit
The basic turntable layout

 

Software

The software is quite scrappy at the moment and I've kept in much of the irrelevant code from testing out the various component parts. You can find my code on Github HERE should you wish to copy or branch from this code.

 

Audio

I spent all of the weekend trying to add some audio to Peter. This took many different approaches but they all seemed to fail at some point along the way . I started out my downloading some of the fantastic sound tracks from www.freesounds.org

 

Cabling

I made braided cables from each sensor or peripheral back to my Arduino Uno and breadboard. This keeps everything easier to understand and helps reduce errors when setting up.

Braided cables and heatshrink

Arduino Uno Controller

WTV020 Module

A very long time ago I purchased three of these modules but never managed to get them to work. At the time I thought it was the non-standard file format. I used the conversion utility to adapt the files I had downloaded to a small format 4 bit used by the MTV020 module and saved them to my SD card. Even with the basic setup and using wires to trigger the module I was unable to get any of my sounds to play. Internet searches hinted strongly that the culprit is the finicky SD card - some said 2GB was OK and others limited the module's capability at 1GB......I scourered the house for an old 1GB microSD card, looking in old phones and cameras but found nothing.

 

Raspberry Pi

I was able to play an audio file (mp3) using the command line of my Raspberry Pi and the mpg123 music player - taking the audio from the RPi to my desktop speaker system. A loud and evil laughter filled the house (and that wasn't me). I then wrote a Python script that ran the mpg123 when required with my audio file....that too worked well. My next step was to trigger the Python script, which I planned to be running continuously, from the Arduino. I decided to use the serial interface between the boards. When the Arduino was ready for sound it would send an 'x' character across the serial interface. The Python script would detect this and trigger mpg123 to play my audio track.

 

That was the idea but after many attempts I was finding issues with my Arduino not accepting code uploads and eventually the RPi crashed a few too many times......with only a few nights left I have decided to stop this idea as I'm risking ruining what I've achieved so far (e.g. damaging my Uno board).

 

Usual Disaster Strikes (when nearly finished)

Just before filming Peter in action I thought I'd be clever and run the Arduino from the 5v supply on my breadboard. I'm still not sure what went wriong but the breadboard's LED illuminated to show there was 5v and after a few seconds all LEDs went out . I need to check what actually broke but luckily after 30 minutes of swapping parts and a new supply I was back in business and the Arduino was luckily still working.....phew

 

To Do By 31st October

  • Tidy the cables and power from a 12v Sealed Lead Acid Battery - this will allow portability and safety to any inquisitive youngsters.
  • Take my last photos (in case weather or over-excitement damages Peter)
  • Share the Scare (e.g. place Peter outside and let him do his stuff )

 

To Do by 3rd November

  • Make a Fritzing diagram in my final blog
  • Tidy code and reload to my Github page

 

Some Thoughts

  • The stepper motor is noisy - sounds like a steam boat
  • It would be good to be able to know the absolute head position
  • Making an animatronic from the outside-to-in is not an easy task
  • Microsoft seem to have replaced the simple Movie Maker with Photos (but it doesn't do what I want). I therefore installed Animotica from the Microsoft Store and it appears to work really well.

 

arduino, stepper_motor, servo_motor, halloween, arduino_uno, ws2812, sharethescare, #sharethescare, halloween_project, halloween 2018, arduino project