Dave’s Blog


Glowing Cube Hack
March 4, 2009, 10:05 pm
Filed under: Arduino, ATTiny45, Electronics, Prototyping | Tags: , , , , , , , ,

One of the promotional things that Linden Lab gives away is a small colour changing, glowing cube. Last year, we attended a job fair were we gave several away. One of the people who received one decided to hack his cube and made a Gmail notifier.

I decided to copy the hack, bought myself an Arduino, and set about hacking the cube. I went for a slight improvement where I individually wired each LED. This means that using the PWM from the Arduino I was able to set the colour of the cube to whatever I chose. 

Arduino and Cube

Arduino and Cube

The main problem with this hack was the physical size of the Arduino. It’s too large to fit inside the cube. I could have attempted to use one of the smaller Arduino variants, but it would have been a bit pricey, costing about £30 for the Mini and the USB adapter.

I’d recently discovered AVR USB, which implements, USB in software, for any AVR microcontroller. USB needs two wires and I needed another 3 to control my LEDs, so even the smallest microcontroller would be enough and it doesn’t even need a crystal. AVR USB needs at least 2K of flash memory. There is an example project, EasyLogger, that uses ATTiny45 so that’s what I’ll use too.

ATTiny45

ATTiny45

The EasyLogger project is a good starting point, but I’m going to make some changes. First, I want to control the LEDs, so I replace the input voltage and start switch with a resistor LED pair. 

USB uses 2.8-3.6V for high on the data pair but provides 5V for power. Since I’m going to be powering the ATTiny from the USB I need a way to make the outputs deliver the lower voltage. The EasyLogger project uses Zener diodes to provide level conversion, but unfortunately, I don’t have any Zener diodes. 

The AVR USB provides an alternative suggestions of using a 3.3V voltage regulator for reducing the power (which again I don’t have any of) or a cheaper alternative, using a pair of normal diodes. Each diode has a drop of 0.7V so the pair drops the power voltage to 3.6V. 

Here is the first prototype circuit on my bread board. 

Breadboard prototype

Breadboard prototype

I’ll describe the code for the firmware and driver in later blog posts.


6 Comments so far
Leave a comment

[...] Initial prototype and bread board version [...]

Pingback by Cube follow up « Dave’s Blog

Hi,

I want to rebuild this nice part, to trigger one single LED. It should show if my VDR is recording.

I’ve on hand only SD101A and 1N4148, are they fine to use or should I buy a voltage regulator diodes like a BZX55-C3V3?

Thanks,
Guido

Comment by Guido

Short answer: Try it. Using the diodes to cause a voltage drop is pretty weird anyway.

Look at http://www.obdev.at/products/vusb/index.html
Instead of running your AVR at 3.6V you could run it at 5V and drop the data lines using zener diodes.

Comment by davehillier

Thanks for the fast answer.

I’ll try it, but since I need to buy the atTiny45 anyway, I’ll buy one zener diode. ;-)

I’ll let you know and post a pic of it.

Comment by Guido

Oh and for choosing parts look at this: http://dangerousprototypes.com/2010/03/13/choosing-a-substitute-electronic-part/

Comment by davehillier

[...] Breadboard prototype Finished gadget Code [...]

Pingback by Other MoodLight Projects (or Related Work) | q-rai.de




Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Connecting to %s



Follow

Get every new post delivered to your Inbox.