ATtiny hacks: 2313 driving a 4x4x4 LED cube

ATtiny Hacks Theme Banner

[Kirill] wrote in to share his ATtiny hack, a 4x4x LED cube. The 64 LED display is a great choice to fully utilize the hardware he chose. It’s multiplexed by level. Each of the four levels are wired with common cathodes, switched by a 2N3904 transistor. The anodes are driven by two 595 shift registers, providing a total of 16 addressable pins which matches the 4×4 grid perfectly. All said and done it only takes seven of the ATtiny2313’s pins to drive the display. This is one pin more than the chip’s smaller cousins like the ATtiny85 can provide. But, this chip does include a UART which means the project could potentially be modified to receive animation instructions from a computer or other device.

You may have noticed the USB port in the image above. This is serving as a source for regulated power in lieu of having its own voltage regulation hardware and is not used for data at all. Check out the animations that [Kirill] uses on the display by watching the video after the break. You’ll find a link to the source code there as well.

Here’s a link to [Kirill's] source code:


  1. insapio says:

    Inb4 not a hack! I really like the way this is put together; quite simply. I’d love to know how the animations are written; whether theyre hard coded, or calculated on the fly.

  2. Gray Simpson says:

    …Not that I’m an electronics master, but why not use a single sixteen bit shift register/LED driver like the TLC5928?

  3. Mihail121 says:

    Not really a hack to be honest. The 595s do all the work. You can drive the cube with an 8 pin tiny45 as well.

  4. Jon says:

    Hey there — someone mind clearing up some of my confusion with a number of LED matrix/cube projects? It always seems like folks are running their shift registers way over the max ratings (when all LEDs are lit), or I’m just way off on my calculations…please be gentle on your response ;)

    I’m looking at the 74LS595 datasheet and seeing I_CCH for the 595 to be 50 mA, and I_CCL to be 65 mA. With those 68 Ohm resistors and V_CC = 5.0V, we’d be sourcing roughly 70 mA for each LED connected to that shift register.

    I must be wrong…otherwise if all 8 LEDs connected to the 595 are on…those shift registers would be getting mighty hot, right? ;)

    I see the 596 has open collector outputs, which might certainly alleviate this issue a bit, if there is one…

  5. KillerBug says:

    The ATtinys can do i2c…I think this could have been done using an ATtiny25/45/85 and a MCP23018.

  6. Drew says:

    You could just use 3 shift registers instead and would be able to run this on a 4-pin uC, I believe.

  7. internationalwaters says:

    how easy would it be to convert to sensors/input for a directional sound indicator?

  8. TomF says:

    …or you use two more pins and need no shift register whatsoever:

  9. mallory2000 says:

    Can we please make this the last LED cube projects for a while? It seems like that kid from NZ threw down the gauntlet for everyone for a while…

    /no offense meant to the builder
    //enjoying the ATiny coverage over Arduino tho :)

  10. Dmitry says:

    Yet another LED project with no transistors on source side.

  11. Szabi says:

    Nice circuit :) I’ve planned to build it but some problems occured during compiling the source code…could you send me The hex file? I’d be pleasant.
    my address:
    Great site anyway :)

  12. THUANAN says:

    THANK YOU!!!!!!!!!!!!!!!!!!!!!!

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Get every new post delivered to your Inbox.

Join 97,706 other followers