[dorkbotdc-blabber] Re: LED Cube Workshop - use an Arduino?

Tim Slagle tim at slagle.org
Sat Dec 8 23:11:29 EST 2007


Arduinos have 14 digital I/Os so that should be just enough for
the 3x3x3 cube plus the serial port for program load and
debugging:
  http://www.arduino.cc/en/Hacking/PinMapping168

I am no Arduino expert, but I checked out the LED cube C source
code from:
  http://cachefly.oreilly.com/make/LEDcube.zip 
and then hit the Arduino software reference pages:
  http://www.arduino.cc/en/Reference/Extended
It looks like Arduino supports reading the cube patterns from
program memory (rather than variables in RAM) like the C program
does.  And it lets you write the entire 8-bit port with one
statement as well as the standard way of doing each bit
individually (which is much slower).  So porting the Make code
to Arduino should be straightforward enough.  Arduino code is
C/C++-based rather than Java like I said before - I was thinking
of Processing, from which Arduino got the editor environment but
not the syntax it seems.
--Tim

 
--- "R. Mark Adams, Ph.D." <rmadams at epotential.com> wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Okay-  I think I have a way to get the Arduino to run the LEDs
> without
> needing anything fancy (read shift registers, etc.)  Now I
> need a way to
> test it, and I do not have enough LEDs.  Someone (Tim?) had
> mentioned
> that they buy LEDs on ebay and have good luck doing so- any
> suggestions
> as to a vendor, delivery time and price?  I figured it might
> be the best
> way to get some quickly to we can test out our ideas!  :-)
> 
> Thanks-
> Mark
> 
> Tim Slagle wrote:
> > I know you would want to use Make: stuff when possible but
> there
> > are hundreds of Arduinos in stock at AdaFruit:
> > http://www.adafruit.com/index.php?main_page=index&cPath=17
> > SparcFun also has them:
> >
>
http://www.sparkfun.com/commerce/product_info.php?products_id=666
> > 
> > I think the AdaFruit BoArduino would be the thing to use
> > however, then the transistor drive circuits and LED column
> > connections can just be plugged in to the protoboard without
> > soldering: 
> >
>
http://www.adafruit.com/index.php?main_page=product_info&cPath=19&products_id=72
> > Lots of those in stock also, but they are sold as kits and
> would
> > need to be soldered up.  No harder than building a MiniPOV
> kit
> > and more useful in the future...
> > --Tim
> > 
> > 
> > --- adam koeppel <koeppel at gmail.com> wrote:
> > 
> > 
> >>I probably have time, but maybe not the skill.  Also, MAKE
> >>store is
> >>currently out of Arduinos...  Damn holiday season...  I love
> >>the idea
> >>of everyone having an Arduino for this and future projects.
> >>
> >>On 12/6/07, Alberto Gaitán <alberto.gaitan at gmail.com> wrote:
> >>
> >>>This is a  great idea. Especially because everk
> >>
> >>self-respecting maker
> >>
> >>>needs an Arduino. I'm pretty sure I don't have the time for
> >>
> >>this
> >>
> >>>conversion. If none of you do, either, perhaps we can
> >>
> >>recruit someone
> >>
> >>>else from the greater list?
> >>>
> >>>The Arduino uses Processing as its language and it's pretty
> >>
> >>well
> >>
> >>>documented. Haven't looked at the WinAVR C code and don't
> >>
> >>know how many
> >>
> >>>lines o'code it has but someone with some chops could make
> >>
> >>short shrift
> >>
> >>>of it. Can't be too long.
> >>>
> >>>Anyone else have the time to do this?
> >>>
> >>>Alberto
> >>>
> >>>
> >>>
> >>>On 12/6/07 4:07 PM, Tim Slagle wrote:
> >>>
> >>>>Thanks for the offer, but now that I think of it I have
> >>
> >>some AVR
> >>
> >>>>prototyping boards that could be used instead of the
> >>
> >>MiniPOV kit
> >>
> >>>>for my experimental purposes.
> >>>>
> >>>>This may complicate things even more, but instead of using
> >>>>hacking the MiniPOV kit the LED cube could be driven from
> >>
> >>an
> >>
> >>>>Arduino.  Someone would just have to convert the software
> >>
> >>from
> >>
> >>>>WinAVR C to Arduino's Java-style code.  Then commercial
> >>
> >>Arduinos
> >>
> >>>>could be bought, or kits could be made.    If people
> >>
> >>bought
> >>
> >>>>assembled Arduinos they could focus on making the LED cube
> >>
> >>at
> >>
> >>>>the meeting.  And their Arduino could be the basis of
> >>
> >>future
> >>
> >>>>Make:DC projects as well.
> >>>>
> >>>>I would tentatively volunteer to do the software
> >>
> >>conversion but
> >>
> >>>>if there is someone else with more confirmed free time it
> >>
> >>might
> >>
> >>>>be better.  The Make: 3D cube C code could also just be
> >>
> >>burned
> >>
> >>>>into the Arduino CPU (blowing away the bootloader etc) as
> >>
> >>a
> >>
> >>>>backup plan.
> >>>>--Tim
> >>>>
> >>>>
> >>>>
> >>>>--- adam koeppel <koeppel at gmail.com> wrote:
> >>>>
> >>>>
> >>>>>Hi Tim,
> >>>>>
> >>>>>I ordered a POV kit earlier to play around with.  I
> >>
> >>figured it
> >>
> >>>>>would
> >>>>>not supply enough currents for a massive array.  Your
> >>>>>transistor
> >>>>>solution should work fine.  If you want to play around
> >>
> >>with
> >>
> >>>>>any of
> >>>>>your ideas prior to the meeting, I will let you know when
> >>
> >>I
> >>
> >>>>>have
> >>>>>assembled the kit.  I would be happy to share it as a
> >>>>>"testing" unit
> >>>>>so we don't have to complicate the group order.
> >>>>>
> >>>>>Cheers,
> >>>>>
> >>>>>Adam
> >>>>>
> >>>>>
> >>>>>On 12/6/07, Tim Slagle <tim at slagle.org> wrote:
> >>>>>
> >>>>>>Sign me up for a kit, but I would probably want it
> >>
> >>before
> >>
> >>>>>the
> >>>>>
> >>>>>>meeting so I can put it together in advance.  If other
> >>>>>
> >>>>>people
> >>>>>
> >>>>>>want to do this it will complicate the logistics of a
> >>
> >>volume
> >>
> >>>>>>order I'm afraid.
> >>>>>>
> >>>>>>Also, the circuit that drives the cube is a hack, and
> >>>>>
> >>>>>probably
> >>>>>
> >>>>>>wouldn't work too well to drive multiple cubes without
> >>>>>>additional parts.  The cube is driven as three
> >>
> >>multiplexed
> >>
> >>>>>>planes of 3x3=9 LEDs.  The LEDs in a plane are driven
> >>>>>
> >>>>>directly
> >>>>>
> >>>>>>from the AVR uC pins, which is okay, since they can
> >>
> >>drive
> >>
> >>>>>about
> >>>>>
> >>>>>>25mA.  But then the planes are addressed by pulling the
> >>>>>
> >>>>>current
> >>>>>
> >>>>>>from the whole 9 LEDs into a single AVR uC pin, which is
> >>
> >>a
> >>
> >>>>>lot
> >>>>>
> >>>>>>more current than the AVR can sink.  So, the cubes will
> >>>>>
> >>>>>already
> >>>>>
> >>>>>>be operating at ~1/27th the brightness of a directly
> >>
> >>driven
> >>
> >>>>>LED,
> >>>>>
> >>>>>>and adding more cubes in parallel would only make them
> >>>>>
> >>>>>dimmer.
> >>>>>
> >>>>>>One change that could be easily done to increase
> >>
> >>brightness
> >>
> >>>>>is
> >>>>>
> >>>>>>use two AVR pins in parallel to sink current from the
> >>>>>
> >>>>>planes.  I
> >>>>>
> >>>>>>think there are enough extra I/O pins to do this for the
> >>>>>
> >>>>>3x3x3
> >>>>>
> >>>>>>cube.  The firmware would then have to be changed to set
> >>
> >>two
> >>
> >>>>>>bits instead of one to address the planes, but this
> >>
> >>should
> >>
> >>>>>not
> >>>>>
> >>>>>>be a big deal.
> >>>>>>
> >>>>>>A better approach would be to drive the planes through a
> >>>>>>transistor that could sink more current.  This would
> >>
> >>require
> >>
> >>>>>>soldering three ~1Kohm resistors and 2N3904 or 2N2222
> >>
> >>NPN
> >>
> >>>>>>transistors to the plane drive I/O pins, and inverting
> >>
> >>the
> >>
> >>>>>bit
> >>>>>
> >>>>>>values of the pins in the firmware.
> >>>>>>
> >>>>>>I would recommend making the LED cubes on a piece of
> >>
> >>perf
> >>
> >>>>>board
> >>>>>
> >>>>>>if possible, so there would be room to wire up the drive
> >>>>>>transistors on the board and you wouldn't have to solder
> >>>>>
> >>>>>them
> >>>>>
> >>>>>>directly to the POV kit.  But then, I think like an
> >>
> >>engineer
> >>
> >>>>>:-)
> >>>>>
> >>>>>>Mark, if you make the LED grid assembly fixtures, space
> >>
> >>the
> >>
> >>>>>LEDs
> >>>>>
> >>>>>>at some multiple of 0.1" so they will fit on a
> >>
> >>perfboard.
> >>
> >>>>>They
> >>>>>
> >>>>>>need to be less than 1" apart so I'd say make them 0.7"
> >>
> >>or
> >>
> >>>>>so.
> >>>>>
> >>>>>>One variation I've been thinking about that would be
> >>
> >>cool
> >>
> >>>>>(but
> >>>>>
> >>>>>>require more firmware changes) would be to use bi-color
> >>>>>
> >>>>>LEDs.
> >>>>>
> >>>>>>As long as the drive voltage is kept around 3V and
> >>
> >>two-pin
> >>
> >>>>>>reverse-connected LEDs are used, they could just be
> >>
> >>wired up
> >>
> >>>>>>like the single-color cube.  Then in the software, the
> >>
> >>I/O
> >>
> >>>>>pins
> >>>>>
> >>>>>>for inactive planes are set to be high-impedance inputs
> >>
> >>so
> >>
> >>>>>no
> >>>>>
> >>>>>>current will flow, and the active plane is set high to
> >>>>>
> >>>>>address
> >>>>>
> >>>>>>one color and low to address the other color.  So the
> >>
> >>matrix
> >>
> >>>>>>would be scanned like six planes of 3x3 with only one
> >>
> >>color
> >>
> >>>>>on
> >>>>>
> >>>>>>at a time.  The plane bit values for the high-level
> >>>>>
> >>>>>addressed
> >>>>>
> >>>>>>color would have to be inverted since they are now
> >>
> >>active
> >>
> >>>>>low.
> >>>>>
> >>>>>>I will try to buy some bipolar bi-color LEDs for my own
> >>
> >>use
> >>
> >>>>>but
> >>>>>
> >>>>>>others may want them as well...
> >>>>>>--Tim
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>--- adam koeppel <koeppel at gmail.com> wrote:
> >>>>>>
> >>>>>>
> >>>>>>>Yeah, if this works out well, it could be an
> >>
> >>installation
> >>
> >>>>>>>worthy
> >>>>>>>piece.  I definitely think the working towards a
> >>
> >>massive
> >>
> >>>>>>>assembly
> >>>>>>>approach is a good idea, and it will solve the shortage
> >>
> >>of
> >>
> >>>>>POV
> >>>>>
> >>>>>>>kit
> >>>>>>>problem.  We should probably do a little design work
> >>
> >>ahead
> >>
> >>>>>of
> >>>>>
> >>>>>>>time to
> >>>>>>>make sure a single POV kit can provide the power we
> >>
> >>need,
> >>
> >>>>>>>although I
> >>>>>>>don't imagine it will be a problem.  I'd just hate for
> >>
> >>it
> >>
> >>>>>not
> >>>>>
> >>>>>>>to work
> >>>>>>>because of a power shortage.  What do you guys think?
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>On 12/6/07, Alberto Gaitán <alberto.gaitan at gmail.com>
> >>>>>
> >>>>>wrote:
> >>>>>
> >>>>>>>>Yes! I like the idea of divving up the work
> >>>>>
> >>>>>factory-style!
> >>>>>
> >>>>>>>...some folks
> >>>>>>>
> >>>>>>>>building cubes, and others POV thingies. And the idea
> >>>>>
> >>>>>for a
> >>>>>
> >>>>>>>>mega-LED-cube is genius enough to stop traffic for
> >>
> >>hours
> >>
> >>>>>in
> >>>>>
> >>>>>>>Boston!
> >>>>>>>
> >>>>>>>>A
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>
> >>>>>>>>On 12/6/07 11:33 AM, R. Mark Adams, Ph.D. wrote:
> >>>>>>>>
> >>>>>>>>>I think this sounds great- if we follow the 'sewing
> >>>>>>>
> >>>>>>>circle' approach,
> >>>>>>>
> >>>>>>>>>people are certain to feel like they had an enjoyable
> >>>>>>>
> >>>>>>>time, as well as
> >>>>>>>
> >>>>>>>>>(potentially) making something interesting.  I would
> >>>>>>>
> >>>>>>>suggest that we buy
> >>>>>>>
> >>>>>>>>>and build at least a couple of POV kits in advance,
> >>
> >>so
> >>
> >>>>>>>people who finish
> >>>>>>>
> >>>>>>>>>their cubes could hook them up and get so see what
> >>>>>
> >>>>>they
> >>>>>
> >>>>>>>look like working.
> >>>>>>>
> >>>>>>>>> in fact, if we encourage the group to work together
> >>>>>>>
> >>>>>>>collectively, we
> >>>>>>>
> >>>>>>>>>could set it up so that folks are each working on
> >>>>>
> >>>>>parts
> >>>>>
> >>>>>>>that can all come
> >>>>>>>
> >>>>>>>>>together in the end to have something working.
> >>>>>>>
> >>>>>>>mega-LED-cube, anyone? :-)
> >>>>>>>
> >>>>>>>>>I am happy to volunteer to buy a couple of kits/LEDs
> >>>>>
> >>>>>to do
> >>>>>
> >>>>>>>some
> >>>>>>>
> >>>>>>>>>pre-building if people would like.  I can also knock
> >>>>>
> >>>>>off
> >>>>>
> >>>>>>>some wooden jigs
> >>>>>>>
> >>>>>>>>>to aid in the LED cube construction. (I can use the
> >>>>>
> >>>>>robot
> >>>>>
> >>>>>>>I showed last
> >>>>>>>
> >>>>>>>>>time to make them- cool!)
> >>>>>>>>>
> >>>>>>>>>I also have some tool kits and soldering irons that
> >>>>>>>
> >>>>>>>tool-less folks can
> >>>>>>>
> >>>>>>>>>use at the meeting if they want.
> >>>>>>>>>
> >>>>>>>>>Thanks!
> >>>>>>>>>Mark
> >>>>>>>>>
> >>>>>>>>>Gareth Branwyn wrote:
> >>>>>>>>>
> >>>>>>>>>>Hey Everybody,
> >>>>>>>>>>
> >>>>>>>>>>As I'm sure you all know, we need to step on it to
> >>>>>
> >>>>>get
> >>>>>
> >>>>>>>the LED Cube
> >>>>>>>
> >>>>>>>>>>workshop in gear.
> >>>>>>>>>>
> >>>>>>>>>>I talked to Dan Woods at the Maker Store and it's
> >>
> >>not
> >>
> >>>>>>>firm yet, but
> >>>>>>>
> >>>>>>>>>>it sounds like they'lll sell us the MiniPOV kits for
> >>>>>
> >>>>>cost
> >>>>>
> >>>>>>>in exchange
> >>>>>>>
> >>>>>>>>>>for a "Sponsored by MAKE" and a link on their
> >>>>>
> >>>>>website, in
> >>>>>
> >>>>>>>the
> >>>>>>>
> >>>>>>>>>>announcements, etc. The problem is that, given the
> >>>>>>>
> >>>>>>>season, the kits
> >>>>>>>
> >>>>>>>>>>are in short supply. He said supply should free up
> >>>>>
> >>>>>after
> >>>>>
> >>>>>>>Xmas, so
> >>>>>>>
> >>>>>>>>>>hopefully they could have them to us in early
> >>>>>
> >>>>>January.
> >>>>>
> >>>>>>>>>>Tim Slagle said that he could get the LEDs
> >>>>>
> >>>>>themselves.
> >>>>>
> >>>>>>>Katie Bechtold
> >>>>>>>
> >>>>>>>>>>and Mark Adams have also volunteered to help. (all
> >>>>>
> >>>>>copied
> >>>>>
> >>>>>>>in here)
> >>>>>>>
> >>>>>>>>>>Alberto said that he'll draft the announcement that
> >>>>>>>
> >>>>>>>Koshland needs to
> >>>>>>>
> >>>>>>>>>>see, sooner than later. I'll also help in editing
> >>>>>
> >>>>>that.
> >>>>>
> >>>>>>>>>>So, we need to figure out ASAP how we're going to
> >>
> >>run
> >>
> >>>>>>>this thing.
> >>>>>>>
> >>>>>>>>>>Personally, I'm not that concerned about whether the
> >>>>>>>
> >>>>>>>cubes are
> >>>>>>>
> >>>>>>>>>>finished by the end of the workshop or not. To me,
> >>>>>
> >>>>>these
> >>>>>
> >>>>>>>things are
> >>>>>>>
> >>>>>>>>>>more like a sewing circle than anything else, a
> >>>>>
> >>>>>chance to
> >>>>>
> >>>>>>>socialize,
> >>>>>>>
> >>>>>>>>>>geek out, learn a skill and a few tips from those
> >>>>>
> >>>>>more
> >>>>>
> >>>>>>>experienced,
> >>>>>>>
> >>>>>>>>>>etc. But others might have a different take.
> >>>>>>>>>>
> >>>>>>>>>>Given the "shortage" of POV kits, we may have
> >>
> >>trouble
> >>
> >>>>>>>getting a lot,
> >>>>>>>
> >>>>>>>>>>if say, 25 or more people each wanted a kit. One
> >>>>>
> >>>>>thing we
> >>>>>
> >>>>>>>could do is
> >>>>>>>
> >>>>>>>>>>also approach Lady Ada, the maker, and see if she'd
> >>>>>
> >>>>>give
> >>>>>
> >>>>>>>us a
> >>>>>>>
> >>>>>>>>>>discount. Even if she didn't, we could buy them full
> >>>>>>>
> >>>>>>>price from her
> >>>>>>>
> >>>>>>>>>>(at $17.50 ea) and spread out the cost over all the
> >>>>>
> >>>>>kits
> >>>>>
> >>>>>>>we offered
> >>>>>>>
> >>>>>>>>>>to people.
> >>>>>>>>>>
> >>>>>>>>>>So, we need to get a show of hands ASAP for how many
> >>>>>>>
> >>>>>>>people plan to
> >>>>>>>
> >>>>>>>>>>purchase a kit. And for one thing, we should insist
> >>>>>
> >>>>>that
> >>>>>
> >>>>>>>you have to
> >>>>>>>
> >>>>>>>>>>be participating in the workshop to get the kit at
> >>>>>
> >>>>>the
> >>>>>
> >>>>>>>discounted price.
> >>>>>>>
> >>>>>>>>>>Gareth
> >>>>>>>>>>
> >>>>>>>>>>
> >>>>>>>>>
> >>>>
> > 
> > 
> 
> - --
> |                            |   "Information is light.      |
> | R. Mark Adams, Ph.D.       |    Information in itself,     |
> | Computational Biologist    |    about anything, is light." |
> | rmadams at epotential.com     |       - Tom Stoppard          |
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.1 (Darwin)
> Comment: Using GnuPG with Thunderbird -
> http://enigmail.mozdev.org
> 
>
iD8DBQFHW0Ns5rQGeNhqYzcRAkG2AJ9n/eokxhA3+S6KoMrdYT1wI56NMwCfc5+X
> 0O9MFxbmDtbSc3mEFHus1kQ=
> =XK3+
> -----END PGP SIGNATURE-----
> 



More information about the dorkbotdc-blabber mailing list