So i'm doing a 8x8x8 cube - Page 1
Forum section: electronics / projects

author: Lee Newsum
author_rank: Newbie
timestamp: April 11, 2017, 10:09:31 pm
content: So I'm doing a 8x8x8 cube with my Adriano UNO R3 so I got there's plans ( see attach ) I have work out most of it works but I do not see the pint of the Capacitor part 1 1-4 part 2 4-12 what are they doing there?

author: Avacee
author_rank: Unknown
timestamp: April 11, 2017, 10:14:57 pm
content: 1: Power Circuit - The three are the smoothing capacitors for the circuit.2: Smoothing capacitors again. One per IC and the nearer to the individual IC's VCC pin the better.Edit: Added -> The voltage will be bobbing up and down with switching the LED's off and on and they'll act as a small power repository to smooth out the bobbles.Ironically something similar came up in another thread yesterday and there's a small discussion about how vague it can be if the schematic just shows 3 capacitors with no description as to their function.You've provided a perfect example of how it can be confusing.https://www.eevblog.com/forum/beginners/why-is-there-three-capacitors-across-the-power-rails-in-ardunio/

author: Lee Newsum
author_rank: Newbie
timestamp: April 11, 2017, 10:37:53 pm
content: Some think like this but all the chips?

author: Avacee
author_rank: Unknown
timestamp: April 11, 2017, 10:53:02 pm
content: Not quite but nearly - they go between 5V and GND - you have it between 5V and the pin.See this linkhttps://learn.sparkfun.com/tutorials/capacitors/application-examplesSee how they are between 5V and GND but next to the IC.The placement on your pcb, stripboard, breadboard should be as near to the IC as possible.

author: Ian.M
author_rank: Super Contributor
timestamp: April 11, 2017, 10:55:42 pm
content: GACK!2N2222 transistors in parallel for increased current handling.Also, I don't like the parallel latch approach without a strobe for the 74HC138 latch address decoder at all. Unless the sketch sequences the signals A1,A2 & A3 in Grey code, its highly probable it will sometimes glitch on address transitions and latch the incorrect data into one of the other 74HC174 chips, causing the cube to have a background flicker. As there aren't any spare pins you can't simply add a strobe (unless you stick a 74HC238 in as a layer decoder to free up five pins), so I'd suggest using 74HC595 SIPO shift registers to drive the display. If you are going to do that you might as well use another one for the layers, which gets it down to three signal wires connected to the Arduino. The layer driver transistors should be low Vgs threshold MOSFETs - cant spec those until you tell us the intended individual LED current and whether you are building this as a surface mount or through hole board.On an Arduino, the 74HC595 shift register approach will probably be faster updating a layer than bit-banging the I/O pins with digitalWrite, provided you use the hardware SPI peripheral. It also leaves most of the pins free for sensors if you want to make your cube interactive, and leaves RX and TX free so you can easily make it PC controlled.Yes, decouple *ALL* the chips! The cost of the capacitors is so low compared to the cost of time wasted solving random misbehaviour caused by poor decoupling that it ijust isn't worth doing anything else. If you were making tens of thousands of them, it might be worth spending some time seeing how low you could push the caps to chips ratio without Muntzing it too far, but its *NEVER* worth doing that for a one off unless you are builoding something critically weight and space constained,

author: Nusa
author_rank: Super Contributor
timestamp: April 11, 2017, 11:24:58 pm
content: Part of your confusion is that each of the IC's actually has VCC(+5) and GND pins, even though they're not shown/hidden on the schematic. Nevertheless, they are there, and it's assumed you're knowledgeable enough to know that when reading the schematic.

author: Lee Newsum
author_rank: Newbie
timestamp: April 11, 2017, 11:41:43 pm
content: so like this?So Ian.M "2N2222 transistors in parallel for increased current handling." so a different transistors would work better? I do not need 2 in parallel?I using there chips because I no they work and have cold to play with.I can get it working and upgrade then.edit:LEDsForward Voltage: 3.0V-3.3V(Max 3.8 )Reverse Current: 20mAthrough hole board

author: mariush
author_rank: Super Contributor
timestamp: April 11, 2017, 11:50:42 pm
content: You could simplify your project by using one or two of these 35 channel led drivers MM5451YN :http://uk.farnell.com/microchip/mm5451yn/led-driver-ic/dp/2510527Just use 32 channels from each one and light up 32 leds or 64 leds (a whole layer) at a time.Or you some of those 16 channel led driver ICs, they're cheap and easy to connect almost as shift registers, just push 64 bits at a time to your led driver chips and be done with it.

author: Ian.M
author_rank: Super Contributor
timestamp: April 12, 2017, 01:04:00 am
content: The trouble with the MM5451 chips is they require 36 clock pulses to load them. As this isn't divisible by 8, you cant use the Arduino hardware SPI, so you'll have to bit-bang them, which will be much slower. 16 channel SPI interface LED drivers would be good - you could halve the number of chips per plane and probably eliminate the resistors. 24 or 32 chanel ones would be even better.Lets hold off on finding a transistor till we've sorted out the LED drivers as, depending on the driver, the layer transistors may need to be moved to the high side. Mosfets would be nice because they can have a much lower Vds drop so will run cooler and only need drive current from the digital output when actually switching as they are voltage controlled.Worst case, for low side,I'd bet there's a Zetex super-Beta NPN part that would do the job. You probably cant use Darlingtons due to the extra Vce_sat drop, and the fact you need 3.6V for the LEDs, only leaving 1.4V for Vce_sat and voltage drop in the individual LED drivers.

author: retrolefty
author_rank: Super Contributor
timestamp: April 12, 2017, 03:04:39 am
content: Quote from: mariush on April 11, 2017, 11:50:42 pmThe 16 bit serial shift register chip I used came with programmable (via a single resistor) provided constant current outputs, perfect for driving LEDs without needing current limiting resistors.

author: BrianHG
author_rank: Super Contributor
timestamp: April 12, 2017, 05:39:23 am
content: You can always cheat using RGB WS2812B leds/led strings. All you need to do is provide 5v and 1 serial output pin and you will have 16million color 8x8x8 cube, no other electronics other than power supply coupling caps. If you use 8 outputs, you can feed 8x8 in parallel x8 giving you a speed increase, or, 16 outputs feeding 4x8 bank making 8x8x8, or, 32 outputs driving a 2x8 bank. Since your original design went for just simple on-off, monochrome approach, with a little smart software if you want only 1 global programmable color, you can simplify the serial feeding buss as if it were parallel bit-bang approach.Example: (Not my video, but I did play with these and they are killer bright)They already come in strings of various configurations, see here: (The come wired on wires, on flex cable, with huge diffused mountable ball domes, even waterproof outdoor versions...)https://www.alibaba.com/trade/search?fsb=y&IndexArea=product_en&CatId=&SearchText=ws2812b+stringThis sort of takes the fun out of manually wiring everything yourself by hand.

author: cowana
author_rank: Frequent Contributor
timestamp: April 12, 2017, 08:31:05 am
content: Quote from: BrianHG on April 12, 2017, 05:39:23 amWorth pointing out that on an arduino, getting data out to one of these strips requires very tight timing routines and uses all the chip's foreground processing power (as the serial data is clocked out). The only way this would provide a speed increase is if something like DMA was setup on a much more complex processor, to load up the LEDs in the background - meaning multiple channels could run simultaneously.

author: Jeroen3
author_rank: Super Contributor
timestamp: April 12, 2017, 08:38:06 am
content: There is another issue you need to aware of: reverse leakage current.You can't buy the cheapest LED's and expect an 8x8x8 to work properly.

author: W9GFO
author_rank: Regular Contributor
timestamp: April 12, 2017, 09:26:19 am
content: Quote from: cowana on April 12, 2017, 08:31:05 am... or use aPropeller chip.

author: BrianHG
author_rank: Super Contributor
timestamp: April 12, 2017, 09:41:01 am
content: Quote from: cowana on April 12, 2017, 08:31:05 amYes, to function, this inner piece of the loop needs to be like this (depending on the CPU speed, you may need to add nop s):Code:// setup Color_palette if you like...// you can turn off dma here for top speedfor (y=0; y<=7;y++){for (z=0; z<=7;z++){pix = pixel_data(y,z); // note the the 'x' coordinate is the 8 bits of the data// or turn off dma here for a little slower, but allow things like com ports to respond in the middle of the large refreshfor (col=0; col<=23; col++){Output_port = 255;Output_port = Color_palette(col) && pix;Output_port = 0;Output_port = 0;}//safe to turn on dma}}It needs to be tight like this for any speed. Outside of this tight part, you have the for y & for z loop, initially, you can set the color_palette whose 24 color bits are stored across (col) and, like this, you may use a different color for each x coordinate. You may also smoothly adjust your palette over every complete refresh for effect.Note that this is how I would do it in my PIC software which currently drives a string of these LEDs. Note that the PIC was running at 32 Mhz.

author: Jeroen3
author_rank: Super Contributor
timestamp: April 12, 2017, 09:47:23 am
content: Even on a complex processor you can't put much of it in the background. Because it requires massive amounts of memory. Or you're just doing small parts of it in the background.If only the DMA could use bitbanding!A dual core chip, where you have one entire core as DMA, is the solution to get this to work in "the background".It should be possible to program an tiny to function as UART/SPI to weird pwm spi.

author: BrianHG
author_rank: Super Contributor
timestamp: April 12, 2017, 09:53:19 am
content: As a test, the OP can run and scope my code and see if overall the refresh time is to his liking since you don't need any LEDs to test this. Remember, you also need to add a dead time after the refresh so the LEDs latch the new colors an all change, this is when you would most likely be doing other stuff.

author: mariush
author_rank: Super Contributor
timestamp: April 12, 2017, 10:03:40 am
content: With an 8x8x8 cube I suspect OP may want to use thinner wires and/or leds - the programmable leds are usually chunky and on wide flexible strips, which would block a lot of light.For rigidity, for each layer of the cube, I'd probably try using a thin sheet of plexiglass or some other material (for example the cover of a CD case) with tiny holes drilled for the leads of each led and big chunks cut out where they're not needed - basically leave just narrow bridges between leds to stretch thin wires between the leds (you could glue down the wires to the plastic or use some transparent scotch tape)

author: Ian.M
author_rank: Super Contributor
timestamp: April 12, 2017, 10:11:11 am
content: Even leaving aside the difficulties of the WS2812 protocol, just moving the data fast enough is an issue on its own.Quote from: cowana on April 12, 2017, 08:31:05 amArduino digitalWrite() is notorious for being slow. On a 16MHz Uno, IIRC the fastest you can toggle a single pin using it is about 120KHz. That means to set up a whole byte then pulse a strobe pin using digitalWrite() limits you to under 11.7 KB/sec even if your program is doing absolutely nothing else. As there isn't any complete port available, even directly writing to the ports doesn't help as much as one would like, as you will have to shift and mask, and write two nibbles separately.However the hardware SPI peripheral can do sustained burst transfers of 700 KB/sec simply using SPI.transfer().This means that on AVR based Arduinos, SPI based I/O can be *MUCH* faster than direct parallel I/O. A conventionally programmed MCU, without DMA to accelerate anything and with a whole 8 bit port available would be the other way around. e.g. for a PIC18 or 16F1xxx that supports auto-increment of an index register, 4 instructions to update the port and toggle the strobe pin, and another three to decrement the loop count and loop, means that, if they are running at the same number of MIPS, parallel output on a PIC will be 3.2 times faster than the Arduino SPI output.Arduino really does require a different mindset . . . . .

author: BrianHG
author_rank: Super Contributor
timestamp: April 12, 2017, 10:18:44 am
content: Quote from: mariush on April 12, 2017, 10:03:40 amReally, see:https://www.alibaba.com/product-detail/5V-12V-24V-WS2811-WS2812B-DMX512_60416871149.html?spm=a2700.7724838.0.0.alqVjGhttps://www.alibaba.com/product-detail/26mm-diameter-WS2812B-LED-pixel-module_60294157765.html?spm=a2700.7724838.0.0.alqVjGhttps://www.alibaba.com/product-detail/DC-5V-35mm-led-pixel-light_60291977719.html?spm=a2700.7724838.0.0.OKnHqFhttps://www.alibaba.com/product-detail/35mm-ball-DC-5V-WS2812B-led_60300409229.html?spm=a2700.7724838.0.0.OKnHqF

author: BrianHG
author_rank: Super Contributor
timestamp: April 12, 2017, 10:24:05 am
content: Quote from: Ian.M on April 12, 2017, 10:11:11 amIt's really that bad.... Ohhhh boy.... That's slow.I guess using a 75 cent PIC in-between the Arduino RS-232 port and the string of LEDs isn't practical.So, how did the guy in the above video get it working. I mean, you still need to pulse the IOs super fast to get the LEDs he has working. The ws2812 needs a high and low pulse time at 400 ns to even function.

author: mariush
author_rank: Super Contributor
timestamp: April 12, 2017, 10:29:28 am
content: How would you arrange those string leds into a 8x8x8 cube?I was thinking more like this :See how just the wires alone make the leds deeper in the cube harder to see. It would be better with just single color leds (less wires)^ this guy has a series of videos for this project, check the description of the video above for theory, build video etc .. for single color everything is simplified.Or something like this :Think of something rigid but thin enough to keep layers flat and straight and not flex downwards, and connect the 8 "layers" on some bars on the edges or something to make the vertical structure rigid - potentially reuse the metal poles / bars / whatever for power as they're thicker.

author: Ian.M
author_rank: Super Contributor
timestamp: April 12, 2017, 10:41:05 am
content: Quote from: BrianHG on April 12, 2017, 10:24:05 amThere's some fancy trickery going on in the Arduino Neopixel library. I've just looked at it, and its hitting the bare metal, in assembler, with different hand tuned routines for different clock speeds. Also it may be operating out of spec for a WS2812. IIRC you can stretch the low time of each bits considerably before it is seen as a reset pulse. I know you need a 10 MIPS PIC18 to accurately reproduce the specified nominal bit timing.

author: BrianHG
author_rank: Super Contributor
timestamp: April 12, 2017, 10:56:11 am
content: Anything more than 500ns, or less than 300ns will mess up. (For a high 1, I know you can stretch the low time extensively) I got everything working fine and within spec with an 8 mips pic, with nop's and bit-test, or my andwf palette color trick across an 8 bit port. (8x8 matrix refreshed absurdly fast) If the Arduino is running at 4 mips, maybe you can just hit the functional timing mark in assembly.

author: Ian.M
author_rank: Super Contributor
timestamp: April 12, 2017, 11:12:51 am
content: @Mariush,IMHO its going to be a lot worse if you use PCBs or plexiglass to support the LEDs It just adds more obscuring or reflecting surfaces. Probably the best approach is SMD LEDs direct onto pre-stretched solid copper wires using a heat resistant assembly jig. Possibly use brass wire if you need greater rigidity. There has to be a compromise between ruggedness and aesthetics - thicker wires are easier to work with and a lot stiffer, but obscure the cube interior more. It would be a PITA, but if you used tinned copper wire for better solderability, you could mist all the wires with matte black paint before assembly, and scrape the spots you need to solder with a scalpel.If you build the cube in planes then orient the planes vertically one axis of each plane can be directly socketed in your base PCB. Add horizontal busbars to link the other axis across all the planes at the back of the cube, with a staircase of L shaped jumpers to bring each busbar down to the base pcb in a single row and that's all the interconnects required. If you need more cross-bracing duplicate the top busbar at the front. I'd strongly recommend using plug and socket connectors for the busbars - ideally find a bare socket contact inset will accept the wires directly. The plane's connection to the base PCB should also be socketed the same way so that the cube can be dismantled for maintenance.Neopixels are a different matter, you need power and ground busses so two thicker wires but the data bus daisychains from one to the next and is very low power so could be done with hair thin wire. Each plane would be a grid with the power and ground wires linked to busbars at the edge, the data pins linked in a serpentine layout, and a flylead from the first LED's data in to the base PCB.

author: tecman
author_rank: Frequent Contributor
timestamp: April 12, 2017, 03:48:59 pm
content: Quote from: Ian.M on April 11, 2017, 10:55:42 pmAgree. Paralleling transistors as you did can lead to thermal runaway. That is why an emitter resistor is typically used to balance currents. Or just use a single transistor that can handle the currentPaul

author: Ian.M
author_rank: Super Contributor
timestamp: April 12, 2017, 04:11:37 pm
content: Exactly. If one was staying with bipolars, deleting the extra transistors and base resistors and substitutingZetex ZTX689Bfor the remaining ones would do the job. Worst case it maintains its HFE>400 all the way up to Ic=2A, 2/3 of its max. continuous Ic limit of 3A, so with only 10mA base current, you can guarantee saturation with under 0.5V Vce_sat. Assuming you are running 64 LEDs @ 30mA If each into a single ZTX689B, that's only 1.92A, and 0.96W, well within its ratings.

author: Lee Newsum
author_rank: Newbie
timestamp: April 28, 2017, 12:23:34 pm
content: not read all the last post at this time.What you think of this?Edit: there is as many way to do this as LDE's in this cube, this way I no what is going on in this circuit.

author: Ian.M
author_rank: Super Contributor
timestamp: April 28, 2017, 01:02:47 pm
content: As you don't have a write strobe to one of the enable pins of the 74HC138 3 to 8 line decoder, when you change its address pins it is likely to glitch badly during the transition, and latch unwanted data into the wrong 74HC574 as well as latching the correct data into the selected one.You still haven't fixed the paralleled transistors issue.You are sourcing current for the LEDs from the 74HC574 outputs in spite of the fact they are much better at sinking than sourcing. (Worst case drop in the low side output MOSFET is 0.4V@6mA, but the typical drop in the high side MOSFET is 0.8V@6mA, with no worst case drop specified in the NXP datasheet I checked)That clearly calls for using the latches as active low, with high side transistors multiplexing each plane. Otherwise you'll be hard pushed to get decent brightness.What colour LEDs are yoiu using, or at least what's their Vf and at what current?As-is you'll be lucky to average 1mA with 1:8 multiplexing.If you are drawing up a schematic, learn how to use hierarchical or repeated blocks, and show us the collapsed view so we see the top level blocks but only see the repeated parts once. All we need to see is the transistor(s) driving one plane, one of the identical 74HC574 circuits + *ALL* the logic driving all of them. Part designations (eg J7 or U5) are just as important as the part value/number/description, otherwise its really clumsy to direct your attention to a particular part. Unlabelled 8 pin headers everywhere doesn't help your presentation. Each should have been annotated with its function.Sorry, it still earns the big

author: Lee Newsum
author_rank: Newbie
timestamp: April 28, 2017, 02:04:14 pm
content: Quote from: Ian.M on April 28, 2017, 01:02:47 pmfor the 74HC138 3 to 8 line decoder opps miss that.LED'sEmission colour BlueForward Voltage 3.0V-3.3V(Max 3.8 )Reverse Current 20mA"drawing up a schematic" yes and no more doing it for wiring. "part value/number/description" got to add that at some time.