Mid-Air Oscillating LED Sign

By Josh Wardell
Junior Design Project April 1999


Construction


Parts and Equipment:
1 Microchip® PIC 16C84 microcontroller
174HC241
7T 1 1/2 diffused blue LEDs
747 W resistors
17805 5V voltage regulator
19V battery
1PC board
1various Legos® including motor and gears
1PC with PicStart Plus programmer and MPLAB programming software
1variable power supply (‰6V, 500mA)
I will first start with the construction of the Lego assembly, as this may be the simplest part. Various common Legos were used to build something that was sturdy so that any wobbling would be at a minimum. Legs on the bottom gave it a large bottom surface area so as not to tip. At the top, the spinning axle was secured to the assembly at several points to reduce any motion that a perfect spin, as that would add extra torque to the motor. The standard Lego motor was used, with its axle on a horizontal axis. It was powered by an external power supply, variable to vary the speed of rotation. A 90° gear was used to adapt it to the vertical axis of the main axle. The largest Lego gear was used so that a maximum amount of rotational speed could be obtained. The main axle was fixed to the top Lego board, to which the electronics PC board would be attached. The best way to duplicate this is simply to reference the picture below:
The microcontroller used was the Microchip PIC 16C84, a general-purpose microcontroller that is very widely used by hobbyists and excellent for this application. It is in an 18-pin DIP enclosure, thirteen of which are I/O pins. It is pictured below, below a much larger PIC 17C44, along with its pinout:
In order to program the chip, a PC with a programmer and programming software are required. I used Microchip's own PicStart Plus programmer, and their full suite of software, MPLAB, which includes an editor, assembler, linker, and simulator. The 16C84 is EEPROM based, so it does not need to be UV flash erased with each code change, a definite convenience.

The assembly code is attached at the end of this report. To explain simply, the lower 7 bits of Port A were used as outputs, one for each of the LEDs. This port direction and timers were initialized. The chip was then thrown into a continuous loop to display the message. The message is displayed by jumping to a subroutine for each text character to be displayed. These subroutines passed values into the port to turn on or off each LED for each column to be displayed (this is passed in binary and therefore it is easy to see the actual characters in the code if you look at the 1's and 0's sideways). Between each column a delay loop was run so that the LEDs would stay on for a certain amount of time. The code in reality stepped linearly though each column of pixels for each character in the text message. Note the code attached displays my name, "Josh W."

Next is the assembly of the PC board and the electronics. If you are a perfectionist at soldering like me you will need to set aside four hours for this. Note the attached schematic for connections and placement. All components were attached with DIP sockets so they were reusable, including the LEDs, which were in a 90° DIP socket to mount them vertically.

Because this board is rapidly spinning there is no way to get power up to it without some kind of complex rotational contacts so a battery is needed to power it. Because everything on the board needed a minimum of five volts and stacking up a bunch of AA batteries would add unneeded weight and mounting complexity, I decided to use a single 9V battery. This was attached with a standard 9V battery clip, directly centered on the axis of rotation so its relatively large mass would not cause the board to wobble.

All components operate at +5V TTL levels, so a 7805 voltage regulator was used to bring the +9V of the battery down to a perfect +5V. This also allows for the battery to vary in voltage as is common throughout its life; in my experimenting it still operated with a voltage of merely 5.5V. The resistors for the LEDs were also adjusted to give approximately 15mA per LED at this voltage, and the value that brought me closest to this in my case was 47W. Note that blue LEDs are new and therefore inefficient; they have a much larger voltage drop that most other LEDs, and at the same time are more sensitive, so I gave them 15mA instead of the suggested 20mA.

A four MHz TTL oscillator was used, which is a common clock speed for my microprocessor, although it can support up to 10 MHz. Speed is not needed, however, as most of its time is spent in delay loops, so a slower speed is more ideal as well as more stable.

Another main chip used in addition to the microcontroller was the 74241 gate. This chip can be configured to do a few different tasks but in this case was just configured to be a gate. The I/O ports of the µcontroller do not support enough current to drive the LEDs. Instead of using several transistors, the 74241 was a simple, compact component that serves the same purpose. It can drive its outputs at about 20-25mA, so it was perfect for this purpose. It was configured simply to make the output high if the input was high. Refer to the attached schematic for its pinout. All assembled (without the battery), the board appears as pictured below:

If the project were assembled and run at this point, you might catch the text being displayed, but it would be very hard. The message needs to be aligned so that with each rotation, it is displayed in exactly the same place. In a fit of despair I accomplished this by shorting out the entire board each time around. Two wires dropped below the spinning board, from +5 and ground, and hit a piece of metal for a split second each time around. This was enough to reset the µcontroller so that it would begin the program again, and worked surprisingly well. Because this short was occurring after the voltage regulator, it was not directly shorting out the battery and therefore not as dangerous. Below is a picture of the fully assembled project:

-Next-

Top - Introduction - Conclusion - Schematics - Source
Home - About - Email



Updated 9/6/99
This project, these pages, images, and source © 1999 Josh Wardell