Animation

During the 1996 Christmas season, we tried our first animation. That year we made up seven two dimensional wire frames shaped as squirrels. Each one was laced with 50 lights and was connected to a home built circuit board that lit one frame at a time. This gave the illusion of a squirrel moving across the front of the house.

The circuit board consisted of two integrated circuits, a 555 timer chip and a 4017 decade counter, seven relays, and other miscellaneous parts. The timer chip generated a series of pulses that were fed into the decade counter, which in turn activated each of the seven relays in sequence. Timing is determined by the value of Resistor R1, R2 and Capacitor C1. Values shown in the parts list give a time of approximately 1 second for each frame.

The circuit worked well, and an identical circuit was used to control the bears climbing the candy cane, first used during the 1997 Christmas season. While the circuit was inexpensive and easy to build, the animation effects were limited. The duration of each animation frame was identical, and only one frame could be active at a time. See the figure below for a circuit diagram and a parts list

Parts List - Animation Controller

C1 0.1 mfd Q1 TIP31 R1 10K 0.25 watt resistor R2 1 megohm 0.25 watt resistor R3 1K 0.25 watt resistor RY1 5 volt SPST relay U1 NE555 Analog timer chip U2 CD4017 digital decade counter chip

Note that the circuit can support up to ten relays, which can control up to ten frames of animation. The line labeled reset should be connected to +5 volts if all ten output lines are used or should be connected to one of the unused output lines. I typically connect the reset to an output line 2 greater than the actual number of animation frames. This allows the entire display to go blank for a short period of time.

The picture below shows the circuit mounted in its cabinet.

The lighting for the 1997 season also featured a 23 foot tree that constantly changed color from green to red to white and back to green again. To achieve that effect we used a Basic Stamp computer from Parallax, Inc. to control a bank of X10 lamp modules which were used to dim and brighten strings of lights.

The basic stamp computer connects to the AC line through an X10 powerline interface. The tree took 16 strands of lights. Each strand consisted of three seperate 100 light strings, one of each color, bound together. At the base of the tree five to six strings of each color are plugged into an X10 lamp module set to one of three addresses. The basic stamp computer outputs commands to these modules to dim or brighten the appropriate color, enabling us to gradually fade the tree from color to color. The program listing for this project is shown below.

' Program: XMASTREE.BS2 
' This program controlls a virtual Christmas tree.  The purpose is to
' change colors by fading out (dimming) one color while bringing up a
' different color.

' this program utilizes three x10 devices one each for the three colors
' used in the tree (Green, Red and White)

' Using  XOUT requires a 4-wire (2-I/O pin) connection to a PL-513 or 
' TW-523 X-10 module. See the application note for sources. 

'Declare i/o 

zPin	con	0	' Zero-crossing-detect pin from TW523 or PL513. 
mPin	con	1	' Modulation-control pin to TW523 or PL513. 


' X-10 identifies modules by two codes: a House code and a Unit code. 
' By X-10 convention, House codes are A through P and Unit codes are 
' 1 through 16. For programming efficiency, the Stamp II treats both
' of these as numbers from 0 through 15. 

'Declare all variables and constants

houseA	con	2	' Use House Code C
Green	con	0	' Green color will use Unit Code 0 (A)
Red	con	1	' Red color will use Unit Code 1 (B)
White	con	2	' White  color will use Unit Code 2 (C)
j	var	byte	' looping variable


' We need to first initialize all modules.  When using the dim/bright
' commands, invalid results may be obtained unless the unit is first
' turned off then on to full brightness 

init:	xout mPin,zPin,[houseA\Red]		' Talk to Red Modules 
	xout mPin,zPin,[houseA\unitoff]		' Tell it to turn OFF. 
	pause 5				' Wait 5 ms.
	xout mPin,zPin,[houseA\uniton]		' Tell it to turn ON. 
						' Dim the module
	for j=1 to 5
	  xout mPin,zPin,[houseA\dim\4]
	next

	xout mPin,zPin,[houseA\White]		' Talk to White Modules 
	xout mPin,zPin,[houseA\unitoff]		' Tell it to turn OFF. 
	pause 5				' Wait 5 ms. 
	xout mPin,zPin,[houseA\uniton]		' Tell it to turn ON. 
						' Dim the module
	for j=1 to 5
	  xout mPin,zPin,[houseA\dim\4]
	next

	xout mPin,zPin,[houseA\Green]		' Talk to Green Modules 
	xout mPin,zPin,[houseA\uniton]		' Tell it to turn OFF. 

'all modules are now properly initialized.  red and white are fully
'dimmed and the green module is on at full brightness.

begin:	pause 7500				'wait 7.5 seconds
	for j=1 to 7				'dim green and bright red
	  xout mPin,zPin,[houseA\Green]
	  xout mPin,zPin,[houseA\dim\4]
	  xout mpin,zPin,[houseA\Red]
	  xout mPin,zPin,[houseA\bright\4]
	next

	pause 7500				'leave red up for 7.5 seconds
	for j=1 to 7				'dim red and bright white
	  xout mPin,zPin,[houseA\Red]
	  xout mPin,zPin,[houseA\dim\4]
	  xout mPin,zPin,[houseA\White]
	  xout mPin,zPin,[houseA\bright\4]
	next

	pause 7500				'leave white up for 7.5 seconds
	for j= 1 to 7				'dim white and bright green
	  xout mPin,zPin,[houseA\White]
	  xout mPin,zPin,[houseA\dim\4]
	  xout mPin,zPin,[houseA\Green]
	  xout mPin,zPin,[houseA\bright\4]
	next

	goto begin				'start all over again

	end



The photo below shows the cabinet housing the basic stamp controller and the X10 modules.

Our work with the Basic Stamp convinced us to use it as the heart of all future animation projects. This year we'll have two animation projects. The first is a Toy soldier firing a cannon. The second is a Jack-in-the Box. Both require that various sections of the animation be lit simultaneously and for diffiring periods of time. The basic stamp computer made it easy to set this up.