Instructables
Picture of DIY TiX Clock
Here's my instructable for a DIY TiX clock.  It is powered by an AVR microcontroller.  The display is made up using a piece of reflector grid you find covering office lights, some smoked perspex, a diffuser and a bunch of LED's.  The Idea came from the Tix clocks you can buy at various places on the web, but nothing beats making it yourself.  It is a talking point in the lounge and once you are used to reading it, you can tell the time in a jiffy.


 
Remove these adsRemove these ads by Signing Up

Step 1: The Electronics

The first prototype was made using Vero strip board.  The layout on strip board is fairly straight forward.  The Transistors in the top left are row drivers and the IC's on the right are  transistor arrays that are the column drivers (see circuit diagram at the end of instructable for more info).  This allows me to get a bit more current to the LEDs to make them brighter.  The Transistor array IC's can be replaced with transistors if you like.  You will find circuit diagrams and software at the end of this instructable with which I have included an Eagle PCB layout design as well for a single sided board that combines the controller and display board into one.

Note that if you etch your own PCB the LED's are mounted as normal thru hole components but the IC's, links and other components are placed on the copper side of the board.  The LED's and links will need to be mounted first as the AVR covers some of the LED solder points.  Details in the pictures.

Step 2: The Display

The display is made up of a sandwich of the display Board, The square reflector, a diffuser and a smoked perspex window.  You can place a sheet of tinfoil under the LED's to give more reflection, just make sure you cut a hole in tinfoil around a legs of each LED so it doesn't short things out.  I also sanded the lens of each led to distribute the light more.

The first three photos show the strip board version, the remainder the etched PCB version.
robkirk24 days ago

hi gweeds back again lol i mbuilt it on breadboard and programmed it fine it seems as though im having the same issue as the russian guy, with one full horizontal row permantly on and the last 3 leds in vertical off i swapped a cable like you said before but just wondered if he managed to solve it damm i wish he just spoke english lol.

gweeds (author)  robkirk24 days ago
Hmmm, maybe I got the JTAG fuse bit around the other way. Change the JTAG fuse bit, reprogram and see what you get.
robkirk gweeds24 days ago

hiya iwonder if theres some missing data on the hex file you posted as a right clikc save as in the picture there are some fields blank. thanks mate

tixm.png
robkirk robkirk23 days ago

its a shame as this is a great project and i have learnt alot but was hoping it would work so i could build it full scale :/

gweeds (author)  robkirk23 days ago

Oh don't give up hope, it does work I have one here that works fine. I also have someone else who built one and has it working.

repei gweeds12 days ago

About the need to disable jtag I understand, but what is necessary to change the pin 4 to pin 25 have Mr. gweeds, thank him for that, it works out ok

gweeds (author)  robkirk23 days ago

nope, those bits look like that on mine too.

robkirk gweeds24 days ago

just to confirm jtag refers to the jtagen setting

robkirk gweeds24 days ago

"Thank you for your quick response! Yes jtag disabled, otherwise shut off the bottom row led -3,6,9,12 .... 27.Programmiruyu PoniProg through ICSP.U PoniProg FUSE reverse switch for 4 PIN AVR.Na no logical 0 or 1 , condition unknown, but if the source code to modify the line DDRB = & B00000000 on DDRB = & B00001111, then PIN-4 appears to logic 1, and the column led 25,26,27 shines postoyanno.Sobrano to debug plate.-https :/ / www.olimex.com/Products/AVR/Proto/AVR-P40- ... Foto in privyazannost.Odin resistor pin4 driver can not see it at the bottom of the board." - google translate.

from what i can tell he reprogrammed part of pin 4?

robkirk gweeds24 days ago

also i know about the pin 4 pb swap with pin 25 still no change.

robkirk gweeds24 days ago

i tried he jtag programmed the other way no change :( i wonder if its in the code but as i have no bascom program i can't open the .bas file and try converting it to a hex format again. it just seems funny that the russian guy had the exact same problem makes me think it can't be my breadboarding.

gweeds (author)  robkirk23 days ago

Hi again Rob, ok, so I downloaded the same hex file of my web site, and programmed it to my Tix clock using your program and programmer and using the fuse bits I suggested and it works as it should. Before I programmed it, I read the fuse bits and mine were set to 84 and 51. However the difference doesn't refer to anything that might affect operation. I will double check the diagram I have listed here with the board I have in my hand here a little later. Be good to get everything correct eh! :)

robkirk gweeds22 days ago

there seems to be no output from my atmega anywhere for a third row of leds on the positive side for the q3 transistor marked onto pin 24 pc2 for the atmega. i know it was wrong on the schematic so swapped with pin 5 pb4 but still nothing and i know the row is fine because i swapped the leg from led1 to led 2 rows output transistor. i have tried a lot of the other pins of the atmega but still can't get a third output for transistor q3

gweeds (author)  robkirk22 days ago

There you go, updated schematic uploaded.

robkirk gweeds22 days ago

there seems to be no output from my atmega anywhere for a third row of leds on the positive side for the q3 transistor marked onto pin 24 pc2 for the atmega. i know it was wrong on the schematic so swapped with pin 5 pb4 but still nothing and i know the row is fine because i swapped the leg from led1 to led 2 rows output transistor. i have tried a lot of the other pins of the atmega but still can't get a third output for transistor q3

gweeds (author)  robkirk22 days ago

Right, so I have had a good look, yes the diagram on here is an old version compared to the code, I shall fix that. The differences are:

Pin 2 of IC3 should go to Pin 25 of the AVR (this drives the last column)

S1 (set) goes to pin 2 of the AVR

S2 (Up) goes to Pin 3 of the AVR

That should get you going...

robkirk gweeds23 days ago

thanks gweeds I'm beginning to think its my implementation of your wiring diagram not that it might be faulty but that possibly i have connected wires where they don't need to be hmm. I'm waiting for another breadboard in the post as if you could see it, its all crammed onto 2 ad01 breadboards lol there is literally 2 slots left. i won't give up as its so close to working it just frustrating not knowing whats wrong. the buttons also have little effect on the circuit one just makes it turn off and on briefly and another one makes a few less stay on for longer. when i get this bigger breadboard ill rewire it completely as I'm also using multi strand cable from my old alarm engineer days its a nightmare asi have to keep twisting the strands tight every time i create a jumper :/ . (waiting for a proper jumper kit too) thanks for your encouragement and I'm sure ill get there. :)

robkirk made it!21 days ago

finally i have a working prototype, now i have this i shouldn't have to bother you anymore tweeds lol :) many thanks for helping me troubleshoot and even redesigning the schematic because of me. one final question is when i plug my 5 volt breadboard supply into the wall charger it goes mad and all the less flicker. is this to do with the hz being messed up by the 50hz wall transformer? when its plugged into my usb 5v laptop it works fine.

Photo on 25-03-2014 at 17.20.jpg
gweeds (author)  robkirk21 days ago

All good, glad it is going!, I hope the new schematic is a bit easier to follow as well.

robkirk robkirk21 days ago

nope its working fine actually from a different 5v wall charger :)

robkirk22 days ago

many many thanks i might be speaking to soon but i think i solved it, on that extreme burner program i was not clicking write tick box when programming so the jtag must not have been programmed off!!!! i feel such an idiot! ill post back when i rewire the breadboard again as im only testing that pin atm thanks again gweeds your awesome!

gweeds (author)  robkirk21 days ago
Ah yes, I did that trick too!
repei1 month ago

работает все,кроме порта PB3 pin4. AVR

gweeds (author)  repei22 days ago

Hi there, I have uploaded a updated schematic, that with the current code and JTAG disabled should work.

gweeds (author)  repei1 month ago

Hi there, make sure you have disabled the JTAG interface.

Привет там, убедитесь, что у вас есть интерфейс JTAG отключена

repei gweeds1 month ago

Благодарю за быстрый отклик!Да jtag отключен,иначе не выключался нижний ряд led -3,6,9,12 ....27.Программирую PoniProg через ICSP.У PoniProg переключение FUSE обратное для AVR.На PIN 4 нет логической 0 или 1 ,состояние неопределено,но ЕСЛИ в исходном коде ПОМЕНЯТЬ строку DDRB = & B00000000 на DDRB = & B00001111, то на PIN-4 появляется логическая 1, и столбец led 25,26,27 светит постоянно.Собрано на отладочной плате.-https://www.olimex.com/Products/AVR/Proto/AVR-P40-... Foto в привязанность.Один резистор для драйвера pin4 не видно ,он внизу платы.



jtag off pony.JPGled jtag off.JPGled jtag on.JPGcode.JPG
gweeds (author)  repei1 month ago

Hi again, sorry google has a bit of problems translating that reply. I think I may have mucked up the code and schematic a bit when I uploaded this instructable. Connect the last column to pin 25 instead of pin 4.

repei gweeds1 month ago

Великолепный проект!Благодарю от всего сердца за подробную и быструю техническую поддержку!Это я должен извиниться за беспокойство.всё работает отлично!Но я пока искал причину зашил до смерти один AVR.но не жалко,теперь есть некоторый опыт благодаря Вам!Неплохо было поправить файл для тех кто еще захочет повторить и не имеет достаточного опыта в AVR .А Google лучше переводить оригинальный текст,иначе вообще ничего не понятно .Спасибо!

robkirk26 days ago

ah thankyou so much, to anyone who is reading this I'm using eXtreme burner on windows 7 64 bit and have a usbasp programmer. Ill let you know how i get on and post pics of it. btw did you say the smaller crystal would be ok to use as they are all the same as long as its 32.768 its about half the size of the one on your board and I've used legs 1 and 4 the other legs are not used as i can tell from the datasheet. Thanks again for your kindness and patience at my noob diatribes.

gweeds (author)  robkirk25 days ago

The physical size of the crystal does not matter, it is the frequency that needs to be correct, other wise your clock will run to fast or slow. :)

robkirk25 days ago

I've started on the breadboard prototype just one thing, the blue line connecting 7 pins of the atmega to one of the arrays, does that mean connect each pin to each pin separately or link them altogether? thanks.

gweeds (author)  robkirk25 days ago
Hi there, yeah in the diagram it is show as one line for clarity, but they are individual connections from the array to the AVR
gweeds (author) 26 days ago

Hi Rob, so you need to set the fuse bits as follows, click on the "Configure AVR Clock" button and set as per image 1;

Calibrated Internal RC oscillator

8 MHz

Start-up Time from Power Down (The first recommended option)

NO Options

Then OK that, click on the "Bit Details" for the High Fuse option and UN program the JTAG fuse.

You should see C4 and D9 in low and high fuse respectively.

The 32.768MHz crystal is for the clock only for the Real time clock. It's 32.768 because that can be divided down to 1 Hz pulses for the clock.

As for capacitors, as long as the voltage is higher, it doesn't matter, so you can replace a 10uF 16v with a 10uF 35v.

And the transistor array can be bought from:

http://www.aliexpress.com/wholesale?SearchText=TD6...

take your pick, I have purchased 100's of products from Aliexpress, and only one ever got lost in transit. Those links will also give you some alternative part numbers.

Capture.PNG
robkirk26 days ago

sorry again but when you have the time could you look at my pics and advise on fuse settings would be greatly appreciated. i have ordered the correct transistor arrays as you have and ordered a bigger crystal. i have the atmega 16 chip now and have it working witht this program and the usbasp programmer it read the empty chip fine. i also have your code in hex loaded into extreme burner ready to go just need to put the circuit together on breadboard and then program it. thanks again in advance.

avr clock source.pngavr clock source1.pngavr clock source2.pngavr clock source3.pngavr clock source4.pngextreme burner.pngfuse1.pnghigh fuse.png
robkirk27 days ago

thanks a lot for your help. sorry to be a pain but what is the exact crystal model is it a e571? i have ordered one and its the same frequency but a lot smaller than yours i have soldered 2 leads on it to use but not sure if i need a bigger one. also i have a 4.7 uhf capacitor but its rated 63v and yours states 10v although it looks the same size. finally would these arrays work>: http://www.alldatasheet.com/datasheet-pdf/pdf/230752/STMICROELECTRONICS/ULN2003A.html

robkirk27 days ago

hi gweeds i emailed you recently and am worried now i have seen errors in the code for when i make it. i have eXtreme burner (its like an avr dide gui) and a usbasp with the drivers installed and i have the hex file you compiled im just waiting for my atmega 16l chips to arrive and the transistor array although i was wondering for my breadboard exactly what type of other transistor i could use instead but i think i will wait for the exact parts you specified anyways. sorry to be a pain but im new to programming chips and the fuse burning thing and hz rate scares me a bit. anyway ill give it a try when i have all the parts the worst that can happen is ill need to buy a new atmega chip or a usbasp programmer. ill let you know how i get on,

gweeds (author)  robkirk27 days ago
Hi there, the code on the site is correct, read some of the other comments I only got one of the connections wrong (pin 25 should be on 4 or vice versa) and you MUST turn off JTAG. this interferes otherwise. You could use some transistors instead of the array, not sure what type to use but look up the spec of the array and match something discrete. But yes, make sure you set the clock bits right on the fuse settings, otherwise you may brick your mega. If you have a screen shot of the software's fuse setting screen, I might be able to help you select the right ones.
Neph1x1 year ago
Where i can change blinking time, i wanna make it faster...this is a little bit slow for me..which variable you use for that....Thank you!
gweeds (author)  Neph1x1 year ago
Hi there, after you set the time there is an option to change the blinking time. it cycles in the setup between 1, 5, 10, 15, 30 and 60 seconds. The actual variable that holds this delay time is "Delayvalue". The code sets it to a default of 5 just after all the Pattern definitions.
What limits the current through the LEDs?
Is this not going to burn out the LEDs and / or the drivers?
Pro

Get More Out of Instructables

Already have an Account?

close

PDF Downloads
As a Pro member, you will gain access to download any Instructable in the PDF format. You also have the ability to customize your PDF download.

Upgrade to Pro today!