Halloween Dragon Prop

by inclined-orbit in Circuits > Arduino

941 Views, 2 Favorites, 0 Comments

Halloween Dragon Prop

dragon-halloween-decoration.jpg
Animated Dark Night Dragon | Grandin Road

The video shows the stock Dragon prop you get right from the store. At this time, all my Halloween stuff is still in boxes and I have yet to set it all back up. I've been doing some adjustments in the electronics now and then. I'll try to set up the prop with the electronics and take a video and update this later. This prop was in the Spirit Halloween store and was not working so I got it cheap. Easy enough to fix, a few busted wires and things... got it working but I wanted to do a bit more with it.

If you've seen any of my other props, I use a remote Passive Infrared (PIR) sensor I place in a strategic spot on the way up to the door. As they come up my driveway, the sensors kick off several props along the way as the kids come up the driveway. I can also remotely manually start the prop if I want.

I use an Arduino for each prop to detect if the prop is enabled, if there is a remote start or if the sensor picks up someone.

Supplies

Dragon Prop

Fog machine, connecting hoses

Remote Fog Machine Cable

Super Bright Red LEDs (2)

3-wire conductor cable (AR)

Master Controller:


  • Arduino Nano Every
  • Arduino compatible Relay Board


Sensor Assembly:


  • PIR sensor (HC-SR501)
  • 6" black PVC pipe
  • 3-D Print PIR Cap
  • 3-D Print PIR mount
  • 3-D Print stand (legs, wedge, clamp)
  • Hex bolt, washers and wing nut
  • Connector for cable to mater controller (AR)

Prop Hack!

This prop is pretty simple. It did most of what I wanted, but there were a few things I wanted to improve (at least to start with). The prop has a jack for a remote switch pad and an IR sensor built into the prop. There is a slide switch on the prop to select from manual (pad switch) or auto (using the internal PIR sensor). If either of these are selected, the prop first lights up its eyes, an audio track starts, the head moves back and forth, the wings flap and fog comes out of its mouth. There is a sound track that kicks off with a small speaker internal to the dragon and there is a connection for a fog machine.

Several things I wanted to upgrade:

1) The sound was not loud enough.

2) I wanted it to look like fire was coming out of it's mouth.

3) I needed to externally start the animation.

1) Fixing the Sound

dragon-schematic.jpg

I wanted to place this dragon up on a balcony and I thought the sound was not loud enough. I wanted the sound to carry down the driveway and the kids could see the dragon as they approached. Lucky for me the prop has an external audio output. Taking a look at the schematic, I used an old audio amp and a big speaker hidden behind the dragon. When the audio is initialized, I can increase the volume to whatever I want (the whole neighborhood can hear it if I wanted to). My audio amp has a remote control so I can control the sound remotely from my garage lair.

I was also thinking of adding some sort of continually looping background sounds to give the whole place a spooky atmosphere.

2) Fire Breathing Dragon!!

The prop has LED eyes that light up. The fog comes out of the mouth but I wanted it to look like fire as well. My idea was to use super bright red LED's in the mouth. As the fog comes out, the red LEDs will make the fog glow and look like fire. I could remotely drive the LED's, maybe make then flicker, but for now I just used the same output that drives the eyes to drive the LED's.

I drilled two holes in the back of the dragon's throat and installed two LED's. I did some measurements and found that the prop current drive was current limited and tested adding the two LED's and it works. I spliced into the LED wires, used hot glue to fix the LED's and extra wires. Easy!

Now it looks like fire and smoke coming out of it's mouth.

3) Externally Triggering the Prop

This is pretty simple. I soldered a monaural audio jack to a long cable and plugged into the external trigger input. I feed that cable to my master controller in my garage. That is where the Arduino controller, Photon WiFi, etc is located. See the schematic. I'll get into that a bit later as well as the code to run this whole thing.

Wrapping Up the Prop

I also have a dedicated fog machine attached to the prop. It provides lots of fog and has an external control cable to start the fog when the animation begins. I have one that has a reservoir and it lasted the whole day, no problem.

PIR Sensor

PIR.png

I use a simple PIR sensor (HC-SR501). This is a very cheap sensor that is widely used. Lots of on-line information on how to use this and how to use with an Arduino. The field of view is very wide. One could adjust the sensitivities but I needed something that would have a very narrow field of view so that it would only trigger when someone passes directly in path of it. You can experiment with the sensitivity so that it works as you like. The output timing is how long the output pulse lasts. I kept it pretty short, long enough for my micro controller and code loop to detect an event. It is a pretty long length of wire, but it seems to work OK.

So I came up with a sensor assembly that I can mass produce and use for all my Halloween props.

PIR Sensor Assembly

PIR_Cap.jpg

The assembled cap is placed on the end of a 6” length of 2” black PVC pipe so that the PIR has a very narrow field of view. The end of the cap also has a hole in the back for the +5VDC, GND and PIR Detect cable. I made up my own connector where one end plugs into the PIR 3-pin header and the other end is a JST-SM type 3-pin connector (no reason, I just had a few of those hanging around).

Finished Sensor

PIR_Mount.jpg
PIR_Sensor.jpg

I also 3D printed a clamp and legs so I can set the sensor in the best location. I used wing nuts to quickly adjust the legs and clamp as needed.

The sensor is positioned in such a way that when the trick or treaters approach it kicks off the animations just at the right time automatically. The PIR Sensor is connected through a long-shielded cable to the master controller, which I hide in my garage along with my air compressor.

Schematics and the Circuits

dragon-schematic.jpg

Now that you have your personal touches added, you need a way to make it come to life!

As I mentioned previously, I have several other animated props other than this one. I won't go over all the the others, but here is the link:

https://www.instructables.com/Halloween-Animated-Knights/

The Knight Halloween Instructable goes into much more detail on the overall master controller, how I distribute power out to each prop as well. I will focus mainly on the microcontroller and code for this prop.

The picture here is the primary schematic for the controller for this prop. The schematics on power distribution, switches and the Particle Photon control is in the main Halloween page.

In this example, you need a smart device to run some code, like an Arduino. In this implementation I used a Arduino Nano Every. Not shown in this schematic I have a Particle Photon I use for remote control of all my props. The Particle Photon has an Arduino compatible microcontroller and also includes a Wi-Fi transceiver so you can control the whole thing anywhere using my phone, pad or PC. I used a relay board to initiate the prop.

The prop out of the box has several ways to start the animation. One is a push button "Try Me" for display demos (you see that in the store displays). It also has a jack for a remote pad switch. The last is an IR sensor built into the Dragon that will trigger if someone comes close.

The electronics box has a switch: OFF or Try Me/Pad, On ( runs all the time) and AUTO. Off is off (duh) or only starts if the switch is closed. ON cycles through the animation continuously. AUTO uses the IR sensor installed onto the prop. I left all that in and use the OFF or Try Me/Pad selection. I fed that long two-wire cable I made earlier out to my controller so that I can remotely start the prop. By shorting those wires through a relay, it acts as a switch and the animation starts.

Schematic Walk Through

Back to the schematic......

For this prop I used one relay to start the animation (switch). The Arduino controller has three inputs. There is an Enable input, which is connected to a switch and used to enable or disable the prop locally. Another input is Dragon_Start. This is a signal from the Particle Proton. Another input is a Passive Infrared (PIR) sensor (PIR C). The PIR sensor detects when someone comes close to the prop. See previous Sensor description. The Nano is programmed to first check if the prop is enabled (the local switch), if not it returns to the start loop and will continue looping until I enable it. If enabled, it then checks to see if it is being remotely commanded to start (Dragon_Start) from the Photon. If so, it initiates the animation cycle, if not it continues and then checks to see if the PIR sensor (PIR C) detected someone. If not, it returns to the loop and continues until something happens. I'll go through this in the code walk-through shortly. The Nano outputs controls the relay to simulate the switch transmitted to the prop to start its animation cycle.

Code Walk-Through

code1.jpg

The attached is the code for controlling this prop that I have in the Master Controller. This is one of 5 Arduinos I use to control all my props.

As I mentioned I have a master controller, along with the pneumatic solenoids and air compressor located in my garage that controls the whole thing. I'm going to mainly focus on the code for this prop. The Arduino Nano code starts off defining the digital pins followed by defined variables. Not only do I define the variables I preset them to initial values so animation doesn’t start once the loop begins. The next section sets up and defines the digital pins as inputs or outputs and whether they need pull-up.

Define Pins and Variables

code2.jpg

Here I define the variables and pins as inputs or outputs.

Loop() Function

code3.jpg

The first thing I do is digitally read the enablePin, sensePin and manualStart inputs and place those values into the variables enableOn, sensed and start. The first thing I check is if the prop is enabled (enableOn == HIGH). If not, continue to loop until it’s enabled. If enabled, the next check is if the sensePin is enabled (stored in the variable sensed). This external signal is from the PIR sensor to detect if someone approaches the prop. If a person is detected it calls the animate() function which starts the prop animation. If it is not detected, we lastly check if there is a manual start coming from the Proton through the BLYNK app on my iPhone or Tablet. If activated, we again initiate the animate() function.

The BLYNK app allows me to manually start the props from where ever I am. In the house, across the country - doesn't matter. This app is WAY simple so I did not have to attempt any iPhone coding or GUI - this app has it all and has a simple GUI. I made up a bunch of GUI buttons for each prop. I might also say it's free, for small projects and private use. Lets walk through the animate() function.

Animate() Function

code4.jpg

The animate() function first turns on the on board LED on the Arduino Nano to let me know when the animation sequence has started.

Once I turned on the Arduino on-board LED, I set the output to enable the Relay board to close (relayPin, LOW) which closes the relay which initiates the Dragon animation cycle. The next step is a fixed delay (400) that makes sure the relay closes and that the pulse to the prop is long enough. The next step is resetting the relay so that it just gives a pulse long enough to start the animation (relayPin, HIGH). I have a pretty long cable so I wanted to make sure it settled enough at the prop.

We use a constant delay (event_done). This constant is adjusted to last as long as the longest prop animation cycle. Some of these things have random sayings, so run through them all and time it so that the dealy will allow them to finish before restarting. Once that delay is complete, the whole thing is done and time to reset and get ready for the next event. Once event_done times out, I turn off the Arduino on-board LED. The code now returns to the main loop and waits for the next event.

Files

I've included the entire Master Controller schematic for reference.