|
Build a Model Lighthouse
by Michael Simpson

Every year I try to add a new piece to my little
holiday village. You know the kind. They are made out of
ceramic. Some have lights and others may even have moving
parts.
This year I decided to add a rotating light house.
After purchasing a rather expensive one the mechanical portion of
the light failed which made the piece useless. It also tended
to glare as the light rotated. There was also a problem with
the noise.
After returning the expensive lighthouse. I
decided to create my own. To do this I purchased a much
cheaper light house and added my own little simulated rotating
light.
The keys is to ramp up the brightness of the light
until it peaks then ramp it back down.
Components
I decided to use the Athena for this project for a
couple of reasons. It has a built-in PWM generator that we
will need to vary the voltage going to the lamp. It uses a
very simple basic type language and only costs $6.95.
For the lamp I decided to use a bulb from one of
those light stringers that contains 35 - 50 bulbs. I
purchase a whole string for about $3. By purchasing the whole
string I get plenty of other bulbs for other projects plus sockets
for them.
All the components will be listed at the end of the
project.
Hookup
First lets get our lamp setup. You will
need to cut a single lamp from the string. All the lamps on
most strings are connected in series. Once the lamp is cut
free it will look something like the on in Figure 1.

Figure 1

Figure 2
You will have to connect the loose end near the bulb
as shown in Figure 2. Please note that if you use a bulb that
comes from a larger string you may have to change the duty cycle
used in the hwpwm commands.
Schematic 1 shows the complete hookup. I used
a 100mw 7805 in a T92 package. If you use another
microcontroller of type of lamp you may need to use a larger
regulator.

Schematic 1

Figure 3
I used the Athena Carrier 1 board as a base for the
circuit shown in schematic 1. A little hot glue to provide
some strain relief for the lamp leads and the power input leads.
The circuit is simple and placement is not critical so you can use a
simple perfboard if you wish.
I used a 7.5v switching AC adapter to power the
board. You can actually power several boards from a single
power source.
Program
(download it here)
dim x
dim speed
'Set up PWM signal
hwpwm 1,255,1
output 6
speed = 15
loop:
for x = 20 to 150 step 1
hwpwm 1,255,x
pause speed
next
for x = 150 to 20 step -1
hwpwm 1,255,x
pause speed
next
hwpwm 1,255,0
for x = 20 to 150
pause speed
next
goto loop
The program is quite simple. After setting up
the PWM port three for/next loops are executed continuously.
The first for/next loop does a ramp up on the
brightness of the lamp by increasing the duty cycle of the PWM
signal on port 6 of the Athena. This simulates the lighthouse
lamp moving toward you.
The second for/next loop does a ramp down on
brightness of the lamp by decreasing the duty cycle of the PWM
signal on port 6 of the Athena. This simulates the lighthouse lamp
moving away from you.
The last for/next loop actually simulates the time
the light house lamp moves away from you.
You can change the overall rotation speed by setting
the speed variable to another value.
Mounting

Figure 4
The actual mounting of the lamp and the circuit
board will be determined by the light house you use. In mine I
cut the original top of the light house and replaced it with a small
glass candle holder.
I created a base for the bulb by using a piece of
foam board held in place with hot glue. The bulb holder was
then attached to this base and the leads run out the bottom of the
lighthouse.
Parts
Easy RS232 Driver
Athena
Athena Carrier 1
2N2222 Transistor
100 Ohm Resistor
7805 (100ma)
7.5V AC Adapter
9 Pin Cable
Breadboard and
Wire Kit
|