You are on page 1of 105

Page|i

8*8*8 3D LED CUBE

A PROJECT REPORT

Submitted by

DARSHAK PANCHAL
BHAUMIK PATEL
ANAND SHAH

In fulfilment for the award of the degree

of

BACHELOR OF ENGINEERING
In

ELECTRICAL & ELECTRONICS ENGINEERING

INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING, AHMEDABAD.

Gujarat Technological University, Ahmedabad.

May,2014

8*8*8 3D LED CUBE IELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY &ENGINEERING
P a g e | ii

INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING, AHMEDABAD.


ELECTRICAL & ELECTRONICS
2014

CERTIFICATE

Date: / /

This is to certify that the dissertation entitled “8*8*8 3D LED CUBE” has been carried out

by BHAUMIK PATEL, DARSHAK PANCHAL&ANAND SHAH under my guidance in

fulfillment of the degree of Bachelor of Engineering in ELECTRICAL &

ELECRONICSENGINEERING (8th Semester) of Gujarat Technological University,

Ahmedabad during the academic year 2013-14.

Guide:

PROF. S.P. YADAV

Head of the Department

8*8*8 3D LED CUBE IELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY &ENGINEERING
P a g e | iii

ACKNOWLEDGEMENT

We would like to articulate our deep gratitude to our project guide PROF.S.P.YADAV, who has always

been source of motivation and firm support for carrying out the project. We express our gratitude to PROF.

YADAV, professor and head of department, electrical & electronics engineering for his invaluable

suggestion and constant encouragement all through this work.

We would also like to convey our sincerest gratitude and indebtedness to all other faculty members and

staff of department of electrical & electronics engineering of INDUS INSTITUTE OF TECHNOLOGY

& ENGINEERING, who bestowed their great effort and guidance at appropriate times without which it

would have been very difficult on our project work.

8*8*8 3D LED CUBE IELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY &ENGINEERING
P a g e | iv

INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING, AHMEDABAD.

ELECTRICAL & ELECTRONICS

2014

UTILIZATION CERTIFICATE

Date: / /

This is to certify that BHAUMIK PATEL, DARSHAK PANCHAL&ANAND SHAH of VIIIthsemester

ELECTRICAL & ELECTRONICS engineering department at INDUS INSTITUTE OF

TECHNOLOGY AND ENGINEERING has successfully completed the project titled “8*8*8 3D LED

CUBE”. The project may be useful to the society in near future as it contains various features related to the

environmental awareness, technological advancement and societal impact. I hope that this project will be

more successfully implemented in real time scenario in near future.

Guided By: Head of department

PROF. S.P.YADAV PROF.S.P.YADAV

8*8*8 3D LED CUBE IELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY &ENGINEERING
Page|v

INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING, AHMEDABAD.

ELECTRICAL & ELECTRONICS

2014

FEEDBACK CERTIFICATE

Date: / /

This is to certify that BHAUMIK PATEL, DARSHAK PANCHAL&ANAND SHAH of VIIIth

semester ELECTRICAL & ELECTRONICS engineering department at INDUS INSTITUTE OF

TECHNOLOGY AND ENGINEERING has successfully completed the project titled “8*8*8 3D LED

CUBE”. It is found that the students have carried out satisfactory work during the year and more avenues

related to applications of the project may be discovered.

Guided By: Head of department

PROF. S.P.YADAV PROF.S.P.YADAV

8*8*8 3D LED CUBE IELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY &ENGINEERING
P a g e | vi

PDE REPORT OF PROJECT


FORM 1

THE PATENTS ACT 1970 (FOR OFFICE USE ONLY)

(39 OF 1970)

& Application No.:

The Patents Rules, 2003 Filing Date:6/5/2014

APPLICATION FOR GRANT OF PATENT Amount of Fee Paid:

(See section 7,54 & 135 and rule 20 (1)) CBR No.:

Signature:

1. APPLICANT (S)

Name Nationality Address

Applicant’s name Indian Permanent Address

DARSHAK B PANCHAL 52,PART- 2,KHODIYARNAGAR,N.H.NO-8,

BAPUNAGAR,AHMEDABAD,382350,

GUJARAT,INDIA.

BHAUMIK M PATEL A-6, PARITAPARK SOCIETYPULINPARK


PART-2, OPP. GAUTAM FLATS, NR.
SURDHARA SOCIETY, NARODA,
AHMEDABAD, GUJARAT-382330,INDIA.

ANAND D SHAH 16,DEV SHRUSTI BUNGLOWS PART-


2,MOTERA,SABARMATI,AHMEDABAD-
380005,GUJARAT,INDIA.

2. INVENTOR ( S )

Name Nationality Address

Inventor’s name Indian Permanent Address

DARSHAK B PANCHAL 52,PART- 2,KHODIYARNAGAR,N.H.NO-8,

BAPUNAGAR,AHMEDABAD,382350,

GUJARAT,INDIA.

BHAUMIK M PATEL A-6, PARITAPARK SOCIETYPULINPARK


PART-2, OPP. GAUTAM FLATS, NR.
SURDHARA SOCIETY, NARODA,
AHMEDABAD, GUJARAT-382330,INDIA.

ANAND D SHAH 16,DEV SHRUSTI BUNGLOWS PART -


2,MOTERA,SABARMATI,AHMEDABAD-

8*8*8 3D LED CUBE IELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY &ENGINEERING
P a g e | vii

380005,GUJARAT,INDIA.

3. TITLE OF THE INVENTION : 8x8x8 3D LED CUBE

4. ADDRESS FOR CORRESPONDENCE OF APPLICANT Telephone No. :

DARSHAK B PANCHAL Fax No.

52,PART- 2,KHODIYARNAGAR,N.H.NO-8, Mobile No.9274763883

BAPUNAGAR,AHMEDABAD,382350, E-mail : darshakpanchal.ee23@iite.edu.in

GUJARAT,INDIA.

5. PRIORITY PARTICULARS OF THE APPLICATION (S) FILED IN CONVENTION COUNTRY

Country Application Filing Date Name of the Applicant Title of the Invention
Number :

Not Applicable Not Applicable Not DARSHAK 8x8x8 3D LED CUBE


Applicable BHAUMIK,

ANAND

6. PARTICULARS FOR FILING PATENT COOPERATION TREATY (PCT) NATIONAL PHASE

International application number International filing date as allotted by the receiving office

Not Applicable Not Applicable

7. PARTICULARS FOR FILING DIVISIONAL APPLICATION

Original (first) application number Date of filing of Original (first) application

Not Applicable Not Applicable

8. PARTICULARS FOR FILING PATENT OF ADDITION

Main application / Patent Number Date of filing of main application

Not Applicable Not Applicable

8*8*8 3D LED CUBE IELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY &ENGINEERING
P a g e | viii

9. DECLARATIONS :

(i) Declaration by the Inventor (s)

We, the above named inventor(s) are the true & first inventor(s) for this invention and declare that the
applicant(s) herein is our assignee.

(a) Date

(b) Signature (s)

(c) Name(s) DARSHAK B PANCHAL

(a) Date

(b) Signature (s)

(c) Name(s) BHAUMIK M PATEL

(a) Date

(b) Signature (s)

(c) Name(s) ANAND D SHAH

(ii) Declaration by the applicant (s) in the convention country

I/We, the applicant(s) in the convention countrydeclare that the applicant(s) herein is our assignee

(a) Date

(b) Signature (s) N.A.

(c) Name(s) of the signatory

(a) Date

(b) Signature (s) N.A.

(c) Name(s) of the signatory)

8*8*8 3D LED CUBE IELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY &ENGINEERING
P a g e | ix

(iii) Declaration by the applicant (s):

I/We, the applicant(s) hereby declare(s) that:

o We are in possession of the above – mentioned invention.


o The provisional/complete specification relating to the invention is filed with this application.
o The invention as disclosed in the specification uses the biological material from India and the necessary
permission from the competent authorityshall be submitted by me/us before the grant of patent to me/us.
o There is no lawful ground of objection to the grant of the Patent to me/us.
o I am/We are the assignee or legal representative of true & first inventors.
o The application or each of the applications, particulars of which are given in Para – 5 was first application
in convention country/countries in respect of my/our invention.
o I/We claim the priority from the above mentioned application(s) filed in convention country/countries and
state that no application for protection in respect of the invention had been made in a convention country
before that date by me/us or by any person from which I/We derive the title.
o My/our application in India is based on international application under Patent Cooperation Treaty (PCT)
as mentioned in Para – 6.
o The application is divided out of my/our application particulars of which are given in Para – 7 and pray
that this application may be treated as deemed to have been filed on __ _ __ _ under sec. 16 of the
Act.
o The said invention is an improvement in or modification of the invention particulars of which are given in
Para – 8
10. Following are the attachments with the application:

(a) Complete specification.

(b) Complete specification (in conformation with the international application) / as amended

before the International PreliminaryExamination Authority (IPEA), as applicable (2 copies ).

No. of pages 263 No. of claims 215

(c) Drawings (in conformation with the international application) / as amended before the

International PreliminaryExamination Authority (IPEA), as applicable (2 copies). No. of

sheets 11

(d) Priority documents


(e) Translation of priority document / specification/ International Search Report
(f) Statement and undertaking on Form 3
(g) Power of Authority
(h) Declaration of inventorship on Form 5
(i) Sequence listing in electronic form (floppydisc)
(j) ………………………………
Fee Rs. ………………………in Cash/Cheque/Bank Draft bearing no. ………………..

Date ………. On ..............Bank.

I/We hereby declare that to the best of my/our knowledge, information and belief the fact and matters stated herein are
correct and I/We request that a patent may be granted to me/us for the said invention.

Dated this 6TH day of MAY,2014.

8*8*8 3D LED CUBE IELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY &ENGINEERING
Page|x

Name Signature

DARSHAK B PANCHAL

BHAUMIK M PATEL

ANAND D SHAH

To,

The Controller of Patent

The Patent Office, at Mumbai

8*8*8 3D LED CUBE IELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY &ENGINEERING
P a g e | xi

FORM 2

THE PATENTS ACT, 1970


(39 of 1970)

PROVISIONAL SPECIFICATION
(See section 10 and rule 13)

1. TITLE OF THE INVENTION :

8x8x8 3D LED CUBE

3. PREAMBLE TO THE DESCRITION

PROVISIONAL

The following specification describes invention

4. DESCRIPTION

Description should have following parts:

a. Field of Application

b. Prior Art/Background of the Invention

c. Summary of the Invention

d. Objects of Invention

e. Drawings

f. Description of Invention

g. Examples

h. Claims (Not required for Provisional Application)

8*8*8 3D LED CUBE IELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY &ENGINEERING
P a g e | xii

5. CLAIMS (not applicable for provisional specification. Claims should start with the preamble – “I/We claim” on
separate page)

6. DATE AND SIGNATURE ( to be given on the last page of specification)

7. ABSTRACT OF THE INVENTION : same as report

Note:

*Repeat boxes in case of more than one entry

*To be signed by the applicant(s)or the authorized registered patent agent

*Name of the applicant should be given in full, familyname in the beginning

*Complete address of the applicant should be given stating with postal index no. / code, state and country

*Strike out the column which is/are not applicable

8*8*8 3D LED CUBE IELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY &ENGINEERING
P a g e | xiii

FORM 3

THE PATENT ACT, 1970

( 39 OF 1970 )

&

The Patents Rules, 2003

STATEMENT AND UNDERTAKING UNDER SECTION 8

( See section 8, rule 12 )

We

DARSHAK B PANCHAL INDIAN 52,PART- 2,KHODIYARNAGAR,N.H.NO-8,BAPUNAGAR

AHMEDABAD-382350,GUJARAT,INDIA

BHAUMIK M PATEL INDIAN A-6, PARITAPARK SOCIETYPULINPARK PART -2,

OPP. GAUTAM FLATS, NR. SURDHARA SOCIETY,

NARODA, AHMEDABAD, GUJARAT -382330

ANAND D SHAH INDIAN 16,DEV SHRUSTI BUNGLOWS,PART -2,MOTERA,SABARMATI,

AHMEDABAD-380005,GUJARAT,INDIA

hereby declare that we have not made any application for the same invention outside India.

(i) that /We who have made this application No. 4065/MUM/2014 Dated 6th May,2014 alone, made for the
same/substantiallysame invention, application(s) for patent in the other countries, the particulars of which are given
below :

Name of the Date of Application No. Status of the Date of Date of grant
country Application application publication

India 6/5/2014 8065/MUM/2014 NA NA NA

Not Applicable

(iii) that the rights in the application(s) have been assigned to DARSHAK,BHAUMIK,ANAND and that We undertake
that upto the date of grant of the patent, by the Controller. We would keep him informed in writing the details regarding
corresponding applications for patents filed outside India within three months from the date of filing of such application.

Dated this 6th day of May,2014

8*8*8 3D LED CUBE IELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY &ENGINEERING
P a g e | xiv

For ,

NAME Signature

DARSHAK B PANCHAL

BHAUMIK M PATEL

ANAND D SHAH

To,

The Controller of Patent

The Patent Office, Mumbai

8*8*8 3D LED CUBE IELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY &ENGINEERING
P a g e | xv

ABSTRACT

Our project consists of building a 3 dimensional LED array that will be able to display
various graphics through the concept of persistence of vision. The array will also be
sensitive to motion in three directions, allowing it to focus certain graphics to a targeted
audience through motion detection. There will be several options for display including non-
directional animations and direction focused graphics.

8*8*8 3D LED CUBE IELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY &ENGINEERING
P a g e | xvi

LIST OF TABLES

Table No Table Description Page No

1. Cube size table 17

2. Power requirements for different cube sizes 18

8*8*8 3D LED CUBE IELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY &ENGINEERING
P a g e | xvii

LIST OF FIGURES

Figure No Figure Description Page No

1 3*3*3 LED cube 12


2 8*8*8 LED cube block diagram 15
3 Schematic for 3-to-8 decoder and latches used to control LED 19
4 Latch circuit diagram 21
5 Controller circuit diagram 22
6 Using a piece of wood as a soldering jig for the LED cube 26
7 ATMEGA32 microcontroller pin diagram 29
8 ATMEGA32 microcontroller Physical appearance 30
9 74HC138 3-to-8 line inverting decoder IC 31
10 74HC138 3-to-8 line inverting decoder IC physical appearance 32
11 74HC574 IC Pin diagram 33
12 Program flow chart 35

8*8*8 3D LED CUBE IELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY &ENGINEERING
P a g e | xviii

TABLE OF CONTENTS
Acknowledgement iii
Utilization certificate iv
Feedback certificate v
PDE report of project vi
Abstract xv
List of Tables xvi
List of Figures xvii
Table of Contents xviii

ChapterNo. Description Page No.

1 Project Description 1

1.1 Introduction 1

1.2 Motivation for project 2

1.3 Goals and objectives 3


1.4 Project requirements and specifications4

1.4.1 Physical specifications 5


1.4.2 Environmental specifications 6
1.4.3 Hardware specifications 7
1.4.4 Software specifications 8

2 Literature survey 9

2.1 Research related to project definition 9

2.2 Existing similar projects and products 10

3 Circuit description& working 15

3.1 Block Diagram of 8*8*8 3D LED cube 15

3.2 Working of LED cube 16

3.3 IO port expansion & multiplexing 23

3.4 Power supply consideration 25

3.5 Anatomy of led cube 26

8*8*8 3D LED CUBE IELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY &ENGINEERING
P a g e | xix

Chapter No. Description Page No.

4 Component list & description 28

4.1 Entire component list 28

4.2 ATMEGA32 Microcontroller 29

4.3 74HC138 3-to-8 line inverting decoder IC 31

4.4 74HC574 multiplexer 33

5 Software overview 34

5.1 Introduction 34

5.2 overview of working 35

6 Advantages 36

7 Applications 37

8 Result analysis 38

8.1 Output Display Objectives 38

8.2 Possibilities of future expansion 40

8.3 Lessons to learn 41

8.4 Problems encountered 43

9 Conclusion 44

10 Appendices 46

10.1 Atmega32 microcontroller c program coding 46

10.2 Datasheets of various components and integrated circuits 79

10.3 OAPS report 112

11 References 115

8*8*8 3D LED CUBE IELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY &ENGINEERING
Page|1

1. PROJECT DISCRIPTION

Introduction:

The main goal of this project was to make a LED cube. Another goal was to have fun for the last two semester of
higher education by doing a versatile project. The 8*8*8 3D LED CUBE is an interactive electrical system displayed
as a three dimensional array of light emitting diodes, which features three modes of operation with the overall purpose
to entertain its user with a visually appealing light animation. The fundamental objective of the project is to display a
set of pre-programmed three-dimensional images in rapid succession, as to appear in the form of an animation.

Some of the animations display many elements of nature, such as rain falling down, a snake rattling around, and more
animations. In the rain animation, the light emitting diodes lights up in such a sequence that looks as though raindrops
are falling and disappearing into the floor. The snake animation uses four LEDs that find their way through the cube.
Additionally, the “movable” mode simulates the flow and movement of water. This part is implemented by an
accelerometer that turns LEDs on and off in a water-like fashion as movement is sensed. It represents the fragile
stability of the water by reacting to any movement that a spectator applies to the cube.

Within the boundaries of the two semester period, they were able to design, construct, test, and present the
LED Cube. Throughout all phases of the process, the group obtained a great deal of experience pertaining to
custom integrated circuit design, embedded programming and working with complex electrical gadgets and
components. In the journey, we used many resources, such as previous class knowledge, experience from
acquaintances and professors, as well as obtained much specialized knowledge that can be only acquired by
doing a long project of such magnitude from start to finish.

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
Page|2

Motivation for Project:

The LED cube seemed a little too simplistic at first glance, so we thought of different ways of make this
project more interesting. This would make it an interesting centre piece display at parties as the cube reacts
to the sound of music. Another reason for selecting this project was that it would be programming intensive.
This would allow for equal distribution of work since the group consists of three project making group
members. Ultimately this seems like a reasonable, flexible, inexpensive and fun project to take on as we
spend our final semesters in undergraduate study.

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
Page|3

Goals and Objectives:

The ultimate goal was to create an interactive 8*8*8 3d led cube, encased in a clear acrylic glass container
that would allow anyone to pick it up and rotate it around. An extremely difficult part of this project will be
in regards to the programming of the microcontroller. The programming language used will probably be C
due to familiarity. Another important feature would be to have an input method for uploading animations.

This was achieved by dividing the project into sub-goals. The first was to perform extensive research on the
subject matter. This included researching past projects and tutorials, as well as researching possible
components. Following the research, a prototype of a 4x4x4 3d led cube was constructed to test components
and learn how to implement the ICs. The goal here was to obtain an understanding as to how the entire
process works.

This also provided a platform to achieve the next set of goals. The following objective is to gain complete
understanding of the entire circuit functioning. We can use the 4*4*4 3d led cube to test these devices
individually before application to the 8*8*8 3d led cube cube. Once that was accomplished, construction of
the final prototype commenced. After completion of the led cube, it was tested to make sure it met all the
requirements set at the beginning of our class.

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
Page|4

Project Requirements and Specifications:

There are five major components in the system. The first being the LED cube which displays the output of
the computed input from the sensing devices. The LEDs light up based on the calculated input data from the
microcontroller program. The computations and processes are dealt with in the second major component
being the embedded electronics, which includes the microcontroller, IC units and auxiliary equipment.

In the next four subsections we will be discussing the main specifications for the LED cube project.

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
Page|5

Physical Specifications:

The following specifications explain the physical dimensions the cube adheres to for this project:

 The LED resolution will be 8x8x8 = 512 no. of led.

 Blue light emitting diodes will be used.

 Total mass should be approximately 10 lbs. or less.

 The size will be approximately one cubic foot.

 Electronics will be housed underneath the LED cube structure.

 Casing will be made from transparent acrylic/Plexiglas.

 FRC cable connection should be accessible from the outside.

 Three position switch accessible to the user.

 PCB encasing should be made out of a light weight material.

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
Page|6

Environmental Specifications:

The following specifications explain the environmental guidelines the cube adheres to for this project:

 System should work in standard dry indoor environments.

 Should withstand vibrations caused by sound waves at high volumes.

 Function in possible humid/moist outside environments.

 Withstand temperatures between 50˚ F – 100˚ F.

 Be able to sense acceleration.

 Be able to sense sound.

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
Page|7

Hardware Specifications:

The following specifications explain the hardware requirements the cube adheres to for this project:

 Components must run off of 5V DC.

 Have an on/off switch.

 Bright LEDs.

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
Page|8

Software Specifications:

The following specifications explain the software requirements the cube adheres to for this project:

 Program should not be more than the available memory on the microcontroller.

 Source code will be written in C programming language.

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
Page|9

2. LITERATURE SURVEY

Research Related to Project Definition:

It’s difficult to come across new ideas in today’s day and age, as they say “there is nothing new under the
sun”. For example the LED cube has been repeatedly done with many different tutorials found online. In
order to impress, the cubes are made larger and more colourful using more and more complex algorithms.
Few people have gone up and beyond in attempting to do more with the LED cube than just make it a visual
spectacle. There was a group that implemented an accelerometer and a different group that used a VU meter.
What was accomplished is the combination of both projects into a super ultra-mega LED cube.

This section discusses the mentioned projects’, along with some others that have contributed to our design.
The idea is by learning from past attempts and failures the team is able to facilitate the creation of an original
LED cube with multiple functions, something that has yet to be done that has not been posted online already.

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 10

Existing Similar Projects and Products:

1) University of Portland Senior Design Project:

This group applied an accelerometer to the traditional LED cube idea. In turn this has inspired us to make it
a feature in our LED project. They used the free scale MMA7341L MEMS (micro-electro- mechanical
systems) triple-axis accelerometer, which can register 3g to 11g of acceleration. Their main objective was to
use it to light up the LEDs in a pattern that would mimic liquid in a cubical container. As the user would
move the cube around, the LEDs would react to motion based on the input from the accelerometer.

The brain house of their cube which happens to be the same everywhere else on the internet was the Arduino
Duemilanove Microcontroller development board. We plan to use a different microcontroller discussed later
in this document. But it has provided some insight into qualities we looked in to for selecting the
microcontroller. For example, the accelerometer produces output in analog which poses a problem for our
digital circuit system.

An analog to digital converter will be necessary. The VU meter will probably also produce an analog output,
so having an analog input on selected board will greatly facilitate the process, and reduce the number of
components required. Also if other analog based devices are implemented, the conversion capabilities and
pin count will be on hand. Another aspect of interest of the board is memory size.

Much will be needed to house code that will allow multiple modes for the cube to be in. The animations
code file will be the largest in size and require much memory. Being able to switch modes based on the
input signals on one pin on the board controlled by a switch is a great idea. By directing the voltage to three
different pins, three different modes can be created.

Another fascinating aspect of their project was the minimal number of parts used, compared to other home
brew projects. The cube project in general involves much multiplexing and decoding. The bigger the cube,
the more flip- flops and latches one needs. Further investigation revealed that the group had custom
integrated circuit (ICs) chips produced by the MOSIS foundry.

One type of MOSIS chip was the iterator which was used to iterate through the LED cube columns. The
other being much more complicated acted as the sequential access memory and was called the SAM

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 11

MOSIS. The design consisted of 1500 gates. This seems like a rather costly route to take for our team. This
group on the other had had special funding therefore could afford to build custom chips.

The containment unit for their project inspired us to create a similar model. This team used the Arduino
development board as mentioned before. This required the cube to have multiple connections at one time.
The Multifunctional Hexahedron will have a reduced number of external connections, ideally one just for
power. This project is one of the better ones found online but the use of LED drivers may have been a better
option, which is what we considered. This served as a great jumping off point and we hope our project is an
improvement to this project.

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 12

2) 3x3x3 Pocket LED Cube:

This particular LED Cube is the foundation for our LED Cube. We will be using this simple 3x3x3 pocket
LED cube in order to better comprehend the workings of an LED Cube and how we can incorporate our own
design as well as features. The pocket LED cube was built using ladyada’s MiniPOV Version 3 kit, which
includes 8 red LEDs, a pre-programmed microcontroller, a serial port connector and an AA battery case.
The MiniPOV3 kit is originally meant to be a straight line of LEDS which can be programmed to follow any
particular pattern the team uses. The team at Makezine, however, modified the layout of the LED’s to match
that of a cube.

The begin by soldering the LED’s all together using a block of wood with the layout of the 9 LED’s in each
level. They drill the 9 holes and place the LEDs inside them upside down so that they can arrange the
cathode and anode legs to the desired layout. They commence the soldering of the legs until they have one
solid layer of LED’s.

They repeat the above steps three times until they have three layers of 9 LED’s. From here they solder all of
the layers together to have the finished LED cube, depicted in Figure 3.3 below.

Figure 1. 3x3x3 LED cube

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 13

Since the project requirements do not allow the usage of prebuilt kits, the kits included in this particular
LED cube will not be used. Parts from this LED cube as well as parts from another LED cube project will be
used to develop the first prototype of this project. The second 3x3x3 cube project that will be used as a
guideline for our prototype does not use a prebuilt kit. It uses a low number of components and hooks up
directly to an Arduino or in the case of this prototype, an MSP430 microcontroller. The list of parts required
for this particular 3x3x3 LED cube is:

 1 Perforated Board

 3 NPN Transistors (2N2222, 2N3904, BC547, etc.)

 12 Resistors (~220 ohms and ~10k ohms)

 13 Headers (male or female)

 27 LEDs

 Wire

Similar to the pocket LED cube, this LED cube uses the wood block jig in order to solder the three layers of
9 LEDs. Each set of nine LEDs will share a common connection amongst their cathodes (negative leads).
Each of the nine LEDs on a level is connected to the corresponding LED on the other two levels through
their anodes (positive leads). After the layers have been soldered, the three layers are soldered together.
From here, the cube is placed on the perforated board with the appropriate spacing. Three stripped wires are
connected to one leg of each of the centre LEDs of each layer.

This will be done through a current limiting resistor. Each of the three layers will be connected to ground
through an NPN transistor when activated through the Arduino. The trick to this particular circuit is that
only one layer will be allowed to be lit at a time. Therefore, the layers have to be lit up fast enough that it
will appear to the human eye as if all three levels are lit at the same time. The actual circuit layout as well as
the software for our 3x3x3 LED cube will be explained later.

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 14

3) 3D RGB LED Cube (VU Meter):

During research, many volume unit meter projects using LED’s were encountered. One of the designs was
done as a homebrew assignment and presented on craigandheather.net. The design is a four by four
preassembly RGB LED cube. Also, it was very specific about parts used and provided a complete schematic
for the final circuit. It uses a condenser microphone and a LM324 op amp for the input. Then, the input is
broken down into seven different frequencies. This part is done by a MSEGQ7, a seven band graphic
equalizer that provides frequency band as output. The microprocessor used was an ARDUINO Uno with an
ATmega328 chip.

No special reason was given for the use of the ARDUINO, it just happens to be available at the moment. For
the output, the design uses two TLC5940 LED drivers that provide 16 channels and 12 bit grayscale PWM
control. Since the LED drivers are more expensive than the demultiplexer, the author uses a 74LS138
decoder/demultiplexer to reduce the amount of part need. Finally, eight TIP126 driver PNP transistors are
connecting to the demultiplexer output and to the LED cube. The circuit is fed by a 5 VDC, 3 Ampere wall
wart power supply.

What makes this design special is the use of a seven band digital controlled graphic equalizer which used a
digital output to eliminate the necessity of an analog to digital converter. The total cost of the project is not
discussed in the page, but many of the parts were used because they were available from previous projects.
Also, the author used a pre-built LED cube with PCBs to eliminate the wire and have better visual
appearance. If the group decides to use this option in our final design, it will increase the final price. but this
would allow the LED cube to have a stronger structure which will increase the performance of the
accelerometer.

The weakness of the design is seen in the way how LED’s reacted to sound. The author did not use the
ARDUINO library to help out with the software code and the demonstration turned out to appear like a
random flashes of LEDs, without any pattern. Also, RGB LEDs are not used in full, in this project regular
LEDs should work perfectly fine. The design can be greatly improved upon by changing the programming
of the microprocessor. In comparison with our project, we have the technical background and human power
to implement a better program.

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 15

3. CIRCUIT DESCRIPTION & WORKING

Block Diagram of 8*8*8 3D LED cube:

Figure 2. Block diagram

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 16

Working of LED cube:

In order to be acquainted with the inner workings of an LED cube, one must first understand the anatomy of such
a device. A light emitting diode cube, as suggested by the instructables.com website, can be thought of as a
device mainly composed of columns and layers. The positive cathode legs of every LED are soldered together
forming a layer, and this is done for every layer.

In the same manner, each of the anode legs in one column are soldered together. This setup allows for an
efficient control of the lighting of LEDs. Each of the 25 columns is connected to the controller individually, and
also each of the 5 layers has a connection to the controller board.

The author of this project makes use of the transistors in the circuit to control the flow of current to one particular
layer to produce the 3D image, the transistor from the current layer must be turned off, the image for the next
layer must be changed, and finally the transistor for the next layer must be turned on.

This cube is composed of 125 LEDs. Having a dedicated port to control each LED would mean needing a
microcontroller with 125 I/O ports, as well as having 125 wires running through the cube. This would be very
impractical and would diminish the visual value of the finished product. The way that the author addressed this
issue is by taking advantage of a concept known as Persistence of Vision (POV). Persistence of Vision is the
phenomenon of the human eye by which an afterimage is thought to persist by a fraction of a second on the
retina.

This means that if this concept was to be applied to the project, then if an LED is flashed really fast, the light will
stay on the user’s retina for a small amount of time after the LED turns off. By extension, if each layer of the
cube is flashed individually one after the other really fast, it will create the illusion of a 3D image.

This will allow the setup to only be composed of 30 IO ports (25 for the anodes and 5 for each layer) to control
the cube, therefore solving the issue of having too many ports/wires for the LED cube, and making it more
visually appealing.

As far as driving the LED cube, two sets of IO ports are going to be needed. The author discusses that one set
will be used to source the anode columns, while the other to sink all the cathode layers. Following is a table
provided by the site, table 3.1 in which the amount of anodes and cathodes relative to the cube size is shown in the
table :

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 17

Table 1.Cube size table

As seen from the previous table, the number of IO ports will increase exponentially depending on what the
size of the LED array will be. This is an important point to take in consideration, and greatly influenced our
decision on working with an 5x5x5 cube. For a bigger cube array, the number of components would have
increased drastically, and therefore would have required a much greater investment in both time and money.
Furthermore, as our group has decided to increase the scope of our project features by adding an
accelerometer to display water effects when tilting the cube, a bigger cube would have not allowed for the
desired manoeuvrability and handling to properly demonstrate this effect.

Another important factor that the author suggests to take in consideration is the amount of current that will
be flowing through each individual LED, as well as the other components of the circuit. If the scope of the
project was to build a smaller cube (a 3x3x3 or 4x4x4 cube, for instance), this would not pose much of an
issue, as each cathode layer could be connected directly to a microcontroller IO pin.

However, since the scope of the project is a bigger, 5x5x5 cube, the current going through each IO pin will
be too high, and there would be a risk of damaging any component.

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 18

To get around this issue, the author is helpful enough to provide a table overviewing the power requirements
for a LED layer of many different sizes. In particular, we are able to observe that for cube of size 5, a current
draw of 250 mA will be required. Following is the table with power requirements:

Table 2. Power Requirements for different cube sizes

It is important to note that the above table, Table 3.2, shows the current draw with all the LEDs turned on in
a particular cube.

Naturally, the next component to take in consideration is what type of microcontroller is to be used in the
project. As stated before, it is not feasible to acquire a microcontroller that has at least 125 IO pins in order
to control each LED individually. The way that the author approaches this issue is by using multiplexing to
control the entire cube. The multiplexer that was used for this project was an 8-bit latch (74HC587), which
will effectively multiplex 11 IO lines into the required 25 output lines for each column. This integrated
circuit could be a potential candidate for the group’s approach, because we are dealing with same size cubes.

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 19

Following is a schematic depicting the arrangement of the latches in conjunction with a 74HC138 decoder:

Figure 3. Schematic for 3-to-8 decoder and latches used to control LEDs

In the previous figure, the anatomy of the circuit is laid out. The outputs of the 3-to-8 decoder connect to the
clock of each latch. Each latch will serve as a kind of simple memory for the cube, holding 8 bits of

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 20

information which are to be represented on the output pins. Also, the inputs for all of the latches are
connected together using a bus. This way, the author utilizes the set- up in order to present an animation in
the following set of steps:

1) Data is loaded onto the input lines.

2) Latch is set to high, loading data to output lines.

3) Latch is set to low.

4) Load next state of the cube.

5) Repeat until complete.

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 21

The latch diagram is as per following.

Figure 4. Latch circuit diagram

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 22

The controller circuit diagram is as per following.

Figure 5. Controller circuit diagram

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 23

IO port expansion & multiplexing:

To get the required 64 output lines needed for the LED anodes, we will create a simple multiplexer circuit.
This circuit will multiplex 11 IO lines into 64 output lines. The multiplexer is built by using a component
called a latch or a flip-flop.

This multiplexer uses an 8 bit latch IC called 74HC574. This chip has the following pins:

 8 inputs (D0-7)

 1 "latch" pin (CP)

 1 output enable pin (OE)

 8 outputs (Q0-7)

The job of the latch is to serve as a kind of simple memory. The latch can hold 8 bits of information, and
these 8 bits are represented on the output pins. Consider a latch with an LED connected to output Q0. To turn
this LED on, apply V+ (1) to input D0, then pull the CP pin low (GND), then high (V+).

When the CP pin changes from low to high, the state of the input D0 is "latched" onto the output Q0, and this
output stays in that state regardless of future changes in the status of input D0, until new data is loaded by
pulling the CP pin low and high again. To make a latch array that can remember the on/off state of 64 LEDs
we need 8 of these latches. The inputs D0-7 of all the latches are connected together in an 8 bit bus.

To load the on/off states of all the 64 LEDs we simply do this: Load the data of the first latch onto the bus.
Pull the CP pin of the first latch low then high. Load the data of the second latch onto the bus. Pull the CP pin
of the second latch low then high. Load the data of the third latch onto the bus. Pull the CP pin of the third
latch low then high, and then repeat.

The only problem with this setup is that we need 8 IO lines to control the CP line for each latch. The solution
is to use a 74HC138. This IC has 3 input lines and 8 outputs. The input lines are used to control which of the
8 output lines that will be pulled low at any time.

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 24

The rest will be high. Each out the outputs on the 74HC138 is connected to the CP pin on one of the latches.

The following pseudo-code will load the contents of a buffer array onto the latch array:

// PORT A = data bus

// PORT B = address bus (74HC138)

// char buffer [5] holds 25 bits of data for the latch array

PORTB = 0x00; // this pulls CP on latch 1 low

for (i=0; i < 5; i++)

PORTA = buffer[i];

PORTB = i+1;

The outputs of the 74HC138 are active LOW. That means that the output that is active is pulled LOW. The
latch pin (CP) on the latch is a rising edge trigger, meaning. That the data is latched when it changes from
LOW to HIGH.

To trigger the right latch, the 74HC138 needs to stay one step ahead of the counter i. If it had been an active
HIGH chip, we could write PORTB = i;.

Only the first 8 bits of PORT B are connected to the 74HC138. So when port B outputs 8 or 1000 in binary,
reads 000 in binary, thus completing its cycle. (it started at 0). The 74HC138 now outputs the following
sequence: 1 2 3 4 5 6 7 0, thus giving a change from LOW to HIGH for the current latch according to counter.

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 25

Power supply consideration:

This circuit will draw 64 times the mA of your LEDs if they are all on. In addition to that, the AVR and the
latch ICs also draw current.

To calculate the current draw of your LEDs, connect a led to a 5V power supply with the resistor you intend
to use, and measure the current in mA. Multiply this number by 64, and you have the power requirements for
the cube itself. Add tothat, 15-20 mA for the AVR and a couple of mA for each latch IC.

We later removed this chip, and soldered a wire from the input to the output pin where the chip used to be.
We use a regulated computer power supply to get a stable high current 5V supply.

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 26

Anatomy of led cube:

Making the right choice for each component is very important if one was to end up with a visually-pleasing,
and most importantly, a working LED cube. More information of component research and decision is found
within the Component Research section of this document.

In essence, the construction of the actual cube really comes down to a lot of patience, and a steady hand. In
order to make an aesthetically-pleasing LED cube, the author suggests that it is of utmost importance for it
to be perfectly symmetrical; that is, each light emitting diode will have to be facing the same way, and both
the cathode and anode legs of each led have to be roughly the same length so that the final product comes
out as an almost-symmetric cube. This can be achieved by making use of a temporary soldering rig.

Figure 6. Using a piece of wood as a soldering jig for the LED cube

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 27

As seen in the previous figure a piece of wood is a perfect candidate for a soldering rig. Holes can be drilled
with ease, making sure that each hole is spaced according to the length of the anode leg. This simplifies the
soldering job by a substantial amount, allowing the LEDs to be kept in place while everything is put
together. Once all the soldering is complete, if the holes are drilled all the way through, the same wooden jig
may be used as a stand for the final project.

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 28

4. COMPONENT LIST& DESCRIPTION

Entire component list:

1. 512 3 mm LEDs.

2. 64 resistors.

3. 1x or 2x large prototype PCBs.

4. 1x ATmega32 microcontroller.

5. 3x status LEDs.

6. 3x resistors for the status LEDs.

7. 8x 74HC547 ICs.

8. 1x 74HC138 IC.

9. 1x Maxim MAX232 IC.

10. 1x 14.7456 MHz crystal.

11. 2x 22pF ceramic capacitors.

12. 16x 0.1uF ceramic capacitors.

13. 1x 1000uF ceramic capacitor.

14. 8x 20 pin IC sockets.

15. 1x 40 pin IC socket.

16. 2x 16 pin IC socket.

17. 1x 2-pin screw terminal.

18. 9x 8-pin terminal pins.

19. 1x 4-pin terminal pin.

20. 5v power supply.

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 29

ATMEGA32 Microcontroller:

Figure 7. ATMEGA32 microcontroller pin diagram

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 30

 This is an 8 bit microcontroller with 32 KB of program memory and 2 KB RAM.

 The ATmega32 has 32 GPIO (General Purpose IO) pins.

 Two of these will be used for serial communication (TX+RX). Three IO pins are used for ISP (In-circuit
Serial Programming).

 This leaves us with 27 GPIO to drive the LED cube, buttons and status LEDs.

Figure 8. ATMEGA32 microcontroller physical appearance

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 31

74HC138 3-to-8 line inverting decoder IC:

Figure 9. 74HC138 3-to-8 line inverting decoder IC

 The M74HC138 is a high speed CMOS 3 to 8 line decoder.

 There are three binary select inputs (A, B, and C) which determine which one of the eight outputs (Y0 -
Y7) will go high.

 This chip has three enable inputs (G1, ~G2A, and ~G2B); when any enable pins are brought low (or high in
G1's case), all output pins are pulled low.

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 32

Figure 10. 74HC138 3-to-8 line inverting decoder IC physical appearance

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 33

4.474HC574 multiplexer:

Figure 11. 74HC574 Pin diagram

 8 inputs (D0-7)

 8 outputs (Q0-7)

 1 "latch" pin (CP)

 1 output enable pin (OE)

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 34

5. SOFTWARE OVERVIEW

Introduction:

The software is written in C and compiled with the open source compiler avr-gcc. This is the main reason we use
Atmel AVR micro controllers.

The software on the AVR consists of two main components, the cube interrupt routine and effect code for
making fancy animations.

When we finally finished soldering, we thought this would be the easy part. But it turns out that making
animations in monochrome at low resolutions is harder than it sounds.

If the display had a higher resolution and more colors, we could have used sin() and cos() functions and all that to
make fancy eye candy. With two colors (on and off) andlow resolution, we have to use a lot of if() and for() to
make anything meaningful.

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 35

Overview of working:

Figure 12. Program flowchart

Communication between these two happens via a voxel array. This array has a bit for every LED in the LED
cube. We will refer to this as the cube array from now on.The cube array is made of 8x8 bytes. Since each byte is
8 bits, this gives us a buffer that is 8 voxels wide, 8 voxels high and 8 voxels deep (1 byte deep) volatile unsigned
char cube[8][8].The interrupt routine reads from the cube array at given intervals and displays the information on
the LED cube. The effect functions write the desired LED statuses to this array. We did not use any
synchronization or double buffering, since there is only one producer (either the effects currently running, or
input from RS232) and one consumer(the interrupt-code that updates the cube). This means that some voxels
could be from the next or previous "frame", but this is not a problem, since the frame rate is so high.

When working with micro controllers, code size is critical. To save code size and programming work, and to
make the code easier to read, we have tried to write re-usable code as often as possible. The LED cube code has a
base of low level drawing functions that are used by the higher level effect functions. The draw functions can be
found. Draw functions include everything from setting or clearing a single voxel to drawing lines and wireframe
boxes.

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 36

6. ADVANTAGES

 Shorter turning-on and start-up sequence compared to conventional lamp systems.

 Real flicker-free representation without rainbow effects and therefore a more ergonomic and fatigue- free
observation.

 Higher lifetime with low tear and wear effects, no common wear parts like lamps and color wheels as with
traditional systems.

 Much lower color and brightness drifts over the life-time of the system, compared with traditional lamp
systems.

 High light output and higher lifetime through special colour-interleave method.

 Improved representation of moving images higher attention to detail, through a better color gamut and
color space depth.

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 37

7. APPLICATIONS

 The LED CUBE can be used as a display device which can be the most superlative use of POV
(Persistence of Vision).

 The use of additional decorative colourful LED’s and user defined accessory leads to eminent novelty
application.

 Advertising can also be done with giant LED cube which can successfully represent 3D graphics of 2D
data.

 Small games can also be played by respective programming like SNAKE CATCH.

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 38

8. RESULT ANALYSIS

Output Display Objectives:

 LED CUBE will display following effects.

 Rain :

This effect adds raindrops to the top layer of the cube, and then let them fall down to the bottom layer.

 Plane Boeing :

This effect draws a plane along the specified axis then moves it from position 0 to 7 on the axis and back
again. This is very simple, but it really brings out the depth of the 3d LED cube.
This function doesn't have an iteration loop. Instead it is called twice for each axis in launch effect.

 Send voxels ransoms :

Iterations is the number of times a voxel is sent up or down. Delay is the speed of the movement.

 Box shrink grow and woopwoop :

Effect draws a wireframe box filling the entire cube, and then shrinks it down to one voxel in one of 8
corners. We call this function one time for each of the 8 corners to create a nice effect. Effect draws a box
that starts as a 8x8x8 wireframe box filling the entire cube. It then shrinks down to a 2x2x2 box at the
centre of the cube.

 Axis updown randsuspend :

This is one of our favourite effects. The voxels randomly suspended in the cube gives a nice 3d depth,
especially if you move your head while viewing the effect.

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 39

The function then loops 8 times moving each voxel closer to its midway destination. After 8 iterations, the
voxels are suspended at different distances from where they started. The function then pauses for a while,
thus the name axis updown_andsuspend . It then loops 8 times again moving the voxels one step closer to
their final destination on the opposite wall each time.

The actual voxel drawing is done in a separate function, draw position axis so it can be used in different
effects. For example, the voxels could be suspended midway in a non-random pattern.

 String Fly:

The function stringfly2 takes any ASCII string and displays it as characters flying through the cube.

It starts by placing the character at the back of the cube, and then uses the shift function to shift the cube
contents towards you, making the text fly.

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 40

Possibilities for future expansion:

 Low- level pulse width modulation brightness control of the LEDs, with corresponding intensity
variations on the SVGA output.

 Display of 3DdatastoredonaCompactFlashcard- may be used as initial conditions for cellular automata.

 Modification of the cube to increase resolution uses larger lattice spacing.

 AURDINO card can be implemented for USB port input access applications.

 Efforts to make the system familiar with WIFI connectivity.

 A software application can be developed for remote accessing of cube by user.

 Modification of the cube to increase resolution/enhance visibility – use larger lattice spacing or smaller
LEDs.

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 41

Lessons to Learn:

During the construction and testing of the three by three prototype constructed during the two semester
terms, some lessons were definitely learned, and they were of great help when starting with the construction
of the latter prototypes. For better understanding, the selection of the parts was discussed first. In
Ahemdabad, there is a lack of a full size specialized electronic store.

Therefore, we learn that all the electronic parts, no matter what simple is, will have to be order online. The
first step into construction was to do holes in a two by four piece of wood to form and hold the square shape
of the cube for later place the LED inside the hole and solder together forming the layers. To do the hole we
use a small four volt, quarter inches screwdriver. We start at the centre mark and every time the drill vibrate
making the hole in different position and some of the holes were bigger than the LED due to the imprecision
of the drill.

The lesson learn in this part is to use a more powerful drill, or even better a press drill, with a new drill bit
that will not misplace holes. The second step into the construction was to put the LED’s together. The
soldering of the LED have to be by two people, one person to solder and another person to hold the LED’s
on places until cool down and form a strong connection.

Soldering the different layer was not as easy as show in the instructional video because is hard to keep the
different layer at the same high. We have to find a better way to have the same high throughout the final
eight by eight by eight projects.

There were too many wires and we had to double check for loose connections. For the final design, cables
were used to connect between the LED’s and the LED’s drivers. The prototype helped us to understand in
full all the functions of the electronics and the codes provided in the in the instruct ion video. After the
construction, the prototype was left in the locker and the next week we tried to do more testing but the upper
layer did not work.

After close examination, we discover some cathode was loose and one anode for another layer was loose too.
With that fail we learned the importance of having very strong soldering and also to add more wire, that way
the cathode will have a ring type path.

With that type of connection, if a fail occurs, the current will have another path to go and the final circuit
will not be compromised. Also, we saw the necessity of having better support for all the layers.

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 42

 Aim low so that you can hit your mark.

 Document preparation task.

 Plan regularly.

 Don’t try to juggle a full time co-op with senior design.

 Seemingly simple things can make for complex problems.

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 43

Problems encountered:

1. We found our shift registers would store values from previous lyran code which caused glitches and
errors in our mode switching.

2. Out of scope errors.

3. Debugging with optimizations on can make variables appear out of scope.

4. Volatile does not necessarily fix the out of scope problem, at least for the attempted local variables.

5. How to clock a shift register.

6. Bad chips.

7. Incorrectly reading datasheets.

8. Dangerous equipment.

9. Is it getting power?

10. Rods/Structure.

11. Backing up code.

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 44

9. CONCLUSION

We have successfully completed the research, design, testing, and prototype of the (eight by eight by eight)
single-color LED Cube project as well as the final project. The majority of the teams’ time was spent on
performing extensive research and becoming knowledgeable of some unfamiliar topics regarding our
project. Through this extensive research, the team was able to produce a system design and properly select
hardware and software that were appropriate based on the teams technical, financial, and educational
constraints.

Though there were initial significant difficulties with a particular team member’s lack of communication
and effort, the team was eventually successful in developing a system design as well as a proper prototype
for the proposed LED cube project. Through these difficulties, the team members have learned to manage
time properly as well as prioritize the combination of work, school, and family. In the long run, the team
members showed the skills necessary to complete the design of an LED cube, the professionalism in
properly preparing their assigned sections, and their team unity by completing a cohesive final design
document.

In choosing to develop a potential commercial product and applying the team’s engineering and technical
problem solving skills in order to acquire a solution, the team feels that its formal education in the field of
Electrical and Computer Engineering was challenged to the maximum of its ability to apply the concepts
and methods learned to solve a real life scenario in physical reality.

Designing the three different LED cube systems made the team more knowledgeable over certain topics that
went beyond the scope covered by formal education. This forced the team to use outside resources and
become well versed in methods of researching components, design and implementation for projects at a
professional level. Through the process of the design phase of this project, the team became knowledgeable
in specific areas pertaining to light emitting diodes, integrated circuitry (LED drivers), and software
animation using LEDs, integration of microcontrollers as well as physical construction of electrical devices.

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 45

Overall, this project really helped the team members gain hands-on skills and experience necessary to go out
and design, implement and build engineering projects in the workforce. In addition, these skills as well as
the project can be annexed to our resumes, aiding us in having an advantage over other entry level engineers
searching for a profession.

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 46

10. APPENDICES

ATMEGA32 microcontroller C program coding:

#include <avr/interrupt.h>
#include <string.h>
#define AXIS_X 1
#define AXIS_Y 2
#define AXIS_Z 3

volatile unsigned char cube[5][5];


volatile int current_layer = 0;

void setup()
{
int i;

for(i=0; i<14; i++)


pinMode(i, OUTPUT);

// pinMode(A0, OUTPUT) as specified in the arduino reference didn't work. So I accessed the registers
directly.
DDRC = 0xff;
PORTC = 0x00;

// Reset any PWM configuration that the arduino may have set up automagically!
TCCR2A = 0x00;
TCCR2B = 0x00;

TCCR2A |= (0x01 << WGM21); // CTC mode. clear counter on TCNT2 == OCR2A
OCR2A = 10; // Interrupt every 25600th cpu cycle (256*100)
TCNT2 = 0x00; // start counting at 0
TCCR2B |= (0x01 << CS22) | (0x01 << CS21); // Start the clock with a 256 prescaler

TIMSK2 |= (0x01 << OCIE2A);


}

ISR (TIMER2_COMPA_vect)
{
int i;

// all layer selects off


PORTC = 0x00;
PORTB &= 0x0f;

PORTB |= 0x08; // output enable off.

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 47

for (i=0; i<5; i++)


{
PORTD = cube[current_layer][i];
PORTB = (PORTB & 0xF8) | (0x07 & (i+1));
}

PORTB &= 0b00110111; // Output enable on.

if (current_layer < 6)
{
PORTC = (0x01 << current_layer);
} else if (current_layer == 6)
{
digitalWrite(12, HIGH);
} else
{
digitalWrite(13, HIGH);
}

current_layer++;

if (current_layer == 8)
current_layer = 0;
}

void loop()
{
int cnt;
while (true)
{

effect_intro();

zoom_pyramid();
zoom_pyramid_clear();
zoom_pyramid();
zoom_pyramid_clear();

firework(0,0,0);
firework(-2,-2,50);
firework(1,1,-250);
firework(0,1,200);
firework(1,-3,400);
firework(2,-3,600);
firework(2,1,500);
firework(2,-2,200);
firework(2,1,0);
firework(0,0,0);

pyro();
pyro();

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 48

firework(2,-2,500);

space(100);
space(100);

firework(-2,1,600);

for(cnt=0;cnt<501;cnt+=100)
turning_cross_animation(cnt);
for(cnt=500;cnt>=0;cnt-=100)
turning_cross_animation(cnt);

turning_cross(300);

syd_rox();
syd_rox();

}
}

//
=============================================================================
=============
// Effect functions
//
=============================================================================
=============
void turning_cross_animation(int time){
int i,j,k;

fill(0x00);

//Cross

//1
for(i=0;i<5;i++){
setvoxel(7,3,i);
setvoxel(7,4,i);
setvoxel(7,i,3);
setvoxel(7,i,4);
}

shift(AXIS_X,-1);
delay_ms(1000-time);

//2
setvoxel(6,7,5);
setvoxel(6,6,5);
clrvoxel(6,7,3);
clrvoxel(6,6,3);

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 49

setvoxel(6,2,7);
setvoxel(6,2,6);
clrvoxel(6,4,7);
clrvoxel(6,4,6);

setvoxel(6,0,2);
setvoxel(6,1,2);
clrvoxel(6,0,4);
clrvoxel(6,1,4);

setvoxel(6,5,0);
setvoxel(6,5,1);
clrvoxel(6,3,0);
clrvoxel(6,3,1);

shift(AXIS_X,-1);
delay_ms(1000-time);

//3
setvoxel(5,6,6);
setvoxel(5,5,5);
clrvoxel(5,7,4);
clrvoxel(5,6,4);

setvoxel(5,1,6);
setvoxel(5,2,5);
clrvoxel(5,3,7);
clrvoxel(5,3,6);

setvoxel(5,2,2);
setvoxel(5,1,1);
clrvoxel(5,0,3);
clrvoxel(5,1,3);

setvoxel(5,6,1);
setvoxel(5,5,2);
clrvoxel(5,4,0);
clrvoxel(5,4,1);

shift(AXIS_X,-1);
delay_ms(1000-time);

//4
//Corners
setvoxel(4,7,7);
setvoxel(4,7,0);
setvoxel(4,0,7);
setvoxel(4,0,0);

setvoxel(4,6,7);
setvoxel(4,5,6);
clrvoxel(4,7,5);

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 50

clrvoxel(4,6,5);

setvoxel(4,0,6);
setvoxel(4,1,5);
clrvoxel(4,2,7);
clrvoxel(4,2,6);

setvoxel(4,1,0);
setvoxel(4,2,1);
clrvoxel(4,0,2);
clrvoxel(4,1,2);

setvoxel(4,7,1);
setvoxel(4,6,2);
clrvoxel(4,5,0);
clrvoxel(4,5,1);

shift(AXIS_X,-1);
delay_ms(1000-time);

//5
//Corners
clrvoxel(3,7,7);
clrvoxel(3,7,0);
clrvoxel(3,0,7);
clrvoxel(3,0,0);

setvoxel(3,7,2);
setvoxel(3,6,3);
clrvoxel(3,6,1);
clrvoxel(3,5,2);

setvoxel(3,0,5);
setvoxel(3,1,4);
setvoxel(3,4,5);
clrvoxel(3,1,6);
clrvoxel(3,2,5);

setvoxel(3,3,1);
setvoxel(3,2,0);
clrvoxel(3,1,1);
clrvoxel(3,2,2);

setvoxel(3,4,6);
setvoxel(3,5,7);
clrvoxel(3,6,6);
clrvoxel(3,5,5);

shift(AXIS_X,-1);
delay_ms(1000-time);

//6

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 51

setvoxel(2,7,3);
setvoxel(2,6,4);
clrvoxel(2,7,1);
clrvoxel(2,6,2);

setvoxel(2,0,5);
setvoxel(2,1,4);
clrvoxel(2,0,6);
clrvoxel(2,1,5);

setvoxel(2,0,4);
setvoxel(2,1,3);
clrvoxel(2,1,6);
clrvoxel(2,2,5);

setvoxel(2,3,6);
setvoxel(2,4,7);
clrvoxel(2,5,6);
clrvoxel(2,6,7);

setvoxel(2,4,1);
setvoxel(2,3,0);
clrvoxel(2,1,0);
clrvoxel(2,2,1);

shift(AXIS_X,-1);
delay_ms(1000-time);

//7

setvoxel(1,7,4);
clrvoxel(1,7,2);

setvoxel(1,0,4);
clrvoxel(1,0,2);

setvoxel(1,0,3);
clrvoxel(1,0,5);

setvoxel(1,3,7);
clrvoxel(1,5,7);

shift(AXIS_X,-1);
delay_ms(1000-time);

//8
setvoxel(0,7,5);
setvoxel(0,6,5);
clrvoxel(0,7,3);
clrvoxel(0,6,3);

setvoxel(0,2,7);

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 52

setvoxel(0,2,6);
clrvoxel(0,4,7);
clrvoxel(0,4,6);

setvoxel(0,0,2);
setvoxel(0,1,2);
clrvoxel(0,0,4);
clrvoxel(0,1,4);

setvoxel(0,5,0);
setvoxel(0,5,1);
clrvoxel(0,3,0);
clrvoxel(0,3,1);

shift(AXIS_X,-1);
delay_ms(1000-time);

void turning_cross(int time){


int i,j,k;

fill(0x00);

//Cross

//1
for(i=0;i<5;i++){
setvoxel(0,3,i);
setvoxel(0,4,i);
setvoxel(0,i,3);
setvoxel(0,i,4);
}

delay_ms(1000-time);

//2
setvoxel(0,7,5);
setvoxel(0,6,5);
clrvoxel(0,7,3);
clrvoxel(0,6,3);

setvoxel(0,2,7);
setvoxel(0,2,6);
clrvoxel(0,4,7);
clrvoxel(0,4,6);

setvoxel(0,0,2);
setvoxel(0,1,2);
clrvoxel(0,0,4);
clrvoxel(0,1,4);

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 53

setvoxel(0,5,0);
setvoxel(0,5,1);
clrvoxel(0,3,0);
clrvoxel(0,3,1);

delay_ms(1000-time);

//3
setvoxel(0,6,6);
setvoxel(0,5,5);
clrvoxel(0,7,4);
clrvoxel(0,6,4);

setvoxel(0,1,6);
setvoxel(0,2,5);
clrvoxel(0,3,7);
clrvoxel(0,3,6);

setvoxel(0,2,2);
setvoxel(0,1,1);
clrvoxel(0,0,3);
clrvoxel(0,1,3);

setvoxel(0,6,1);
setvoxel(0,5,2);
clrvoxel(0,4,0);
clrvoxel(0,4,1);

delay_ms(1000-time);

//4
//Corners
setvoxel(0,7,7);
setvoxel(0,7,0);
setvoxel(0,0,7);
setvoxel(0,0,0);

setvoxel(0,6,7);
setvoxel(0,5,6);
clrvoxel(0,7,5);
clrvoxel(0,6,5);

setvoxel(0,0,6);
setvoxel(0,1,5);
clrvoxel(0,2,7);
clrvoxel(0,2,6);

setvoxel(0,1,0);
setvoxel(0,2,1);
clrvoxel(0,0,2);
clrvoxel(0,1,2);

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 54

setvoxel(0,7,1);
setvoxel(0,6,2);
clrvoxel(0,5,0);
clrvoxel(0,5,1);

delay_ms(1000-time);

//5
//Corners
clrvoxel(0,7,7);
clrvoxel(0,7,0);
clrvoxel(0,0,7);
clrvoxel(0,0,0);

setvoxel(0,7,2);
setvoxel(0,6,3);
clrvoxel(0,6,1);
clrvoxel(0,5,2);

setvoxel(0,0,5);
setvoxel(0,1,4);
setvoxel(0,4,5);
clrvoxel(0,1,6);
clrvoxel(0,2,5);

setvoxel(0,3,1);
setvoxel(0,2,0);
clrvoxel(0,1,1);
clrvoxel(0,2,2);

setvoxel(0,4,6);
setvoxel(0,5,7);
clrvoxel(0,6,6);
clrvoxel(0,5,5);

delay_ms(1000-time);

//6
setvoxel(0,7,3);
setvoxel(0,6,4);
clrvoxel(0,7,1);
clrvoxel(0,6,2);

setvoxel(0,0,5);
setvoxel(0,1,4);
clrvoxel(0,0,6);
clrvoxel(0,1,5);

setvoxel(0,0,4);
setvoxel(0,1,3);
clrvoxel(0,1,6);

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 55

clrvoxel(0,2,5);

setvoxel(0,3,6);
setvoxel(0,4,7);
clrvoxel(0,5,6);
clrvoxel(0,6,7);

setvoxel(0,4,1);
setvoxel(0,3,0);
clrvoxel(0,1,0);
clrvoxel(0,2,1);

delay_ms(1000-time);

//7

setvoxel(0,7,4);
clrvoxel(0,7,2);

setvoxel(0,0,4);
clrvoxel(0,0,2);

setvoxel(0,0,3);
clrvoxel(0,0,5);

setvoxel(0,3,7);
clrvoxel(0,5,7);

void space(int iterations){

int i, ii;
int rnd_y;
int rnd_z;
int rnd_num;
int time;

time = 700;

for (ii=0;ii<iterations;ii++)
{
time = time - (iterations/15);
rnd_num = rand()%4;

for (i=0; i < rnd_num;i++)


{
rnd_y = rand()%8;
rnd_z = rand()%8;
setvoxel(7,rnd_y,rnd_z);
}

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 56

delay_ms(time);
shift(AXIS_X,-1);
}

for (ii=0;ii<iterations;ii++)
{
time = time + (iterations/15);
rnd_num = rand()%4;

for (i=0; i < rnd_num;i++)


{
rnd_y = rand()%8;
rnd_z = rand()%8;
setvoxel(7,rnd_y,rnd_z);
}

delay_ms(time);
shift(AXIS_X,-1);
}

void syd_rox(){

fill(0x00);

//S
setvoxel(0,7,7);
setvoxel(0,6,7);
setvoxel(0,7,6);
setvoxel(0,7,5);
setvoxel(0,6,5);
setvoxel(0,6,4);
setvoxel(0,6,3);
setvoxel(0,7,3);

//Y
setvoxel(0,4,7);
setvoxel(0,4,6);
setvoxel(0,4,5);
setvoxel(0,3,7);
setvoxel(0,3,6);
setvoxel(0,3,5);
setvoxel(0,3,4);
setvoxel(0,3,3);
setvoxel(0,4,3);

//D
setvoxel(0,1,7);
setvoxel(0,1,6);
setvoxel(0,1,5);
setvoxel(0,1,4);

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 57

setvoxel(0,1,3);
setvoxel(0,0,6);
setvoxel(0,0,5);
setvoxel(0,0,4);

delay_ms(15000);
fill(0x00);

//R
setvoxel(0,7,7);
setvoxel(0,7,6);
setvoxel(0,7,5);
setvoxel(0,7,4);
setvoxel(0,7,3);
setvoxel(0,6,7);
setvoxel(0,5,7);
setvoxel(0,5,6);
setvoxel(0,5,5);
setvoxel(0,6,5);
setvoxel(0,6,4);
setvoxel(0,5,3);

//0
setvoxel(0,4,7);
setvoxel(0,4,6);
setvoxel(0,4,5);
setvoxel(0,4,4);
setvoxel(0,4,3);
setvoxel(0,3,7);
setvoxel(0,3,6);
setvoxel(0,3,5);
setvoxel(0,3,4);
setvoxel(0,3,3);

//X
setvoxel(0,2,7);
setvoxel(0,2,6);
setvoxel(0,2,4);
setvoxel(0,2,3);
setvoxel(0,1,5);
setvoxel(0,0,7);
setvoxel(0,0,6);
setvoxel(0,0,4);
setvoxel(0,0,3);

delay_ms(15000);

void pyro(){

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 58

fill(0x00);
//P
setvoxel(0,0,0);
setvoxel(0,0,1);
setvoxel(0,0,2);
setvoxel(0,0,3);
setvoxel(0,0,4);
setvoxel(0,0,5);
setvoxel(0,0,6);
setvoxel(0,0,7);
shift(AXIS_Y,1);
delay_ms(4000);
setvoxel(0,0,4);
setvoxel(0,0,7);
shift(AXIS_Y,1);
delay_ms(4000);

setvoxel(0,0,7);
setvoxel(0,0,7);
setvoxel(0,0,6);
setvoxel(0,0,5);
setvoxel(0,0,4);
shift(AXIS_Y,1);
delay_ms(4000);

shift(AXIS_Y,1);
delay_ms(5000);

//y
setvoxel(0,0,4);
setvoxel(0,0,5);
setvoxel(0,0,6);
setvoxel(0,0,7);
setvoxel(0,0,0);

shift(AXIS_Y,1);
delay_ms(4000);

setvoxel(0,0,4);
setvoxel(0,0,0);
shift(AXIS_Y,1);
delay_ms(4000);

setvoxel(0,0,7);
setvoxel(0,0,6);
setvoxel(0,0,5);
setvoxel(0,0,4);
setvoxel(0,0,3);
setvoxel(0,0,2);
setvoxel(0,0,1);
setvoxel(0,0,0);
shift(AXIS_Y,1);

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 59

delay_ms(4000);

shift(AXIS_Y,1);
delay_ms(5000);

//r
setvoxel(0,0,0);
setvoxel(0,0,1);
setvoxel(0,0,2);
setvoxel(0,0,3);
setvoxel(0,0,4);
setvoxel(0,0,5);
setvoxel(0,0,6);
setvoxel(0,0,7);
shift(AXIS_Y,1);
delay_ms(4000);

setvoxel(0,0,7);
setvoxel(0,0,4);
setvoxel(0,0,3);
shift(AXIS_Y,1);
delay_ms(4000);

setvoxel(0,0,7);
setvoxel(0,0,6);
setvoxel(0,0,5);
setvoxel(0,0,4);
setvoxel(0,0,2);
setvoxel(0,0,1);
setvoxel(0,0,0);
shift(AXIS_Y,1);
delay_ms(4000);

shift(AXIS_Y,1);
delay_ms(5000);

//0
setvoxel(0,0,0);
setvoxel(0,0,1);
setvoxel(0,0,2);
setvoxel(0,0,3);
setvoxel(0,0,4);
setvoxel(0,0,5);
setvoxel(0,0,6);
setvoxel(0,0,7);
shift(AXIS_Y,1);
delay_ms(4000);

setvoxel(0,0,7);
setvoxel(0,0,0);
shift(AXIS_Y,1);
delay_ms(4000);

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 60

setvoxel(0,0,7);
setvoxel(0,0,6);
setvoxel(0,0,5);
setvoxel(0,0,4);
setvoxel(0,0,3);
setvoxel(0,0,2);
setvoxel(0,0,1);
setvoxel(0,0,0);
shift(AXIS_Y,1);
delay_ms(4000);

shift(AXIS_Y,1);
delay_ms(4000);
shift(AXIS_Y,1);
delay_ms(4000);
shift(AXIS_Y,1);
delay_ms(4000);
shift(AXIS_Y,1);
delay_ms(4000);
shift(AXIS_Y,1);
delay_ms(4000);
shift(AXIS_Y,1);
delay_ms(4000);
shift(AXIS_Y,1);
delay_ms(4000);
shift(AXIS_Y,1);
delay_ms(2500);

fill(0x00);

void firework(int i,int j, int time){

fill(0x00);

setvoxel(3-i,4-j,0);
delay_ms(900-time);

clrvoxel(3- i,4-j,0);
setvoxel(4-i,4-j,1);
delay_ms(1200-time);

clrvoxel(4- i,4-j,1);
setvoxel(4-i,5-j,2);
delay_ms(1400-time);

clrvoxel(4- i,5-j,2);
setvoxel(3-i,5-j,3);
delay_ms(1700-time);

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 61

clrvoxel(3- i,5-j,3);
setvoxel(3-i,4-j,4);
delay_ms(2000-time);

clrvoxel(3- i,4-j,4);
setvoxel(4-i,4-j,5);
delay_ms(2000-time);

clrvoxel(4- i,4-j,5);
setvoxel(4-i,3-j,6);
delay_ms(2000-time);

//Explode
clrvoxel(4- i,3-j,6);
setvoxel(4-i,3-j,7);
setvoxel(4-i,4-j,6);
setvoxel(4-i,2-j,6);
setvoxel(3-i,3-j,6);
setvoxel(5-i,3-j,6);
delay_ms(2000-time);

shift(AXIS_Z,-1);
setvoxel(4-i,5-j,5);
setvoxel(4-i,1-j,5);
setvoxel(2-i,3-j,5);
setvoxel(6-i,3-j,5);
delay_ms(900-time);

shift(AXIS_Z,-1);
setvoxel(4-i,6-j,3);
setvoxel(4-i,0-j,3);
setvoxel(1-i,3-j,3);
setvoxel(7-i,3-j,3);
delay_ms(900-time);

shift(AXIS_Z,-1);
setvoxel(4-i,7-j,1);
setvoxel(3-i,0-j,1);
setvoxel(0-i,3-j,1);
setvoxel(7-i,2-j,1);
delay_ms(1400-time);

shift(AXIS_Z,-1);
delay_ms(1400-time);

shift(AXIS_Z,-1);
delay_ms(1400-time);

shift(AXIS_Z,-1);
delay_ms(1400-time);

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 62

shift(AXIS_Z,-1);
delay_ms(700-time);

fill(0x00);

void zoom_pyramid_clear(){

//1

box_walls(0,0,0,7,0,7);
delay_ms(500);

//2

//Pyramid
box_wireframe(0,0,0,7,0,1);

clrplane_y(0);
delay_ms(500);

//3

//Pyramid
clrplane_y(1);
box_walls(0,2,0,7,2,7);
delay_ms(500);

//4

//Pyramid
clrplane_y(2);
box_walls(0,3,0,7,3,7);
delay_ms(500);

//5

//Pyramid
clrplane_y(3);
box_walls(0,4,0,7,4,7);
delay_ms(500);

//5

//Pyramid

clrplane_y(4);
box_walls(0,5,0,7,5,7);
delay_ms(500);
//6

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 63

//Pyramid

clrplane_y(5);
box_walls(0,6,0,7,6,7);
delay_ms(500);
//7

//Pyramid

clrplane_y(6);
box_walls(0,7,0,7,7,7);
delay_ms(500);

clrplane_y(7);
delay_ms(10000);

void zoom_pyramid(){
int i,j,k,time;

//1
fill(0x00);

box_walls(0,0,0,7,0,7);
delay_ms(500);

//2
fill(0x00);
//Pyramid
box_wireframe(0,0,0,7,0,1);

box_walls(0,1,0,7,1,7);
delay_ms(500);

//3
fill(0x00);
//Pyramid
box_wireframe(0,0,0,7,1,1);
box_wireframe(1,1,2,6,1,3);

box_walls(0,2,0,7,2,7);
delay_ms(500);

//4
fill(0x00);
//Pyramid
box_wireframe(0,0,0,7,2,1);
box_wireframe(1,1,2,6,2,3);

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 64

box_wireframe(2,2,4,5,2,5);

box_walls(0,3,0,7,3,7);
delay_ms(500);

//5
fill(0x00);
//Pyramid
box_wireframe(0,0,0,7,3,1);
box_wireframe(1,1,2,6,3,3);
box_wireframe(2,2,4,5,3,5);
box_wireframe(3,3,6,4,3,7);

box_walls(0,4,0,7,4,7);
delay_ms(500);

//5
fill(0x00);
//Pyramid
box_wireframe(0,0,0,7,4,1);
box_wireframe(1,1,2,6,4,3);
box_wireframe(2,2,4,5,4,5);
box_wireframe(3,3,6,4,4,7);

box_walls(0,5,0,7,5,7);
delay_ms(500);
//6

fill(0x00);
//Pyramid
box_wireframe(0,0,0,7,5,1);
box_wireframe(1,1,2,6,5,3);
box_wireframe(2,2,4,5,5,5);
box_wireframe(3,3,6,4,4,7);

box_walls(0,6,0,7,6,7);
delay_ms(500);
//7
fill(0x00);
//Pyramid
box_wireframe(0,0,0,7,6,1);
box_wireframe(1,1,2,6,6,3);
box_wireframe(2,2,4,5,5,5);
box_wireframe(3,3,6,4,4,7);

box_walls(0,7,0,7,7,7);
delay_ms(500);

fill(0x00);
box_wireframe(0,0, 0, 7, 7, 1);
box_wireframe(1,1, 2, 6, 6, 3);
box_wireframe(2,2, 4, 5, 5, 5);

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 65

box_wireframe(3,3, 6, 4, 4, 7);

delay_ms(10000);
}

void effect_intro(){
int cnt,cnt_2,time;

//Bottom To Top

for(cnt=0;cnt<=7;cnt++){
box_wireframe(0, 0, 0, 7, 7, cnt);
delay_ms(2000);
}
for(cnt=0;cnt<7;cnt++){
clrplane_z(cnt);
delay_ms(2000);
}

//Shift Things Right


//1
shift(AXIS_Y,-1);
for(cnt=0;cnt<=7;cnt++){
setvoxel(cnt,0,6);
}
delay_ms(2000);
//2
shift(AXIS_Y,-1);
for(cnt=0;cnt<=7;cnt++){
setvoxel(cnt,0,5);
}
setvoxel(0,0,6);
setvoxel(7,0,6);
delay_ms(2000);
//3
shift(AXIS_Y,-1);
for(cnt=0;cnt<=7;cnt++){
setvoxel(cnt,0,4);
}
setvoxel(0,0,5);
setvoxel(7,0,5);
setvoxel(0,0,6);
setvoxel(7,0,6);
delay_ms(2000);

//4
shift(AXIS_Y,-1);
for(cnt=0;cnt<=7;cnt++){
setvoxel(cnt,0,3);
}
setvoxel(0,0,4);

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 66

setvoxel(7,0,4);
setvoxel(0,0,5);
setvoxel(7,0,5);
setvoxel(0,0,6);
setvoxel(7,0,6);
delay_ms(2000);

//5
shift(AXIS_Y,-1);
for(cnt=0;cnt<=7;cnt++){
setvoxel(cnt,0,2);
}
setvoxel(0,0,3);
setvoxel(7,0,3);
setvoxel(0,0,4);
setvoxel(7,0,4);
setvoxel(0,0,5);
setvoxel(7,0,5);
setvoxel(0,0,6);
setvoxel(7,0,6);
delay_ms(2000);

//6
shift(AXIS_Y,-1);
for(cnt=0;cnt<=7;cnt++){
setvoxel(cnt,0,1);
}
setvoxel(0,0,2);
setvoxel(7,0,2);
setvoxel(0,0,3);
setvoxel(7,0,3);
setvoxel(0,0,4);
setvoxel(7,0,4);
setvoxel(0,0,5);
setvoxel(7,0,5);
delay_ms(2000);

//7
shift(AXIS_Y,-1);
for(cnt=0;cnt<=7;cnt++){
setvoxel(cnt,0,0);
}
setvoxel(0,0,1);
setvoxel(7,0,1);
setvoxel(0,0,2);
setvoxel(7,0,2);
setvoxel(0,0,3);
setvoxel(7,0,3);
setvoxel(0,0,4);
setvoxel(7,0,4);
setvoxel(0,0,5);

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 67

setvoxel(7,0,5);
delay_ms(2000);

//Right To Left
for(cnt=0;cnt<=7;cnt++){
box_wireframe(0, 0, 0, 7, cnt, 7);
delay_ms(2000);
}
for(cnt=0;cnt<7;cnt++){
clrplane_y(cnt);
delay_ms(2000);
}

//Shift to the bottom


for(cnt_2=6;cnt_2>=0;cnt_2--){
shift(AXIS_Z,-1);
for(cnt=0;cnt<=7;cnt++){
setvoxel(cnt,cnt_2,0);
}
for(cnt=6;cnt>cnt_2;cnt--){
setvoxel(0,cnt,0);
setvoxel(7,cnt,0);
}

delay_ms(2000);
}

//Make All Wall Box

for(cnt=0;cnt<=6;cnt++){
fill(0x00);
box_walls(0,0,0,7,7,cnt);
delay_ms(2000);
}

time = 2000;
for(cnt_2=0;cnt_2<5;cnt_2++){
time = time - 300;
//Make Box Smaller
for(cnt=0;cnt<=3;cnt++){
fill(0x00);
box_walls(cnt,cnt,cnt,7-cnt,7-cnt,7-cnt);
delay_ms(time);
}

//Make Box Bigger


for(cnt=0;cnt<=3;cnt++){
fill(0x00);
box_walls(3-cnt,3-cnt,3-cnt,4+cnt,4+cnt,4+cnt);
delay_ms(time);
}
}

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 68

for(cnt_2=0;cnt_2<5;cnt_2++){
time = time + 300;
//Make Box Smaller
for(cnt=0;cnt<=3;cnt++){
fill(0x00);
box_walls(cnt,cnt,cnt,7-cnt,7-cnt,7-cnt);
delay_ms(time);
}

//Make Box Bigger


for(cnt=0;cnt<=3;cnt++){
fill(0x00);
box_walls(3-cnt,3-cnt,3-cnt,4+cnt,4+cnt,4+cnt);
delay_ms(time);
}
}
delay_ms(2000);

void draw_positions_axis (char axis, unsigned char positions[64], int invert)


{
int x, y, p;

fill(0x00);

for (x=0; x<8; x++)


{
for (y=0; y<8; y++)
{
if (invert)
{
p = (7-positions[(x*8)+y]);
} else
{
p = positions[(x*8)+y];
}

if (axis == AXIS_Z)
setvoxel(x,y,p);

if (axis == AXIS_Y)
setvoxel(x,p,y);

if (axis == AXIS_X)
setvoxel(p,y,x);
}
}

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 69

// Draw a plane on one axis and send it back and forth once.
void effect_planboing (int plane, int speed)
{
int i;
for (i=0;i<8;i++)
{
fill(0x00);
setplane(plane, i);
delay_ms(speed);
}

for (i=7;i>=0;i--)
{
fill(0x00);
setplane(plane,i);
delay_ms(speed);
}
}

//
=============================================================================
=============
// Draw functions
//
=============================================================================
=============

// Set a single voxel to ON


void setvoxel(int x, int y, int z)
{
if (inrange(x,y,z))
cube[z][y] |= (1 << x);
}

// Set a single voxel to ON


void clrvoxel(int x, int y, int z)
{
if (inrange(x,y,z))
cube[z][y] &= ~(1 << x);
}

// This function validates that we are drawing inside the cube.


unsigned char inrange(int x, int y, int z)
{
if (x >= 0 && x < 8 && y >= 0 && y < 8 && z >= 0 && z < 8)
{
return 0x01;
} else

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 70

{
// One of the coordinates was outside the cube.
return 0x00;
}
}

// Get the current status of a voxel


unsigned char getvoxel(int x, int y, int z)
{
if (inrange(x,y,z))
{
if (cube[z][y] & (1 << x))
{
return 0x01;
} else
{
return 0x00;
}
} else
{
return 0x00;
}
}

// In some effect we want to just take bool and write it to a voxel


// this function calls the apropriate voxel manipulation function.
void altervoxel(int x, int y, int z, int state)
{
if (state == 1)
{
setvoxel(x,y,z);
} else
{
clrvoxel(x,y,z);
}
}

// Flip the state of a voxel.


// If the voxel is 1, its turned into a 0, and vice versa.
void flpvoxel(int x, int y, int z)
{
if (inrange(x, y, z))
cube[z][y] ^= (1 << x);
}

// Makes sure x1 is alwas smaller than x2


// This is usefull for functions that uses for loops,
// to avoid infinite loops
void argorder(int ix1, int ix2, int *ox1, int *ox2)
{
if (ix1>ix2)
{

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 71

int tmp;
tmp = ix1;
ix1= ix2;
ix2 = tmp;
}
*ox1 = ix1;
*ox2 = ix2;
}

// Sets all voxels along a X/Y plane at a given point


// on axis Z
void setplane_z (int z)
{
int i;
if (z>=0 && z<8)
{
for (i=0;i<8;i++)
cube[z][i] = 0xff;
}
}

// Clears voxels in the same manner as above


void clrplane_z (int z)
{
int i;
if (z>=0 && z<8)
{
for (i=0;i<8;i++)
cube[z][i] = 0x00;
}
}

void setplane_x (int x)


{
int z;
int y;
if (x>=0 && x<8)
{
for (z=0;z<8;z++)
{
for (y=0;y<8;y++)
{
cube[z][y] |= (1 << x);
}
}
}
}

void clrplane_x (int x)


{
int z;
int y;

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 72

if (x>=0 && x<8)


{
for (z=0;z<8;z++)
{
for (y=0;y<8;y++)
{
cube[z][y] &= ~(1 << x);
}
}
}
}

void setplane_y (int y)


{
int z;
if (y>=0 && y<8)
{
for (z=0;z<8;z++)
cube[z][y] = 0xff;
}
}

void clrplane_y (int y)


{
int z;
if (y>=0 && y<8)
{
for (z=0;z<8;z++)
cube[z][y] = 0x00;
}
}

void setplane (char axis, unsigned char i)


{
switch (axis)
{
case AXIS_X:
setplane_x(i);
break;

case AXIS_Y:
setplane_y(i);
break;

case AXIS_Z:
setplane_z(i);
break;
}
}

void clrplane (char axis, unsigned char i)


{

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 73

switch (axis)
{
case AXIS_X:
clrplane_x(i);
break;

case AXIS_Y:
clrplane_y(i);
break;

case AXIS_Z:
clrplane_z(i);
break;
}
}

// Fill a value into all 64 byts of the cube buffer


// Mostly used for clearing. fill(0x00)
// or setting all on. fill(0xff)
void fill (unsigned char pattern)
{
int z;
int y;
for (z=0;z<8;z++)
{
for (y=0;y<8;y++)
{
cube[z][y] = pattern;
}
}
}

// Draw a box with all walls drawn and all voxels inside set
void box_filled(int x1, int y1, int z1, int x2, int y2, int z2)
{
int iy;
int iz;

argorder(x1, x2, &x1, &x2);


argorder(y1, y2, &y1, &y2);
argorder(z1, z2, &z1, &z2);

for (iz=z1;iz<=z2;iz++)
{
for (iy=y1;iy<=y2;iy++)
{
cube[iz][iy] |= byteline(x1,x2);
}
}

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 74

// Darw a hollow box with side walls.


void box_walls(int x1, int y1, int z1, int x2, int y2, int z2)
{
int iy;
int iz;

argorder(x1, x2, &x1, &x2);


argorder(y1, y2, &y1, &y2);
argorder(z1, z2, &z1, &z2);

for (iz=z1;iz<=z2;iz++)
{
for (iy=y1;iy<=y2;iy++)
{
if (iy == y1 || iy == y2 || iz == z1 || iz == z2)
{
cube[iz][iy] = byteline(x1,x2);
} else
{
cube[iz][iy] |= ((0x01 << x1) | (0x01 << x2));
}
}
}

// Draw a wireframe box. This only draws the corners and edges,
// no walls.
void box_wireframe(int x1, int y1, int z1, int x2, int y2, int z2)
{
int iy;
int iz;

argorder(x1, x2, &x1, &x2);


argorder(y1, y2, &y1, &y2);
argorder(z1, z2, &z1, &z2);

// Lines along X axis


cube[z1][y1] = byteline(x1,x2);
cube[z1][y2] = byteline(x1,x2);
cube[z2][y1] = byteline(x1,x2);
cube[z2][y2] = byteline(x1,x2);

// Lines along Y axis


for (iy=y1;iy<=y2;iy++)
{
setvoxel(x1,iy,z1);
setvoxel(x1,iy,z2);
setvoxel(x2,iy,z1);
setvoxel(x2,iy,z2);

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 75

// Lines along Z axis


for (iz=z1;iz<=z2;iz++)
{
setvoxel(x1,y1,iz);
setvoxel(x1,y2,iz);
setvoxel(x2,y1,iz);
setvoxel(x2,y2,iz);
}

// Returns a byte with a row of 1's drawn in it.


// byteline(2,5) gives 0b00111100
char byteline (int start, int end)
{
return ((0xff<<start) & ~(0xff<<(end+1)));
}

// Flips a byte 180 degrees.


// MSB becomes LSB, LSB becomes MSB.
char flipbyte (char byte)
{
char flop = 0x00;

flop = (flop & 0b11111110) | (0b00000001 & (byte >> 7));


flop = (flop & 0b11111101) | (0b00000010 & (byte >> 5));
flop = (flop & 0b11111011) | (0b00000100 & (byte >> 3));
flop = (flop & 0b11110111) | (0b00001000 & (byte >> 1));
flop = (flop & 0b11101111) | (0b00010000 & (byte << 1));
flop = (flop & 0b11011111) | (0b00100000 & (byte << 3));
flop = (flop & 0b10111111) | (0b01000000 & (byte << 5));
flop = (flop & 0b01111111) | (0b10000000 & (byte << 7));
return flop;
}

// Draw a line between any coordinates in 3d space.


// Uses integer values for input, so dont expect smooth animations.
void line(int x1, int y1, int z1, int x2, int y2, int z2)
{
float xy; // how many voxels do we move on the y axis for each step on the x axis
float xz; // how many voxels do we move on the y axis for each step on the x axis
unsigned char x,y,z;
unsigned char lasty,lastz;

// We always want to draw the line from x=0 to x=7.


// If x1 is bigget than x2, we need to flip all the values.
if (x1>x2)
{
int tmp;
tmp = x2; x2 = x1; x1 = tmp;

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 76

tmp = y2; y2 = y1; y1 = tmp;


tmp = z2; z2 = z1; z1 = tmp;
}

if (y1>y2)
{
xy = (float)(y1- y2)/(float)(x2-x1);
lasty = y2;
} else
{
xy = (float)(y2- y1)/(float)(x2-x1);
lasty = y1;
}

if (z1>z2)
{
xz = (float)(z1-z2)/(float)(x2-x1);
lastz = z2;
} else
{
xz = (float)(z2-z1)/(float)(x2-x1);
lastz = z1;
}

// For each step of x, y increments by:


for (x = x1; x<=x2;x++)
{
y = (xy*(x-x1))+y1;
z = (xz*(x-x1))+z1;
setvoxel(x,y,z);
}

// Delay loop.
// This is not calibrated to milliseconds,
// but we had allready made to many effects using this
// calibration when we figured it might be a good idea
// to calibrate it.
void delay_ms(uint16_t x)
{
uint8_t y, z;
for ( ; x > 0 ; x--){
for ( y = 0 ; y < 90 ; y++){
for ( z = 0 ; z < 6 ; z++){
asm volatile ("nop");
}
}
}

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 77

// Shift the entire contents of the cube along an axis


// This is great for effects where you want to draw something
// on one side of the cube and have it flow towards the other
// side. Like rain flowing down the Z axiz.
void shift (char axis, int direction)
{
int i, x ,y;
int ii, iii;
int state;

for (i = 0; i < 5; i++)


{
if (direction == -1)
{
ii = i;
} else
{
ii = (4-i);
}

for (x = 0; x < 5; x++)


{
for (y = 0; y < 5; y++)
{
if (direction == -1)
{
iii = ii+1;
} else
{
iii = ii-1;
}

if (axis == AXIS_Z)
{
state = getvoxel(x,y,iii);
altervoxel(x,y,ii,state);
}

if (axis == AXIS_Y)
{
state = getvoxel(x,iii,y);
altervoxel(x,ii,y,state);
}

if (axis == AXIS_X)
{
state = getvoxel(iii,y,x);

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 78

altervoxel(ii,y,x,state);
}
}
}
}

if (direction == -1)
{
i = 4;
} else
{
i = 0;
}

for (x = 0; x < 5; x++)


{
for (y = 0; y < 5; y++)
{
if (axis == AXIS_Z)
clrvoxel(x,y,i);

if (axis == AXIS_Y)
clrvoxel(x,i,y);

if (axis == AXIS_X)
clrvoxel(i,y,x);
}
}
}

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 79

Datasheets of various components and integrated circuits:

Datasheets of following components and integrated circuits are attached after this page.

1) Resistor datasheet

2) Capacitor datasheet

3) 74HC138 demultiplexer datasheet

4) 74HC574 IC datasheet

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 95

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 112

OAPS report

OAPS Report
Digital signed

Processing date: Sat, 3.5.2014 0:39:30 CEST

A total of 408 fragments were analysed. As a result 11 fragments (2.7%) were found in other
documents. In the document preview below the fragments are marked light blue and clickable.

Cross reference documents


Following list of found documents is grouped by document titles and ordered by found fragements.
With a mousec lick on "x fragments" the relevant fragments in the document are colored blue and the
window scrolls to the first location. Click on "x fragments" again resets the special marks.

1 fragment found in a text with the title: "Katastrofbistånd - utifrån ett


organisationsperspektiv", located on:
http://uu.diva-portal.org/smash/get/diva2:131622/FULLTEXT01

1 fragment found in a text with the title: "Factors facilitating the implementation and
functioning of workplace forums", located on:
http://scholar.sun.ac.za/bitstream/handle/10019.1/923/walker_facilitating_2009.doc?sequence =1

1 fragment found in a text with the title: "The potential of the therapeutic relationship in dealing
with learning disabled children", located on:
http://upetd.up.ac.za/thesis/submitted/etd-06152005-154202/unrestricted/03back.pdf

1 fragment found in a text with the title: "Automatic Generation and Tuning of MPI Collective
Communication Routines", located on:
http://www.cs.fsu.edu/~xyuan/paper/05ics.pdf

1 fragment found in a text with the title: "Meaning and motivation of the car watcher in Knysna,
South Africa", located on:
http://etd.ohiolink.edu/send-pdf.cgi/Sampson%20Mark%20Garrett.pdf?osu1087324358

1 fragment found in a text with the title: "Doppler Radiation Study", located on:
http://deepblue.lib.umich.edu/bitstrea m/2027.42/21148/1/rl2023.0001.001.txt

1 fragment found in a text with the title: "Towards a more flexible inter-organizational workflow
design: the application of local criteria principle ", located on:
http://ro.uow.edu.au/cgi/viewcontent.cgi?article=1569&context =theses

1 fragment found in a text with the title: "Effects of manufactured fine aggregate on physical
and mechanistic properties of Saskatchewan asphalt concrete mixes ", located on:
http://library2.usask.ca/theses/available/etd-04132007-162335/unrestricted/AnthonyA.pdf

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 113

1 fragment found in a text with the title: "Accounting for employee share options: a critical
analysis", located on:
http://uir.unisa.ac.za/xmlui/bitstrea m/handle/10500/1211/01dissertation.pdf?sequence =2

1 fragment found in a text with the title: "Low-power sound-based user activity recognition",
located on:
http://e-collection.ethbib.ethz.ch/eserv/eth:29348/eth-29348-02.pdf

1 fragment found in a text with the title: "Sou'wester, November 30, 1928, Volume 10, Issue
11", located on:
http://dlynx.rhodes.edu/jspui/bitstrea m/10267/5582/1/19281130_souwester.pdf

1 fragment found in a text with the title: "The use of single sensors in seismic acquisition",
located on:
http://repository.tudelft.nl/assets/uuid:8381d626-1c16-4869-9052-
33132983071e/ceg_panea_20071019.pdf

1 fragment found in a text with the title: "Mass incarceration in the United States : at what cost?
: hearing before the Joint Economic Committee, Congress of the United States, One Hundred
Tenth Congress, first session, October 4, 2007. ", located on:
http://www.gpo.gov/fdsys/pkg/CHRG-110shrg39645/pdf/CHRG-110shrg39645. pdf

1 fragment found in a text with the title: "http://research. usenet.at/event/ecai2000-


kbsmbe/papers/w31-02.pdf /w31-02.pdf", located on:
http://research.usenet.at/event/ecai2000-kbsmbe/papers/w31-02.pdf

1 fragment found in a text with the title: "Solving large linear systems in an implicit
thermohaline ocean model", located on:
http://dissertations.ub.rug.nl/FILES/faculties/science/2007/a.c.de.niet/c2.pdf
http://dissertations.ub.rug.nl/FILES/faculties/science/2007/a.c.de.niet/thesis.pdf

1 fragment found in a text with the title: "Network Interrupts: Supporting Delay Sensitive
Applications in Low Power Wireless Control Networks ", located on:
http://www.netlab.tkk.fi/chants-2007/papers/3-1.pdf
http://www.comp.lancs.ac.uk/~kortuem/publications/assets/Chants-2007.pdf

1 fragment found in a text with the title: "Characterisation and Applications of MANET Routing
Algorithms in Wireless Sensor Networks", located on:
http://www.inf.ed.ac.uk/publications/thesis/online/IM070460.pdf
http://www.inf.ed.ac.uk/publications/thesis/online/IM070490.pdf

1 fragment found in a text with the title: "Nurturing tagging communities", located on:
http://conservancy.umn.edu/bitstream/49984/1/Sen_umn_0130E_10255.pdf

1 fragment found in a text with the title: "Kabul Times (Apr - Jun, 1967)", located on:
http://digitalcommons.unl.edu/cgi/viewcontent.cgi?article =1180&context =afghanenglish

1 fragment found in a text with the title: "Persistence of vision", located on:
http://en.wikipedia.org/wiki/Persistence_of_vision

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 113

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 114

Open Access Plagiarism Search Certificate

GUJARAT TECHNOLOGICAL UNIVERSITY

We hereby certify that we are the sole authors of this IDP/UDP project report and that neither any
part of this IDP/UDP project report nor the whole of the IDP/UDP Project report has been submitted for a
degree by other student(s) to any other University or Institution.

We certify that, to the best of our knowledge, the current IDP/UDP Project report does not infringe
upon anyone’s copyright nor violate any proprietary rights and that any ideas, techniques, quotations or any
other material from the work of other people included in our IDP/UDP Project report, published or
otherwise, are fully acknowledged in accordance with the standard referencing practices. Furthermore, to the
extent that we have included copyrighted material that surpasses the boundary o f fair dealing within the
meaning of the Indian Copyright (Amendment) Act 2012, we certify that we have obtained a written
permission from the copyright owner(s) to include such material(s) in the current IDP/UDP Project report
and have included copies of such copyright clearances to our appendix.

We have checked the write up of the present IDP/UDP Project report using anti-plagiarism database
and it is in the allowable limit. In case of any complaints pertaining to plagiarism, we certify that we shall be
solely responsible for the same and we understand that as per norms, University can even revoke BE degree
conferred upon the student(s) submitting this IDP/UDP Project report, in case it is found to be plagiarised.

GTU TEAM ID:12000444

Enrollment No. Names Signature


100250108026 DARSHAK B PANCHAL
100250108020 BHAUMIK M PATEL
100250108057 ANAND D SHAH

DATE: / / PLACE:

NAME OF GUIDE

PROF.S.P.YADAV SIGNATURE OF GUIDE

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 115

11. REFERENCES

1. "3D LED Cube K it." Nuts and Volts. N.p., n.d. Web. 16 Feb 2012.
http://store.nutsvolts.com/product.php?productid=17052&cat=341&bestseller=Y

2. "4Cube USB Kit." Hypnocube. N.p., n.d. Web. 16 Feb 2012.


http://hypnocube.com/products/4cube-all/4cube- usb-kit/

3. Chr. "Led Cube 8x8x8." Instructables. N.p., n.d. Web. 2 Feb 2012.
http://www.instructables.com/id/Led-Cube-8x8x8/?ALLSTEPS

4. "LED Cube Kit." Picprojects. N.p., n.d. Web. 16 Feb 2012.


http://picprojects.biz/shop/article_555FSK/LED-Cube-K it-
#555FSK.html?shop_param=cid=2&aid=555FSK&

5. "LT3754 ." Linear Technology. Linear Technology, n.d. Web. 11 Mar 2012.
http://www.linear.com/product/LT3754

6. Phil. "Charlieplexing LEDs- The Theory." Instructables. 27 Aug 2008, n.d. Web. 20 Feb 2012.
http://www.instructables.com/id/Charlieplexing-LEDs--The-theory/?ALLSTEPS

7. "Rainbow Cube." seeedwiki. N.p., 15 March 2012. Web. 16 Fwb 2012.


http://seeedstudio.com/wiki/Rainbow_Cube

8. Reitzfeld, Wesley, SachitBakshi, Shatrovoy O leg, and Elaine Uy. "3D LED Cube Display." BU
Electrical & Computer Engineering. N.p., n.d. Web. 11 Apr 2012.
http://www.bu.edu/ece/undergraduate/senior-design-project/senior-design-projects-2008/3d- led-cube-
display/

9. Shulze, N ick. "RGB LED Cube." How Not to Engineer. N.p., 06 April 2012. Web. 18 Apr 2012.
http://www.hownottoengineer.com/projects/rgb- led-cube.html

10. Texas Instruments. Texas Instruments, n.d. Web. 11 Mar 2012.


http://www.ti.com

11. http://www.pyroelectro.com/projects/8x8x8_led_cube/

8x8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING
P a g e | 116

8x8 3D LED CUBE I ELECTRICAL & ELECTRONICS ENGINEERING DEPARTMENT, INDUS INSTITUTE OF TECHNOLOGY & ENGINEERING