Hobby Components 8x8x8 Cube Kit (HCKITS0050)

Hobby Component self build kits
ILYBTodd
Posts: 32
Joined: Mon Nov 05, 2018 6:20 pm

Re: Hobby Components 8x8x8 Cube Kit (HCKITS0050)

Post by ILYBTodd » Mon Jan 04, 2021 1:44 am

Hi Andrew,

Any suggestions for where to find more patterns to expand the display offering even more?

Or perhaps where to learn how to write your own? Most searches I've done come back with how to build not how to write for an 8x8x8 LED cube.

Todd

andrew
Site Admin
Posts: 1119
Joined: Sun Aug 05, 2012 4:15 pm

Re: Hobby Components 8x8x8 Cube Kit (HCKITS0050)

Post by andrew » Mon Jan 04, 2021 3:47 pm

I think the problem with searching for more patterns is that every cube will be of a different design and so any patterns, if available, won't be compatible with other cubes. In fact a lot of the 'off the shelf' cube kits aren't even Arduino based. I think the most useful thing you can get out of searching for patterns is to get ideas for creating your own additional patterns.

As the cube is Arduino based you do have the ability to add patterns to it yourself but it does require some understanding of how to write and upload Arduino sketches. I don't know if you've already come across the thread for the library in the software section of the forum here:

viewtopic.php?f=58&t=1968

This explains all the components of the library but it is just a reference for the library functions and is a bit of a dry read if you're not very experienced with writing sketches. It is simpler than it looks though and if you're feeling brave enough to have a go at writing and uploading your own sketch it is worth having a go at creating your own patterns. Tho give you an example...

The library has a few basic drawing commands that will allow you to control the state of the cubes LEDs:

SetVoxel(x,y,z) simply allows you to turn on one of the LEDs by specifying its x, y, and z coordinate.

ClearVoxel(x, y, z) is similar to SetVoxel except it turns off an LEDrather than turning it on.


So for example to turn on one of the corner LEDs you can do this:


  1. // Include the cube library
  2. #include "HC8x8x8Cube.h"
  3.  
  4. void setup()
  5. {
  6.   // Initialise the library
  7.   CubeInit();
  8.  
  9.   // Turn on the LED at coordinate 0,0,0
  10.   SetVoxel(0, 0, 0);
  11. }
  12.  
  13.  
  14. void loop()
  15. {
  16. }


To make an animation of a single LED moving across the cube you could use the two above commands like this:



  1. #include "HC8x8x8Cube.h"
  2. #include "HC8x8x8_Cube_Patterns.h"
  3.  
  4. void setup()
  5. {
  6.   CubeInit();
  7. }
  8.  
  9.  
  10. void loop()
  11. {
  12.   ClearVoxel(7, 0, 0);
  13.   SetVoxel(0, 0, 0);
  14.   delay(500);
  15.  
  16.   ClearVoxel(0, 0, 0);
  17.   SetVoxel(1, 0, 0);
  18.   delay(500);
  19.  
  20.   ClearVoxel(1, 0, 0);
  21.   SetVoxel(2, 0, 0);
  22.   delay(500);
  23.  
  24.   ClearVoxel(2, 0, 0);
  25.   SetVoxel(3, 0, 0);
  26.   delay(500);
  27.  
  28.   ClearVoxel(3, 0, 0);
  29.   SetVoxel(4, 0, 0);
  30.   delay(500);
  31.  
  32.   ClearVoxel(4, 0, 0);
  33.   SetVoxel(5, 0, 0);
  34.   delay(500);
  35.  
  36.   ClearVoxel(5, 0, 0);
  37.   SetVoxel(6, 0, 0);
  38.   delay(500);
  39.  
  40.   ClearVoxel(6, 0, 0);
  41.   SetVoxel(7, 0, 0);
  42.   delay(500);
  43. }


Using the for loop function in C you can of course simplify the above sketch and there are also further commands in the library to simplify the above animation even further but the above sketches show that writing a sketch to control the LEDs isn't as complicated as it would first seem.

There are also other useful drawing commands that work in a similar way but here is the two most useful:

Line(x1, y1, z1, x2, y2, z2) Allows you to draw a line by specifying the x, y, and z coordinates of each end of the line

Cube(x1, y1, z1, x2, y2, z2, Solid) will allow you to draw a solid or wireframe cube by specifying the x, y, and z coordinates of the opposite corners of the cube

Sorry for the long reply but hope that helps a little.
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

ILYBTodd
Posts: 32
Joined: Mon Nov 05, 2018 6:20 pm

Re: Hobby Components 8x8x8 Cube Kit (HCKITS0050)

Post by ILYBTodd » Mon Jan 04, 2021 6:09 pm

As always very helpful.

I received a cheap LED cube as a gift that was preprogrammed on an STC chip and got frustrated with lack of documentation or help. It didn't work well. It was good for the soldering practice if nothing else.

Your kit and your support made all the difference and now I've made several cubes including the simpler 4x4x4 cube. It is time to learn more about the code and so your feedback is much appreciated.

I'm surprised no one in the forum has offered any additional patterns to be added to the Library but I will probably learn why once I try to do some development on my own.

Once again, thanks for your help.

Todd

andrew
Site Admin
Posts: 1119
Joined: Sun Aug 05, 2012 4:15 pm

Re: Hobby Components 8x8x8 Cube Kit (HCKITS0050)

Post by andrew » Wed Jan 06, 2021 9:22 am

I received a cheap LED cube as a gift that was preprogrammed on an STC chip and got frustrated with lack of documentation or help.
Yeah most of them use this chip. I believe its a Chinese 8051 based microcontroller and despite it being used for years there is virtually no documentation for it - in English at least.

It is time to learn more about the code and so your feedback is much appreciated.
If you get stuck at any point please feel free to post here. One tip, if you do find yourself having a go and uploading sketches to it a lot you may want to invest in a USB to serial adaptor that has a DTR pin on it. This will allow you to automatically upload sketches without having to press the reset button all the time.

I'm surprised no one in the forum has offered any additional patterns to be added to the Library
Yes this is a shame. Both cube kits are extremely popular and we've been selling them for years now but very few customers seem to want to reprogram them. I guess a lot of people buy them as an electronics project rather than an because it's compatible with an Arduino
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

Dimmyjeans
Posts: 2
Joined: Fri Jan 08, 2021 9:22 am

Re: Hobby Components 8x8x8 Cube Kit (HCKITS0050)

Post by Dimmyjeans » Mon Jan 11, 2021 5:09 am

Great little project to pass some time during lock-down 3.
I started building on Thursday morning and finished on Sunday night. So 40 hours at about 10 hours per day!
The board is pretty straight forward and would've only taken a couple of hours - if it wasn't for the male/female pins. I had to carefully cut each one (80 of them) out of their plastic strip, as it was impossible to simply snap them apart, as described in the instructions.
I'm sure the manufacturers could supply the pins loose? It might even prove a cheaper option.
The LED's are, of course, the most time consuming part of this project, and this is where most faults are likely to occur.
I am fortunate enough to have a bench power supply with adjustable voltage (0.5v to 32v) with a digital voltage and current display readout (it starts to display current at about 0.07mA) I find this invaluable when working with voltage/current sensitive components like LED's.
For example; To find the ideal working voltage of an LED, I slowly turn up the voltage until a current output starts to register on the display, then just drop back down a bit until no current is displayed. It turns out the LED's supplied with this kit work best at about - 3.2v.
Using the bench power supply, I tested each row of LED's as I soldered them. I soon noticed that every now and then one of the LED's would register a small current. Then later, when testing again as the rows were soldered together, I noticed that, as well as the the LED I was testing, one or two other LED's would glow slightly.
This indicated to me that a faulty LED was allowing a small reverse bias current to pass back through it.
There is a simple but somewhat unorthodox way of finding that LED, rather than trying to test all 64 LED's in situ. Simply reverse the polarity and ramp it up to 32v and test each row as normal. This destroys the faulty LED with a flash, or if there is no flash, it will still be destroyed and you can now find it by doing another proper test at normal voltage and polarity.
I found and replaced around 30 LED's this way. I cannot say if the LED's were actually faulty, or as a result of excessive heat or strain during soldering and assembly, but I am glad you provided enough spares to cover it.
All in all, a fun, interesting and educational project.
That just leaves me to build some kind of display case for it (I'm thinking of something like a mirrored perspex box to give it an additional 'infinity mirror' type effect)
Then of course there is the programming...

andrew
Site Admin
Posts: 1119
Joined: Sun Aug 05, 2012 4:15 pm

Re: Hobby Components 8x8x8 Cube Kit (HCKITS0050)

Post by andrew » Tue Jan 12, 2021 10:30 am

I started building on Thursday morning and finished on Sunday night. So 40 hours at about 10 hours per day!
That's quite some dedication. We have been selling a lot of the 8x8x8 and 4x4x4 kits since the original lockdown started for obvious reasons.

I'm sure the manufacturers could supply the pins loose? It might even prove a cheaper option.
Yeah we are on the lookout for a better solution but so far this is the best option we can find. Any single pin headers we've come across are either not a better solution, or would make the kit too expensive.

The LED's are, of course, the most time consuming part of this project, and this is where most faults are likely to occur.
Then later, when testing again as the rows were soldered together, I noticed that, as well as the the LED I was testing, one or two other LED's would glow slightly.
I cannot say if the LED's were actually faulty, or as a result of excessive heat or strain during soldering and assembly, but I am glad you provided enough spares to cover it.
This is something that some customers report every now and then and I don't want to draw any conclusions without some indisputable evidence as to what the actual issue is, but we are starting to get more and more convinced that it is being cause by bending of the legs close to the base of the LED.

For quite some time now we have been testing small quantities of LEDs from each batch of 1000 and we're not finding an issue there. As you say though we do put extra LEDs in the kit (~550 in total) to help cover any mistakes or issues.

The best advise we can give is to use a narrow pair of needle nose pliers to hold the leg at the base of the LED and bend the leg over the pliers as it's not necessary to bend the legs right at the base. Glad to hear you enjoyed building your kit anyway.
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

Dimmyjeans
Posts: 2
Joined: Fri Jan 08, 2021 9:22 am

Re: Hobby Components 8x8x8 Cube Kit (HCKITS0050)

Post by Dimmyjeans » Tue Jan 12, 2021 11:53 pm

Thank you for your reply Andrew.
Yeah we are on the lookout for a better solution but so far this is the best option we can find. Any single pin headers we've come across are either not a better solution, or would make the kit too expensive.
When you say "Single Pin Headers" I can see how this would be more expensive, as presumably the pins would still be encapsulated in plastic. What I meant was, to approach the 'Header' manufacturers and ask them if they could supply the pins 'un-encapsulated' for bespoke projects. I'm sure they would be happy to do so, and my guess is they would be considerably cheaper in a small box of thousands, which could then be weighed out into the required quantity for each kit. Just a thought.

I think you are right about the LED's. It is just natural instinct to bend the short lead straight down close to the LED to keep things tidy - also it makes it easier to align and solder onto the next LED. If I get another kit like this I will take the extra time and effort on bending the legs, or even build a better jig that accomplishes it.
Kind regards

andrew
Site Admin
Posts: 1119
Joined: Sun Aug 05, 2012 4:15 pm

Re: Hobby Components 8x8x8 Cube Kit (HCKITS0050)

Post by andrew » Thu Jan 14, 2021 11:56 am

What I meant was, to approach the 'Header' manufacturers and ask them if they could supply the pins 'un-encapsulated' for bespoke projects.
Ah ok, sorry I misunderstood. It's a good suggestion and we'll ask next time we order more stock but I suspect that even though we order a lot of these headers we're small fry in relation to how many they manufacture.
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

ILYBTodd
Posts: 32
Joined: Mon Nov 05, 2018 6:20 pm

Re: Hobby Components 8x8x8 Cube Kit (HCKITS0050)

Post by ILYBTodd » Sat Jan 30, 2021 3:47 pm

andrew wrote:
Mon Jan 04, 2021 3:47 pm
I think the problem with searching for more patterns is that every cube will be of a different design and so any patterns, if available, won't be compatible with other cubes. In fact a lot of the 'off the shelf' cube kits aren't even Arduino based. I think the most useful thing you can get out of searching for patterns is to get ideas for creating your own additional patterns.

As the cube is Arduino based you do have the ability to add patterns to it yourself but it does require some understanding of how to write and upload Arduino sketches. I don't know if you've already come across the thread for the library in the software section of the forum here:

viewtopic.php?f=58&t=1968

This explains all the components of the library but it is just a reference for the library functions and is a bit of a dry read if you're not very experienced with writing sketches. It is simpler than it looks though and if you're feeling brave enough to have a go at writing and uploading your own sketch it is worth having a go at creating your own patterns. Tho give you an example...

The library has a few basic drawing commands that will allow you to control the state of the cubes LEDs:

SetVoxel(x,y,z) simply allows you to turn on one of the LEDs by specifying its x, y, and z coordinate.

ClearVoxel(x, y, z) is similar to SetVoxel except it turns off an LEDrather than turning it on.


So for example to turn on one of the corner LEDs you can do this:


  1. // Include the cube library
  2. #include "HC8x8x8Cube.h"
  3.  
  4. void setup()
  5. {
  6.   // Initialise the library
  7.   CubeInit();
  8.  
  9.   // Turn on the LED at coordinate 0,0,0
  10.   SetVoxel(0, 0, 0);
  11. }
  12.  
  13.  
  14. void loop()
  15. {
  16. }


To make an animation of a single LED moving across the cube you could use the two above commands like this:



  1. #include "HC8x8x8Cube.h"
  2. #include "HC8x8x8_Cube_Patterns.h"
  3.  
  4. void setup()
  5. {
  6.   CubeInit();
  7. }
  8.  
  9.  
  10. void loop()
  11. {
  12.   ClearVoxel(7, 0, 0);
  13.   SetVoxel(0, 0, 0);
  14.   delay(500);
  15.  
  16.   ClearVoxel(0, 0, 0);
  17.   SetVoxel(1, 0, 0);
  18.   delay(500);
  19.  
  20.   ClearVoxel(1, 0, 0);
  21.   SetVoxel(2, 0, 0);
  22.   delay(500);
  23.  
  24.   ClearVoxel(2, 0, 0);
  25.   SetVoxel(3, 0, 0);
  26.   delay(500);
  27.  
  28.   ClearVoxel(3, 0, 0);
  29.   SetVoxel(4, 0, 0);
  30.   delay(500);
  31.  
  32.   ClearVoxel(4, 0, 0);
  33.   SetVoxel(5, 0, 0);
  34.   delay(500);
  35.  
  36.   ClearVoxel(5, 0, 0);
  37.   SetVoxel(6, 0, 0);
  38.   delay(500);
  39.  
  40.   ClearVoxel(6, 0, 0);
  41.   SetVoxel(7, 0, 0);
  42.   delay(500);
  43. }


Using the for loop function in C you can of course simplify the above sketch and there are also further commands in the library to simplify the above animation even further but the above sketches show that writing a sketch to control the LEDs isn't as complicated as it would first seem.

There are also other useful drawing commands that work in a similar way but here is the two most useful:

Line(x1, y1, z1, x2, y2, z2) Allows you to draw a line by specifying the x, y, and z coordinates of each end of the line

Cube(x1, y1, z1, x2, y2, z2, Solid) will allow you to draw a solid or wireframe cube by specifying the x, y, and z coordinates of the opposite corners of the cube

Sorry for the long reply but hope that helps a little.
Hi Andrew,

Just having some fun and building on the demo sketch you provided way back.

I haven't been able to get the new sketch to upload directly, either using the supplied cable or when using a Sparkfun FTDI breakout I've use on other projects in the past. Changed the board type to a Nano, hit the reset after compiling etc. etc. Finally was able to upload new code by pulling the 328P off and programming it as an UNO boar
Tinyloader.jpg
d using an off line programmer I built for a variety of chips years ago and then only by holding the shift key while hovering over the compile and upload arrow in the Arduino IDE.
You do not have the required permissions to view the files attached to this post.

andrew
Site Admin
Posts: 1119
Joined: Sun Aug 05, 2012 4:15 pm

Re: Hobby Components 8x8x8 Cube Kit (HCKITS0050)

Post by andrew » Sun Jan 31, 2021 8:56 am

I haven't been able to get the new sketch to upload directly, either using the supplied cable or when using a Sparkfun FTDI breakout I've use on other projects in the past. Changed the board type to a Nano, hit the reset after compiling etc. etc.
Odd, it's a bit fiddly with the supplied cable but using an adapter that includes the DTR line it should just work. Under the tools menu did you set the processor to 'ATMega328P (Old Bootloader)' ?


ArduinoIDE_Bootloader.png
You do not have the required permissions to view the files attached to this post.
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

Post Reply