Mojo controlled LED cube

Projects you are planning or working on with the Mojo
Post Reply
BryanO
Posts: 5
Joined: December 26th, 2014, 10:07 pm

Mojo controlled LED cube

Post by BryanO » December 30th, 2014, 6:33 pm

I got a Mojo for Christmas and I've also been wanting to make an LED cube for a while. The fad these days is to use an Arduino to control them but I thought I could try using my Mojo. Im making this thread now to document the progress and get any help as needed. Im not a pro with FPGAs by any means but I do understand digital logic and have had quite of few university courses where FPGAs were used substantially. I believe this project to be well within my capabilities and should be a lot of fun. I'll try to document as best as I can so maybe other people can benefit from it :).

Project details:

Parts list:
  • 200 Blue 5mm LEDs (need 125 but got extra for screwups)
    200 150Ω resitors (came with LEDs)
    5 2N2222 transistors
    1 Mojo
I'll be making a 5x5x5 blue LED cube. I plan to use the 2N2222s to switch between the five layers. I havent gone through the math but Im pretty sure they can handle it. In any case I have about 1000 of these in a box so I wanna try to use them first. I'll put some decoders on the Mojo to allow me to address individual columns. In this way I can pick out any individual LED as needed. I also want to have USB capabilities for this cube. Namely I'm interested in synchronizing it to music. I've never done this before but I hope it wont be over my head. Otherwise failing the music synchronization not working I'd still like to be able to write my own pattern algorithms and have them displayed on the cube. This I believe can be done by sending data over USB, possibly serial UART and creating a block to process this data into LED information on the Mojo.

I intend to use this project to learn FPGAs and verilog better than my current understanding. If all I wanted to do was make a cube I could do it much easier if I used a microcontroller, but there would be know fun in that! I hope I can get some useful advice and criticism here when needed, as well as hopefully provide decent documentation into the making of the project for anyone else who is interested.

BryanO
Posts: 5
Joined: December 26th, 2014, 10:07 pm

Re: Mojo controlled LED cube

Post by BryanO » December 31st, 2014, 2:56 pm

I made a small 3x3x3 prototype to use as a proof of concept. Its a very sloppy cube since I hand assembled it without using any kind of support structure to hold the LEDs in place during assembly. I tested the cube with my continuity on my multimeter and each LED is addressable in the manner I had hoped. Probing the cathodes with the negative meter probe let me address a single LED by using the positive probe on any column. So first level + first column will light up exactly one LED (LED0) and first level + second column will light up the next LED alone (LED1) and so on. Next Im going to put the cube on some protoboard and add the transistors to allow the Mojo to do the plane shifting. I'll then just need to feed each of the nine columns as an input to the Mojo. For the 3x3x3 this will be a total of 12 inputs to the Mojo. The scaled up 5x5x5 cube will take 25 columns and 5 transistors to address each LED. This will be 30 I/O pins. Luckily the Mojo has a ton so this is more than doable.

After I get this test cube on a protoboard I can then implement logic on the Mojo. I plan to use decoders that will take data from USB as the input and turn it into column/plane addresses to turn on single LEDs. Theres probably other ways to do it but this is just what made sense to me, but feel free to share any improvements you might have. Im hoping to have some Mojo logic implemented by the weekend so we'll see how it goes!

Image

BryanO
Posts: 5
Joined: December 26th, 2014, 10:07 pm

Re: Mojo controlled LED cube

Post by BryanO » January 2nd, 2015, 9:54 pm

I have a working protoype now. I did make one small mistake and noticed that the wire jumper from the bottom level to the 0 level transistor is not actually connected. This means the bottom level of LEDs will not light up. Still, the proof of concept stands so I think Im ready to move forward with design of the 5x5x5 cube. Heres a short video and all of my Verilog code for all interested.

Video:
https://vimeo.com/115836504

logic driver:
http://pastebin.com/h7yByFZq

top level synthesis module:
http://pastebin.com/JYPdJxXa

UCF:
http://pastebin.com/6YVjjZyv

BryanO
Posts: 5
Joined: December 26th, 2014, 10:07 pm

Re: Mojo controlled LED cube

Post by BryanO » January 11th, 2015, 3:07 pm

Sorry for the absence. I have managed to get a lot more work done on the project. I have the full sized 5x5x5 cube constructed. I also have a PCB designed using EAGLE to make the schematics and DesignSpark to make the PCB since I do not have the licensed version of EAGLE and cant make the pcb as large as needed using EAGLE. This is my first time ever designing a PCB so it's probably not too great but it should work for what I need, and will look much nicer than a large perfboard prototype. Here's the full cube and the pcb layout. Still waiting to get the PCB printed since I need to wait til my next payday, but the majority of the work is done for this. The rest will be improving the Verilog to add complexity to the cube patterns.

Fully assembled cube (still needs to be straightened out a bit):
Image

EAGLE schematic:
Image

DesignSpark pcb:
Image

embmicro
Site Admin
Posts: 834
Joined: March 24th, 2013, 12:45 pm

Re: Mojo controlled LED cube

Post by embmicro » January 20th, 2015, 1:58 pm

This is awesome! One of my first big projects was an LED cube. It was a lot of fun but took forever to wire everything!

It would be awesome to see a video when you get it running.

BryanO
Posts: 5
Joined: December 26th, 2014, 10:07 pm

Re: Mojo controlled LED cube

Post by BryanO » January 31st, 2015, 6:10 pm

Thanks, sorry for the lack of updates. I've been busy with classes since spring semester started. Im still a senior in electrical engineering so I have a lot of work to do and I only work on this cube in my free time. That said I will post an update video and updated HDL tomorrow when I get a chance. It's not much, just the new assembled 5x5x5 cube and the same driver updated to allow for 25 columns and 5 levels. As I get time I will be improving the HDL to do more interesting patterns.

Post Reply