Shop OBEX P1 Docs P2 Docs Learn Events
3x3x3 led cube — Parallax Forums

3x3x3 led cube

FredBlaisFredBlais Posts: 380
edited 2009-12-01 05:33 in Propeller 1
I want to remake that project : http://www.youtube.com/watch?v=_SO1J1kP3YQ
of course, with a propeller.
The idea is to have the cube, but in sync real time with an openGL simulated cube that I did in java (it will communicate via RS-232)·:
http://systm.dynalias.com/afficheItems.php·<- just click on projet cube at your right, move the cube with your mouse and try the keyboard key from 1 to 7...
I started to make a PWM engine that would seek in an array for the RGB value, 10 bits each packed in a 32 bit long (2 bit lost) for each of the 27 leds(in fact, 81 leds because it's 27 rgb leds... but I want to refresh 3 leds at a time, RGB of one discrete led). Only one pwm engine built, but pins will be multiplexed. This means that to modulate all the colors, I have 100% duty, divided by 27, thats about 3% duty to modulate 0-100% brightness. I tried it with the circuit below·but I really can't get the about 50mA for the max brightness for the leds, and strangely, the current decrease with the frequency of the PWM :s. ( I tested it, and 50mA is the best brightness I can get with these leds, I can't connect directly·the blue and green led with the prop because their voltage drop is more than 3.3volt for a great brightness.)
Someone have an idea how I could do that? If it works, I would be pleased to share all the code and design files (pcb included) to make your own.
Ultimately, I would like to have a product like that one :
http://209.169.12.51/images/products/PICT0119.JPG

Sans%20titre.png

Post Edited (FredBlais) : 11/30/2009 2:29:54 PM GMT

Comments

  • Roger LeeRoger Lee Posts: 339
    edited 2009-11-30 04:41
    Pardon my ignorance.

    Your drawing shows the circuit driven from "prop pin" to a single LED.

    What is your plan to drive 91 LED's with the 28 (or 32) pins available on the propeller chip. Will you need an external LED driver chip(s) or at least output pin multipliers.

    Roger
  • FredBlaisFredBlais Posts: 380
    edited 2009-11-30 05:11
    I plan to use that circuit (if it works) 9 times, 3 for red, 3 for blue and 3 for green. 9 other pins would serve as cathodes. 9x9 would give access to the 81 leds, in a multiplexed way. But my problem reside in the timing, I can only·access to 3 leds at a given·time. And I have to give enough current to each of the 27 trio of RGB leds(50mA). I don't know how to choose·the right·value of resistors·in the circuit, to make all the thing work. If I give continuously 50 mA to one led, is it the same thing as giving the led 1350 mA 37 milliseconds and no current 963 milliseconds?
  • BTXBTX Posts: 674
    edited 2009-11-30 11:17
    Hi Fred.
    Some modest opinions from me.

    1- Why not to use only one transistor ? "or one mosfet"
    2- The base resistor of first transistor, seems to be too slow in your case, I'm sure could be some k-ohms.
    3- Why 50mA leds ??... there are thousands of 20 mA RGB leds.
    4- You want to implement some "programming tricks" to get the PWM works fine for this (not conventional PWM technique).
    This is, if you want to get 256 gray shades, think in to do it, in eight steps of different on-time from MSB to LSB of each gray data level. In this way you'll save a lot of MIPS easily.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Regards.

    Alberto.
  • FredBlaisFredBlais Posts: 380
    edited 2009-11-30 14:27
    Hi BTX,

    1- The leds need a fairly high voltage :
    R:2,1v·@ 50mA
    G:3,33v @·50mA
    B:3,49V @·50mA
    So I'm worried about the green and blue one...
    and there is the fact that I lose 0.2 volts from the saturation of T1, and another 0.2 volts from the cathode select transistor. (not shown)
    Using only one transistor would cause problems, the prop with his·3.3 volts·cannot switch a transistor with the drain or collector to a high voltage. (I think)

    2 - In fact isn't it fast? low resistor means more current, then faster charge time?

    3- I sure could use these leds at 20 mA, but I wanted the better brightness (it could be changed, if I don't have choice)

    4 - Yup, that's what I was thinking, some ideas might help me


    Need more help!· lol [noparse]:)[/noparse]

    ·
  • kwinnkwinn Posts: 8,697
    edited 2009-11-30 14:52
    Give this circuit a try. 9 prop pins to drive 3xRGB leds and 9 pins (or 3 + demux chip) for common drivers.

    The circuit is a constant current source where the current is determined by the value of Ri. Ri of 47 ohms should give you about 55mA.
  • Graham StablerGraham Stabler Posts: 2,510
    edited 2009-11-30 14:55
    Alberto is as modest as his suggestions, this is one of his LED projects [noparse]:)[/noparse]

    www.youtube.com/watch?v=1Ki8SUTulV8

    1. To turn on the pnp you just need to bias that diode within it, you can do that by pulling the base low, to turn it off let it float. (unlike FETs for example where you need to charge the gate)
    2. I think he means low but besides a transistor does not charge up to turn on so it will not affect speed but you need to be sure not to over stress the IO pin
    3. no comment
    4. I think we may need you to expand on this Alberto, it was lost in translation I fear.

    Graham
  • Mike HuseltonMike Huselton Posts: 746
    edited 2009-11-30 15:13
    I have 3 tubes of MAX6956AAX IC's - they are I2C constant-current drivers - no resistors needed.
    Check out the MAXIM spec sheet.

    Want some?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    JMH
  • FredBlaisFredBlais Posts: 380
    edited 2009-11-30 17:46
    Thanks kwinn, but the problem is that I want to be able to vary the current from 0-~55mA.·· that wouldn't work for me [noparse]:([/noparse]

    In fact, it could work if I pwm the pin?
    kwinn said...
    Give this circuit a try. 9 prop pins to drive 3xRGB leds and 9 pins (or 3 + demux chip) for common drivers.

    The circuit is a constant current source where the current is determined by the value of Ri. Ri of 47 ohms should give you about 55mA.
    Post Edited (FredBlais) : 11/30/2009 6:16:11 PM GMT
  • FredBlaisFredBlais Posts: 380
    edited 2009-11-30 17:54
    Graham Stabler said...
    Alberto is as modest as his suggestions, this is one of his LED projects [noparse]:)[/noparse]

    www.youtube.com/watch?v=1Ki8SUTulV8

    1. To turn on the pnp you just need to bias that diode within it, you can do that by pulling the base low, to turn it off let it float. (unlike FETs for example where you need to charge the gate)
    2. I think he means low but besides a transistor does not charge up to turn on so it will not affect speed but you need to be sure not to over stress the IO pin
    3. no comment
    4. I think we may need you to expand on this Alberto, it was lost in translation I fear.

    Graham
    Hi Graham, thanks for your answer.
    From what I recall, bjt transistors like all other semiconductor·device, have parasitic capacitance. So at high switching speed, it takes time to give the 0.7 volt to the junction between the base and emitter of my circuit·(P and N of the NPN). The more the current, the faster that voltage can rise because of the charge time of that parasitic capacitance. :P

    One PNP could do the job, I did not thinked to the floating pin trick

    Post Edited (FredBlais) : 11/30/2009 6:07:30 PM GMT
  • FredBlaisFredBlais Posts: 380
    edited 2009-11-30 18:08
    These devices look great, but I would have to connect the output to each of the leds anode (81 times)·the cube would be almost impossible to solder.· And if it is I2C, I can't justify using a prop chip with the multiprocessing capability, I could just use a pic with a hardware I2C... lol,· but I want to use the prop [noparse]:)[/noparse]
    Mike Huselton said...
    I have 3 tubes of MAX6956AAX IC's - they are I2C constant-current drivers - no resistors needed.
    Check out the MAXIM spec sheet.

    Want some?

  • Mike HuseltonMike Huselton Posts: 746
    edited 2009-11-30 18:38
    Charlieplexing to cut pin count. C'mon, get creative.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    JMH
  • BTXBTX Posts: 674
    edited 2009-11-30 19:55
    Hi Fred and everybody.

    @Graham
    I said my "modest oppinion" because this forum is full of people that knows a lot about electronics... I'm only a little "ant" here. sad.gif

    @Fred
    Sorry, in my point number two, I wrote "too slow", but I mean "too low resistor value".
    I understand your explanation, but how fast are your pulses ?, I suposse that we are talking about some hundreds of Hz, kwin schematic should work well with about 1K base resistor, and maybe with the Ri in the collector circuit better, just the most simple configuration. Then I mean a mosfet directly to pchip pin (plus resistor in parallel from gate to GND) would work better too.

    About the PWM technique I should talk a bit about some of my last experience.

    I had to controll a "big" shift led register (128 outs x 6) and get 256 levels gray scale with it, and get a video signal of 60fps that looks well at the humnan eye, and at a video camera. (That's for a led screen). (I hope it is clear what I mean).
    I found using one propeller that I can't do it (neither using six cogs), that's works fine for human eye, but I ever had a flicker showing the screen with a video camera.

    My first try, was to charge the data in the shift registers to get leds on, and repeat this 256 times, but, depending the gray scale that i need, turning each led off at the desired time, for each pixel. That was very bad, gives me very bad speed at all. (simple PWM technique)
    Although some great man of this forum, tried to help me a lot with differents ideas, I can't get this works well, but...Then I found a great solution.

    Then I think the following:
    With the gray levels data, to generate new data, this is 128 bytes for the MSB bits of the gray data (bit7), then 128 bytes for the bit6 of the gray data, then 128 bytes for the bit5 of the gray data, ans so on until the 128 bytes for the bit0 (LSB bit).
    After this, I cloked that data in the shift registers, waiting for eight differents times for each bit, let me say a time of N uSeg, I did, 8xN for the first 128 bytes (MSB), 7xN for the following 128 bytes, ......... 1xN for the last 128 bytes (LSB).
    That was, what gives me the solution.

    I don't know if you can understand what I mean, sorry it is very difficult for me to write this in English, I will try an example now.

    Suposse you have a gray level for one led wich value is 131 dec. so, it is %10000011.
    You could do this: send a %10000000 and wait 128uSeg, then, send %00000000 and wait for 64uSeg, then, send %00000000 and wait for 32uSeg,............................................... then, send %00000010 and wait for 2uSeg, then, send %00000001 and wait for 1uSeg.
    That will show you a gray level of 131 dec in 8 clockings !! NOT at 256 clocking, like need a normal PWM technique.

    Hope this helps, now is your turn to play with it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Regards.

    Alberto.
  • MarcelloMarcello Posts: 29
    edited 2009-11-30 20:16
    Charlieplexing !

    Charlieplexing !!
  • FredBlaisFredBlais Posts: 380
    edited 2009-11-30 22:50
    Number of pin is not a problem :P·· I'm fine with the 18 pins that it takes for multiplexing
    Marcello said...

    Charlieplexing !

    Charlieplexing !!

  • FredBlaisFredBlais Posts: 380
    edited 2009-11-30 22:54
    Thanks BTX, I'll give it a try.
    For the language, I can understand since I have the same problem as you. I learned english by playing snes and playstation1 games and of course, by reading books and forums... I can barely speak english. The web is an english thing, we have to live with that [noparse]:)[/noparse]
  • FredBlaisFredBlais Posts: 380
    edited 2009-11-30 22:55
    Thanks BTX, I'll give it a try.
    For the language, I can understand since I have the same problem as you. I learned english by playing snes and playstation1 games and of course, by reading books and forums... I can barely speak english. The web is an english thing, we have to live with that [noparse]:)[/noparse]
  • FredBlaisFredBlais Posts: 380
    edited 2009-11-30 22:56
    By the way, anybody saw the 3d cube I done with openGL? What do you think of it?
  • OakGraphicsOakGraphics Posts: 202
    edited 2009-11-30 23:56
    Mike Huselton said...
    I have 3 tubes of MAX6956AAX IC's - they are I2C constant-current drivers - no resistors needed.
    Check out the MAXIM spec sheet.

    Want some?

    I do! smile.gif
  • kwinnkwinn Posts: 8,697
    edited 2009-12-01 03:09
    Yes you can PWM the circuit I posted. I have used it to drive 7 segment leds with PWM for dimming. Also used it with optoisolators without PWM.

    The biggest advantage is I can drive the leds from an unregulated supply without the current/intensity changing if the voltage changes.
  • FredBlaisFredBlais Posts: 380
    edited 2009-12-01 05:33
    kwinn said...
    Yes you can PWM the circuit I posted. I have used it to drive 7 segment leds with PWM for dimming. Also used it with optoisolators without PWM.

    The biggest advantage is I can drive the leds from an unregulated supply without the current/intensity changing if the voltage changes.
    If I use this circuit with pwm, and let's say·and I need to light·5 leds. What happen if all the leds cathodes are tied to the collector of this circuit, and I want to multiplex the leds? The maximum duty will now be 20%, for each led. If I want to keep the same current, do I have to provide 5 times the current because the time for each leds is 5 time less? I'm puzzLed (no pun intended).
Sign In or Register to comment.