3x3x3 led cube
FredBlais
Posts: 380
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 . ( 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
Post Edited (FredBlais) : 11/30/2009 2:29:54 PM GMT
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 . ( 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
Post Edited (FredBlais) : 11/30/2009 2:29:54 PM GMT
Comments
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
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.
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]
·
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.
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
Check out the MAXIM spec sheet.
Want some?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
JMH
In fact, it could work if I pwm the pin?
Post Edited (FredBlais) : 11/30/2009 6:16:11 PM GMT
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
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
JMH
@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.
@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.
Charlieplexing !!
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]
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]
I do!
The biggest advantage is I can drive the leds from an unregulated supply without the current/intensity changing if the voltage changes.