Intro: Computer Controlled Star
In this instructable I am going to show you how to build a Star with 64 LEDs. The Star operates by itself but the operation mode can be changed when connecting it to a computer via a serial (RS232) interface. After reconfiguring the Star via the computer, the Star will use the new operating mode as the new default.
The Star can of course be used during the Christmas period but it can also be used as a night light on a children's bedroom since the stars has various modes that could help kids to go to sleep. This has not been proven by research :-).
To summarize, the star has the following main features:
- Control 64 LEDs individually with different brightness. The brightness can be set from 0 (off) to 15 (maximum). The Star uses an initial pattern when switched on but this pattern can be changed via the serial interface.
- Blinking mode, which is changing the brightness of the individual LEDs to create a blinking Star effect. A variant to the blinking mode is the sparkling mode. See the attached document in one of the next steps for more info on this.
- Test mode. This mode can be used to see if you build the star correctly.
- Flashing Star mode. In this mode you can program your own sequence of LEDs that the Star will then use to switch these LEDs on and off one after another with the given brightness.
- Random mode. The random mode can be used in various ways, e.g. for generating random Star patterns but also to create a random flashing Star pattern.
- Auto off mode. When activated, the LEDs are slowly turned off. This is a nice feature when you use it in a children's bedroom ('You have to sleep before the star is off :-)".
My hobby is in electronics and software development and I am not an expert in mechanical constructions so feel free to create your own variants. The housing is built using 8 mm and 4 mm MDF, glued with wood glue. The electronics is based on a PIC microcontroller.
See the following video in which the various functions are demonstrated. Since the LEDs are multiplexed, it may sometimes be a bit difficult to see the exact changes in operation but I think that in most cases it is visible.
Step 1: Step 1: Star Ingredients
So you need to have the following to create this Star:
- 8 mm MDF panel
- 4 mm MDF panel
- 1 strip of wood of 4 mm by 9 mm
- Wood glue
- 1 bread board for assembling the electronics
- Paint. I used Silver colored paint
- 64 * White LEDs (in fact I only mounted 63 LEDs)
- 1 * Yellow LED
- 1 * Fuse of 200 mA/Slow + fuse holder
- 1 * 9 pin Female D-Connector
- 1 * PIC microcontroller 16F1825 + 14 pin IC socket
- 1 * MAX232 RS233 driver IC + 16 pin IC socket
- 2 * 74HC595 shift registers + 16 pin IC sockets
- 1 * LM2940 Low drop 5 Volt regulator
- 1 * 1N5819 Shottky diode
- 1 * 33 k resistor
- 5 * 1 uF/25 Volt electrolytic capacitor
- 1 * 47 uF/16 Volt electrolytic capacitor
- 1 * 470 uF/16 Volt electrolytic capacitor
- 5 * 100 nF ceramic capacitor
- 8 * BC557 transistor
- 8 * BC639 transistor
- 8 * 2k resistor
- 8 * 1k resistor
- 9 * 220 Ohm resistor
- 1 * 16 pin female header (I used 17 pins but that is not mandatory)
- 1 * 16 pin male header (same remark about the 17 pins)
- 1 * DC adapter, 6 Volt/200 mA
Step 2: Step 2: Building the Electronics
See the attached schematic diagrams that show the following parts:
- Power supply with PIC microcontroller and RS232 interface
- Shift registers
- LED output drivers
- LEDs in an 8 by 8 matrix
The first three parts are assembled on a bread board. The LEDs are mounted on a front panel as described in the next step.
LEDs and bread board are connected using a female header on the bread board and a male header for the connection with the LEDs on the front panel.
With the attached Intel Hex file you can program the PIC microcontroller.
Step 3: Step 3: Creating the Front Panel With the LEDs
The front panel is made with 8 mm MDF and contains the holes for all 5 mm LEDs. Before I mounted the LEDs, I first sprayed the front panel with Silver paint. Note that only 63 LEDs were mounted because otherwise it would not give a symmetrical layout.
The LEDs are connected in a matrix of 8 by 8 according to the schematic diagram given in the previous step. I used Kynar wire to connect the wires. It is recommended to use different wire colors as much as possible. The wires are finally connected to the 16 pin Male header. The order of the wires is not important. It is only important to remember which wires are the scan lines and which wires are the return lines. Note that the Male header has to be mounted after the wires have gone to the back panel, see the next step.
For the front panel to be connected to the back panel you need a small trip of wood that is glued around the edges of the front panel as shown in the photo.
Step 4: Step 4: Creating the Back Panel With the Electronics
The back panel must be exactly the same in size and shape as the front panel but must also serve as pedestal. Both the foot as the back panel are made of 8 mm MDF.
The electronics is mounted at the back of the back panel. A box is made of 4 mm MDF in which the bread board fits. A hole is must be made in the back panel for the wires of the LEDs from the front panel to go the back of the back panel.
At the lower edge of the box, holes should be made for the adapter cable, the Yellow power on LED and the female RS232 D-connector. After that, the bread board can be mounted via the bolts that are coming in from the front of the back panel.
When the bread board is assembled, the wires from the front panel should be connected to the male header which should then be plugged into the female header on the bread board. After successful test of the operation of the Star, the front panel must be glued to the back panel using the small strip of wood.
The back of the box is also made of 4 mm MDF and is glued to the box after successful test of the Star. I used only one small dot of glue per side so that I could remove the back of the box easily by cutting the glued parts with a Stanley knife.
If everything is glued and done, the rest of the star can be painted.
Step 5: Step 5: Operating the Star
When you turn on the Star for the very first time, it will use a default brightness pattern and the LEDs will be blinking in a random order.
As said before, the operation of the Star can be changed by using the serial RS232 interface. A simple protocol is used to change the behavior of the Star. The attached document describes all the operating features of the Star.
If your computer does not have an RS232 interface you can use an USB to RS232 converter which can be plugged directly into the Star. If your computer has an RS232 interface, use a non-twisting cable to connect the computer to the Star.
You can use a simple Terminal Emulator like Termite for operating the Star but you can of course also write your own control program.
It is also possible to create a batch file for operating the Star, see for example the attached batch file that I created to demonstrate the various features. This batch file was used when creating the Video.
After having changed the operation mode of the Star, the Star will use that new operating mode. It is not required to have a PC connected to the star.
Have fun creating this Instructable.