loading

This is an infinity mirror real time clock with date display, patterns and sleep mode.

The micro controller is a PIC18F2550. a cheap 8 bit micro controller.running in PLL mode at 48MHz.

There is also an hourly melody played based on the UM66TXXL chip.

The real Time clock is based around the DS1307 chip.

An infinity mirror is 2 mirrors facing each other, one of which is a 2 way mirror for you to look in on the action, the light bounces back and forth creating an illusion the lights go on forever.

It is based around the very cheap and available RGB LED strips type WS2812B 3 wire addressable, that can be bought on ebay for a few dollars. The strip to buy is 60 RGB leds per meter. You need 1 meter. This is an ideal number for a clock of course.

There are 3 buttons for setting the time and date, another button that displays a lot of amazing patterns (not all of which are seen in the video) and a sleep button.

The next step is creating the clock housing.

Step 1: Making the Clock Case

The case is a basic box measuring about 460mm x 460mm x 60mm.

I cant go into making this too much as I didn't document or photograph it as I progressed.

I made it from 12mm pine for the frame, 3mm ply for the back cover and some nice grained hard/soft wood for the front face.

The front face needs to be removable. There needs to be enough space inside for the circuit boards, of which there are 2 , plus the 5v 6 amp power supply. (available on ebay)

The front face also acts like a sandwich to hold the front 2 way mirror in place. Also mounted on the front face is the circuit board that contains the 5 push button switches.

The back panel needs a hole cut for the mirror to be visible. The mirror is a cheap bathroom round type available from most home decor stores. Mine is 400mm diameter.

The hole needs to be 318.4 mm diameter. this is the 1 meter length of the LED strip (1000mm) divided by pi which gives you the diameter for the hole.

Mounted over the hole is a 3mm plywood cylinder the same diameter ON THE INSIDE as the hole and about 4mm shorter than the top of the frame. This is to allow the 1 way mirror to be placed underneath the front face.

I suggest you measure the LED strip first. You need the length of 60 LEDS plus 1. There should be a gap between the first and last LED's. The gap being the same as the distance between 2 adjacent LED's.

So when the LED's are fixed in position there should be 60 equally spaced LED's. The First LED being at the very top, 12 0'clock.

A hole for the LED cable should be drilled at the top of the plywood cylinder about halfway up.

I found I had to strengthen the cylinder with some MDF around the top and bottom.

The front face also has a hole the same size as the inside diameter of the cylinder, this can be beveled for good appearance. There is also a cutout for the date display to show through. This needs to be large enough for 10 x 7 segment displays end to end. The 7 segment displays I used are .56 inch type with a black face.

Step 2: Mount the Rear Mirror

The rear mirror should be mounted on the back of the case over the hole.

I used small pieces of timber to hold it in place.

Be care not to fasten in a too rigid manner, glass doesn't bend very well.

Step 3: Make and Mount the Front 2 Way Mirror

The front 2 way mirror is made from ordinary glass, 3mm thick. about 400mm x 400mm

On one side (the side facing outwards) some auto widow tint or home window tint is applied.

The window tint has a mirror finish on the OUTSIDE when applied to a car. But we want the mirror on the inside, facing the rear mirror so they both reflect to each other.

The tinting is applied by applying a light spray of soapy water to the glass, pealing off the tinting protective layer and placing on the glass, mirror side down.

Work out the air from under the tint with a squeegee, you don't want any bubbles under it.

The finished 2 way mirror is mounted under the front face plate. I made corner pieces inn the case to hold the mirror in place. The corner pieces also act as the mounts for the front face fixing screws.

The cylinder under the 2 way mirror should be fractionally lower than the glass when in place. pressure on the glass when screwing on the front face will break it.

Step 4: The Electronics

There is 3 circuit boards.

The main micro processor and controller board (a PIC18F2550), the 7 segment display board and the switch board.

Also there is a 5 VDC 6 Amp power supply.

These LED strips draw a lot of current; 60 Red, Green & Blue leds = 180 LED's total. At around 25mA each that's a total of about 4.5 amps if all are on and displaying full white, plus the 10 x 7 segment displays ( 2 of which only display a dash) = another 58 (possible) led's, another 1.2 amps.

The micro processor has to work hard to output a stream of 60 x 24 bits to address all the LED's.

This gives a 24 bit color resolution to each RGB. The data stream continues thru all the LED's until a 60mS delay is detected and then the leds display the data.

The main board also has the RTC which has a backup battery, a melody chip and a small piezo sounder for when you press any buttons.

The melody chip I used was "Home Sweet Home". If you choose a different melody you may have to change the timing in the code to turn it off after the melody has finished, otherwise it will continue to repeat.

The line of code to look for is in the "void Run_Clock()" routine;

if(minute == 0 && second == 26){delay_ms(500); Melody_Out = 0;} // turn off melody chip after 26.5 seconds

Step 5: The Main Board

This is a double sided board. The solder side power plane is 0 volts, the component side power plane is +5 volts.

Some component legs need to be soldered to the top side where there are any tracks or power plane to the pad.

Most other holes have a wire link through from top to bottom.

This is NOT a thru plated board.

If you decide to have this manufactured then thru plating would be all the better.

Step 6: The Display Board

Again this is a double sided board. The solder side power plane is 0 volts, the component side power plane is +5 volts.

The 7 segment displays I used were what I had on hand. There are 4 x double and 2 x single (for the dashes)

The date is displayed as day month year (dd/mm/yyyy)

This display is also used for when you are setting the time and date. A decimal point is shown next to the digit being edited.

Some component legs need to be soldered to the top side where there are any tracks or power plane to the pad.

Please note the SIL 6 way header is on the solder side of the board.

Most other holes have a wire link through from top to bottom. This is NOT a thru plated board.

If you decide to have this manufactured then thru plating would be all the better.

Step 7: The Switch Board

Again this is a double sided board.

The solder side power plane is 0 volts, there is no power plane on the component side.

Please note the SIL 6 way header is on the solder side of the board.

This board is used for when you are setting the time and date.

A decimal point is shown next to the digit being edited.

The top button (SET) is held down while setting time and date.

The NEXT button moves you through hours, minutes, month, date, year on each press. The cycle will continue to repeat on subsequent presses.

When you have selected the required time or date to be changed, pressing the INC button will increment the digit. This also cycles.

When all is right, release the SET button and the clock will display the correct time and date.

Most other holes have a wire link through from top to bottom.

This is NOT a thru plated board.

If you decide to have this manufactured then thru plating would be all the better.

Step 8: Installing the Boards and LED Strip

The PSU was difficult, it was a bit bigger than I had expected after it arrived from ebay.

I removed the lid and managed to squeeze it in somehow!

When you are designing your case be sure to allow enough room for the PSU.

The Main board is mounted at the top, the leads from the LED strip are not very long and have to reach the board.

The PSU is in the other corner. Be aware this will have mains voltage on it. Be careful if you are doing live trouble shooting.

MAINS VOLTAGE IS VERY DANGEROUS AND CAN KILL.

The Display board is at the bottom under the 2 way mirror where it shows through the cutout in the front face plate.

The Switch board is simply screw to the back of the front face plate, with holes cut for the switches to go through.

The Display and Switch boards are connected to the Main board with ribbon cable.
Be sure to orient these connectors correctly.

The small load speaker can go wherever you please, I mounted it close to the Main board facing to the back. Small holes were drilled in the back cover but probably was not necessary.

Fixing the LED strip to the inside of the cylinder is easy.

These strips have a self adhesive strip on the back face.

Be sure to clean thoroughly the surface where the LED strip is going to be stuck. Use alcohol or white spirit. Any dust or grease here and the strip will just fall off after a short time. They do get a bit warm.

Feed the cable and connector of the LED strip thru the hole at the top of the cylinder.

Pealing off the paper protective strip as you go, without touching the adhesive, and starting from the top working clockwise around the cylinder, press firmly in place.

The LED strip needs to be about halfway up the cylinder wall, keep it straight and parallel. It should finish up with the last LED having a gap to the first LED, the gap should be the same as all the other spacing on the strip.

If you did the measurements of the strip as mentioned earlier, and you made the cylinder correctly, all be be well.

Step 9: The Code

The code for this clock was written in C using MikroC Pro for PIC from Mikroelektronika.

This software has all the necessary libraries built in.

Write the Hex file to the PIC18F2550 using your favorite method, I use PICkit 2 v2.61 and a iPC02 programmer hardware.

This needs to run at 48MHz, there is some very short (400nS) pulses being sent to the LED strip.

The code is well commented.

Settings for the PIC are within the files, but if you are porting to a different compiler and editor then the main settings are:

Osc = ext HS, PLL enabled

PLL prescaler = divide by 5

Primary osc /2

int/ext switchover = disabled

power up timer = enabled

watchdog timer = disabled

CCP2 MUX bit = disabled

everything else = disabled.

There are some library routines you would need to port also if a different compiler is used.

The circuit schematics, circuit boards and software/firmware is solely created by me except for some of the pattern routines I found at www.Libstock.com. Thanks to drumissimo the author.

Step 10:

<p><strong>Code updated.</strong></p><p>There was an error in time keeping when returning from the patterns display.</p><p>Please see new code on the last page.</p>
<p>Cut a hole in the center of the back mirror, cover that hole with semi-reflective mirror like the front one. then mount the leds for the clock behind the hole in back mirror to show clock floating in the middle. </p>
<p>I don't think I would want to risk wrecking a $15 mirror trying to cut a hole in it.</p><p>Perhaps if it were made of Plexiglas maybe.</p><p>But thanks for the suggestion.</p>
<p>HELLO , GOOD PROJECT I like I want to do for a disco IN COLOMBIA BOGOTA , could help me .</p>
<p>Awesome clock setup.</p>

About This Instructable

16,841views

239favorites

License:

Bio: I'm retired, living in Amazing Thailand with my wife. These are my hobbies, pretty much full time now. Isn't it great to retire ... More »
More by ItsGraGra:Infinity Mirror Clock with Patterns, Date and Chime 
Add instructable to: