LED CUBE 4x4x4
Report for ZKT 297 Assignment Project
Akmal Hafizi bin Annuar
(148208)
December 2020
Universiti Sains Malaysia
Abstract
The report of ZKT 297 assignment project begins with the introduction, overview, objectives
and the whole timeline of the project. The problem statements of the project are simply to
comprehend and to brainstorm for the lines of codes and for the development of the product
successfully. The project proposed and reported is an LED cube 4x4x4 that has both the
graphic and sound displays using Arduino products. Both the design specifications and the
financial requirements are clearly reported. The report also includes all the layout drawings of
both the circuit and the physical product. The engineering calculation and analysis are
presented thoroughly in the report. The details of the fabrication are explained in a step-by-
step manner. All in all, the result was partially satisfactory. On the plus side, the lines of
codes work well with the application of the integrated circuit, IC SN74HC595N. On the
minus side, a limitation on the practicality of fabricating the physical product is encountered
at a later stage of the fabrication. The issue prevented the electronics components from being
successfully assembled with the physical product. Eventually, the demonstration and testing
are done on the breadboard instead. To conclude, the project has given the benefit of the
opportunity in designing and devising a product through the engineering approach,
regardless.
2
Table of Content
Introduction 4
Problem Definition 7
Embodiment of Design 11
Prototyping 19
Conclusion 25
Appendix 26
3
1.0 INTRODUCTION
1.1 Overview of the Project
The project determinedly solves the problems surrounding daily struggles through the
application of electronics and software computations to creating new useful products.
In particular, the development of LED cube 4x4x4 using Arduino software and
hardware. The objectives are intended for students to acquire skills and knowledge in
a variety of contexts. For instance, the analytical skills required using technology to
solve engineering design problem, and also the entrepreneurial skills and attributes
being learnt in the fabrication of a product.
1.2 Design Objectives
The LED cube 4x4x4 is chose as the product of the project to set out in meeting the
rubrics. It is required to incorporate a minimum of 32 LEDs and a buzzer in the
project. The LED cube is opted due to the impression that it would make a standout
graphic display as per rubric of the project. This particular preference meets another
objectives of the project whereby, not only does it incorporate the compulsory
Arduino IDE coding of both the LED and buzzer, but also a whole new level of the
learning to coding the application of the integrated circuit, IC SN74HC595N. On the
whole, the product developed meets the necessities of the rubrics alongside with the
determination to building an extensive graphic-display product through the use of
Arduino hardware and software.
1.3 Scopes of Project
This project proposes an LED cube 4x4x4 through the application of Arduino
software and hardware with entrepreneurial skills and attributes injected alongside
with it. It is essentially a graphic-display product with more than 32 LEDs used and
also a buzzer. The codes are entirely developed through the software Arduino IDE.
The hardware is partially of Arduino and of general electronics. Besides, the LED
cube is primarily economic with a reasonable quality. The dimension is optimised
from the length of LED terminal legs and thus the final product is conveniently a
4
hand-held object with an easy-to-carry weight and a fit-on-table size. The problems of
creating a graphic-display product are identified through the method of problem
identification. The process of design embodiment consists of layout design and the
necessary coding as well as a bit of analysis throughout the project. The detail design
includes the design, drawings, and assembly as well as the cost analysis. The
prototyping provides the details of fabrication and finally the product testing results.
1.4 Significance of the Project
At the end of the project, it will influence positively to the students. The significance
is in terms of the practicality of syllabuses and the exposure to the outlook of job
prospect of an engineer. The mechanism is by way of the process of applying the
syllabuses to the design and development of the LED cube 4x4x4 all the way to the
actual product completely built. In virtue of the problem statement, the project gives
the possibility to an economic graphic-display device with maker-culture and
tinkering attributes infused alongside with it.
5
6
W1 W2 W3 W4 W5 W6 W6 W7 W7 W7 W7 W7 W8 W8
Proposal
Table 1 shows the plan of the project throughout the semester.
Part Purchase
Table 1. Project Plan.
Simulation
Model
Development
1.5 Project Planning
Evaluation and
Improvisation
Demonstration
Report
2.0 PROBLEM DEFINITION
2.1 Problem Statement
This project intends to tackle on daily struggles through the application of electronics
and software computations to creating new useful products. The product developed is
an LED cube 4x4x4 with a music-generating buzzer. The problem statements tackled
include the process of comprehending of how its coding works. Secondly, the
brainstorming session of how the physical product should be designed. Thirdly, to
acquire all the required components as well as to making sure all components
functions properly. The methodology taken into account includes research made to
learn related structures of codes pertaining to the design bases. Secondly, sketches and
drafts were drawn to visualize the physical parameters and the aesthetic factors of the
final product. Thirdly, purchase were made for the components needed, as well as
testing is done to each component prior to the assembly process.
2.2 Product Design Specification
2.2.1 Product Identification
Performance
The product has some key features that are different from the others. It comes
with a buzzer that generates music as the product displays its graphic feature.
It is programmed to display multiple patterns of graphic display using 64
LEDs in 3D configuration.
Economy
According to the research made on the Internet, the suitable price for the
product is reasonably within the range of RM 30.00 and RM 60.00. If the
product is managed to be sold at price range given, it will yield higher chance
of customers buying the product.
7
Target production cost
The target for the production cost is about RM 54. The particular cost only
covers the cost of materials to making up the product, excluding the tools
needed in the process.
Product life span
It is estimated that the product will last in the market for approximately 7
years. This is for the reason of the reliability of the electronics components
used to make up the product.
Competition
Competition is expected to come from the experts in the maker-culture and the
tinkering community where they are potentially capable of producing a better
product.
Size and weight
The product is of fit-on-table size and is of easy-to-carry weight, with an
approximate dimension of 120x140x170 mm.
Materials
The main materials are woods apart from the essential electronics components.
Appearance
The product is of cubic in dimension and it comes with a platform that puts the
electronics components in place.
Quality and reliability
The quality is reasonable to the price of the product. The reliability is
guaranteed as the components involved are not too complex.
8
2.2.2 Physical Descriptions
The product is a cube containing 64 LEDs in every corner of its 4x4x4 smaller
cube constituents. The LEDs are the main components to its feature of graphic
display. The graphic display is programmed through Arduino IDE. Special
feature of the product is it comes with a piezo-buzzer that generates music
alongside with the lighting feature. A platform is placed below the cube to
support the latter and also to place the essential electronics components. The
dimension of the cube is optimised from the LED terminal legs resulting in a
hand-held size product. Together with the platform, the product is as a whole
of easy-to-carry weight and of fit-on-table size.
The electronics are powered by a 9V battery. The cell supplies power to the
pre-programmed Arduino board that incorporates the intergrated circuit, IC
SN74HC595N. The integrated circuit is the main component that yields the
aesthetic graphic display of the LEDs. Both the wiring and finishing are
optimised to account for the aesthetic factors.
2.2.3 Manufacturing Specifications
Arduino board
Arduino products are the main components of the project. Arduino products
allow the tinkering process of this project to creating a tangible object that
works on some electronics and programming to solve daily problems. The
hardware use to provide the platform for the programing and circuitry is the
Arduino board. The software used to program the product is Arduino IDE.
Woods
Woods generally have low electrical and thermal conductivity, high strength-
to-weight ratio, resistance to shock, good durability, low cost and easy to
manufacture. Thus, woods are opted as the main material for the development
of both the cube and the platform.
9
Electronics components
Electronics components are the second in importance for the product. They
connect and complete the circuit the Arduino board needs to function the
LEDs and the buzzer through the integrated circuit. The electronics
components include the integrated circuit IC SN74HC595N, LEDs, piezo-
buzzer, 220-ohm resistors and connecting wires.
2.2.4 Financial Requirements
Table 2 lays out the financial requirements of the project including the tools
needed.
Table 2. Financial requirements of the project.
Price per unit Total Price
No. Item Quantity
(RM) (RM)
1 Arduino board 24.90 1 24.90
2 LED 0.10 64 6.40
3 Piezo-buzzer 9.90 1 9.90
4 IC SN74HC595N 2.90 1 2.90
5 220 Ohm resistor 0.05 8 0.40
6 9V battery 15.90 1 15.90
7 Conducting wires 5.90 set 5.90
8 Conducting metal rod 1.90 9 17.10
9 Wooden stick 9.90 set 9.90
10 Wood plank 9.90 1 9.90
11 Fastener nails 4.90 set 4.90
12 Multimeter 25.90 1 25.90
13 Soldering iron 20.90 1 20.90
14 Breadboard 4.90 1 4.90
15 Glue gun 10.90 1 10.90
TOTAL (RM) 170.70
10
3.0 EMBODIMENT OF DESIGN
3.1 Layout Drawing
Figure 1 shows the layout drawing of the LED cube 4x4x4.
Figure 1. Exploded view of the project design.
11
Figure 2 shows the layout drawing of the LED cube circuit.
Figure 2. Circuit layout of LED cube.
12
3.2 Engineering Calculation
Determination of resistance for LED:
Readings from multimeter are such that, I = 15 mA, VLED = 1.8 V, and VS = 5 V.
Thus,
𝑉𝑆 = 𝑉𝑅 + 𝑉𝐿𝐸𝐷 ⇒ 𝑉𝑅 = 𝑉𝑆 − 𝑉𝐿𝐸𝐷
𝐼𝑅 = 𝑉𝑆 − 𝑉𝐿𝐸𝐷
𝑉𝑆 − 𝑉𝐿𝐸𝐷 5.0 − 1.8
𝑅= = = 213 Ω
𝐼 0.015
Therefore, in market there is only available a resistor of 220 ohm.
3.3 Engineering Analysis
One main analysis that affects the whole design was the possible number of LEDs
arranged in series. Outcome obtained such that there can only be at maximum two
LEDs arranged in series. With that, an approach taken to optimise the number of
Arduino pins used to accommodate all 64 LEDs.
Figure 3 below shows the layout of the LEDs and wiring arrangement within the
cube. The layout only shows the bottom right part of the cube but the mechanism is
identical for the rest of the part of the cube. The mechanism separates all eight LEDs
into four groups of LEDs in series. Where, each group consists of two LEDs. In each
group, the back-most LED is the anode and thus the front-most LED is the cathode.
Then, all four anodes are connected into parallel, connecting to one of the integrated
circuit pins. Likewise, all four cathodes are met at the ground pin of Arduino board.
The mechanism explained above referring to Figure 3 is one of the eight parallel
circuits connecting to all the eight pins of the integrated circuit, in accommodating all
64 LEDs within the cube.
13
Figure 3. LEDs arrangement layout.
14
Next, the coding is done in the Arduino IDE and it has both the compulsory lines of
codes for the LED display and the tone function to add a music feature to the LED
cube. It is important to note that the graphic display for the LED is essentially
programmed through the functions for the integrated circuit used. Presented below are
the lines of codes:
int DataPin = 2; // Data Pin is connected to Pin No. 2
int ClockPin = 3; // Data Pin is connected to Pin No. 3
int LatchPin = 4; // Data Pin is connected to Pin No. 4
const int pinTreble=12;
const int pinBass=11;
byte Data = 0; // 8 Bit Data to be sent through DataPin
void setup()
{
pinMode(DataPin, OUTPUT); // All 3 pins are output
pinMode(ClockPin, OUTPUT);
pinMode(LatchPin, OUTPUT);
}
void loop()
{
increment(); // LEDs Increament start from 0 - 7
delay(2000);
SOS(); // All LEDs ON and OFF 10 times
OneByOne(); // LEDs Glow one by one from 0 to 7
delay(2000);
// Function defined below-
void shiftWrite(int Pin, boolean State) // Function is similar to digitalWrite
{ // State-0/1 | Pin - Pin No.
bitWrite(Data,Pin,State); // Making Pin(Bit) 0 or 1
shiftOut(DataPin, ClockPin, MSBFIRST, Data); // Data out at DataPin
digitalWrite(LatchPin, HIGH); // Latching Data
digitalWrite(LatchPin, LOW);
}
void increment() //LEDs increment start from 0 - 7
{
int PinNo = 0;
int Delay = 100;
for(PinNo = 0; PinNo < 8; PinNo++)
{
shiftWrite(PinNo, HIGH);
delay(Delay);
}
for(PinNo = 7; PinNo >= 0; PinNo--)
{
shiftWrite(PinNo, LOW);
15
delay(Delay);
}
}
void OneByOne() // LEDs Glow one by one from 0 to 7
{
int PinNo = 0;
int Delay = 100;
for(PinNo = 0; PinNo < 8; PinNo++)
{
shiftWrite(PinNo, HIGH);
delay(Delay);
shiftWrite(PinNo, LOW);
}
for(PinNo = 7; PinNo >=0 ; PinNo--)
{
shiftWrite(PinNo, HIGH);
delay(Delay);
shiftWrite(PinNo, LOW);
}
void AllHigh() // sets all High
{
int PinNo = 0;
for(PinNo = 0; PinNo < 8; PinNo++)
{
shiftWrite(PinNo, HIGH);
}
}
void AllLow() // Sets all low
{
int PinNo = 0;
for(PinNo = 0; PinNo < 8; PinNo++)
{
shiftWrite(PinNo, LOW);
}
}
void SOS(){ // All LEDs ON and OFF 10 times
for (int x=0; x<10; x++){
AllHigh();
delay(100);
AllLow();
delay(100);
}
// music
tone(pinTreble,1319,500); //bar 1
delay(250*1.30);
tone(pinTreble,1245,500);
delay(250*1.30);
tone(pinTreble,1319,500); //bar 2
delay(250*1.30);
tone(pinTreble,1245,500);
delay(250*1.30);
tone(pinTreble,1319,500);
delay(250*1.30);
tone(pinTreble,938,500);
16
delay(250*1.30);
tone(pinTreble,1175,500);
delay(250*1.30);
tone(pinTreble,1047,500);
delay(250*1.30);
tone(pinTreble,880,1000); //bar 3
tone(pinBass,220,500);
delay(250*1.30);
tone(pinBass,330,500);
delay(250*1.30);
tone(pinBass,440,500);
delay(1500*1.30);
tone(pinTreble,523,500);
delay(250*1.30);
tone(pinTreble,659,500);
delay(250*1.30);
tone(pinTreble,880,500);
delay(250*1.30);
tone(pinTreble,988,1000); //bar 4
tone(pinBass,165,500);
delay(250*1.30);
tone(pinBass,330,500);
delay(250*1.30);
tone(pinBass,415,500);
delay(1500*1.30);
tone(pinTreble,659,500);
delay(250*1.30);
tone(pinTreble,831,500);
delay(250*1.30);
tone(pinTreble,938,500);
delay(250*1.30);
tone(pinTreble,1047,1000); //bar 5
tone(pinBass,220,500);
delay(250*1.30);
tone(pinBass,330,500);
delay(250*1.30);
tone(pinBass,440,500);
delay(1500*1.30);
tone(pinTreble,659,500);
delay(250*1.30);
tone(pinTreble,1319,500);
delay(250*1.30);
tone(pinTreble,1245,500);
delay(250*1.30);
tone(pinTreble,1319,500); //bar 6
delay(250*1.30);
tone(pinTreble,1245,500);
delay(250*1.30);
tone(pinTreble,1319,500);
delay(250*1.30);
tone(pinTreble,938,500);
delay(250*1.30);
tone(pinTreble,1175,500);
17
delay(250*1.30);
tone(pinTreble,1047,500);
delay(250*1.30);
tone(pinTreble,880,1000); //bar 7
tone(pinBass,220,500);
delay(250*1.30);
tone(pinBass,330,500);
delay(250*1.30);
tone(pinBass,440,500);
delay(1500*1.30);
tone(pinTreble,523,500);
delay(250*1.30);
tone(pinTreble,659,500);
delay(250*1.30);
tone(pinTreble,880,500);
delay(250*1.30);
tone(pinTreble,988,1000); //bar 8
tone(pinBass,165,500);
delay(250*1.30);
tone(pinBass,330,500);
delay(250*1.30);
tone(pinBass,415,500);
delay(1500*1.30);
tone(pinTreble,659,500);
delay(250*1.30);
tone(pinTreble,1047,500);
delay(250*1.30);
tone(pinTreble,938,500);
delay(250*1.30);
tone(pinTreble,880,1000); //bar 9
tone(pinBass,220,500);
delay(250*1.30);
tone(pinBass,330,500);
delay(250*1.30);
tone(pinBass,440,500);
delay(1500*1.30);
}
18
4.0 PROTOTYPING
4.1 Fabrication Details
The fabrication works start with the wood sticks to construct the framework of the
cube. Figure 4 shows the process of cutting the wood sticks into a measured
dimension for the cube framework construction using a saw knife.
Figure 4. Wood sticks cutting for the cube framework.
Then, the cut wood sticks are glued and combined according to the drawing layout.
Figure 5 shows the process of constructing the basic layer of the cube framework as
per drawing layout by gluing the wood sticks using a glue gun.
Figure 5. Vital layer design of the cube framework.
19
The layer shown above is built for four identical layers. Then, the layers are combined
to the same four perpendicular wood sticks acting as the poles supporting the four
layers to making up the cube. Figure 6 shows the fabrication of the poles with the
layers by gluing them both to making up the cube.
Figure 6. The layers are glued to the four poles of the same dimension but
perpendicular to the layers.
Next, the other fabrication involved is that of the platform supporting the cube. The
platform is built from wood planks and its base is designed to be a bit larger than the
dimension of the cube. The height of the platform is optimised to efficiently provide
enough space to store the electronics that function the cube graphic display. Figure 7
shows the woodwork for the fabrication of the cube platform.
Figure 7. Dimensions of the platform drawn on the wood planks.
20
Figure 8 shows the next process of the woodwork that is the cutting of the wood
planks using the saw.
Figure 8. The cutting of the wood planks for the fabrication of the cube platform.
Next, the wiring and the arrangement of the LEDs are fabricated. The process starts
with soldering two LEDs in a row or in series. Figure 9 shows the soldering of two
LEDs in series.
Figure 9. The soldering of two LEDs in series.
This step is repeated for all 64 LEDs and thus it follows that there are 32 pairs of
LEDs in series. Then, the pairs of series LEDs are glued to the cube according to the
layout of the LED arrangement drawing. Figure 10 shows the assembly of the LEDs
to the cube framework.
21
Figure 10. Assembling the LEDs to the framework of the cube using glue gun.
In the end, the physical product is shown by Figure 11 below. The cube equipped with
LEDs sits atop the platform and the platform comes with an ample space for placing
the electronics components and the Arduino board inside it, below the LED cube.
Figure 11. The finished fabrication of the LED cube and the platform, excluding the
electronics components.
22
4.2 Result
For the result, the coding worked well as it should be when tested on a breadboard at
the outset of the project timeline. The fabrication of the parts of the product was
completed but with a slight flaw, that has cost the whole project progress.
Firstly, to show the progress of the coding and the electronics parts of the project went
smoothly and a success, the least that could be done is to present the circuit running
on the codes but on the breadboard, as the real product turned out to have some
problem that will be discussed later in this part.
Figure 12 below shows the circuit of the LED cube running the codes but on the
breadboard. This is for the reason to show as a proof that the codes are a success and
work well, despite the product (the cube) having some issues.
Figure 12. The codes running the LEDs and the buzzer but on the breadboard.
The mechanism made is such that the Arduino board connects to the integrated
circuit, IC SN74HC595N. Then, the integrated circuit runs the very programme for
the graphic display of the LEDs. Pin 5V of Arduino board is to power the integrated
circuit. Pin 2 of Arduino board is the data pin for the integrated circuit. Pin 3 of
Arduino board is the clock pin for the integrated circuit. Pin 4 of Arduino board is the
23
latch pin for the integrated circuit. The rest of the pins of the integrated circuit are
connected to the LEDs and to the ground pin of Arduino board.
Each of the pins of the integrated circuit connecting to the LEDs is a pin that is
connected to a parallel circuit containing four sets of series LEDs. One set of the
LEDs series contains two LEDs in a series. Therefore, each pin of the integrated
circuit connecting to the LEDs powers eight LEDs.
The very issue that arose was this newfound problem to connect the LEDs terminal
legs with each other and also with the wires connecting to the Arduino board. I tried
both conventional wires and solder to be the conductor to connect the whole circuit,
but there is a limitation in fabricating just that when working at this stage.
The troubleshooting seemed to indicate that all the wiring and connection should have
been done prior to assembling the LEDs to the cube framework.
Subsequently, since the assembly is done and there is no way of undoing it alongside
with the time constraint, so I decided to conclude this project by reporting the
progress and, most importantly, reporting the problem encountered that compromised
the whole project.
24
5.0 CONCLUSION
In conclusion, the project meets the objectives. Firstly, the electronics
knowledge and skills are learnt and acquired in a very practical way. Secondly, the
knowledge and skills of trying out both the Arduino IDE programming software and
the Arduino board are obtained through the hands-on project. Lastly, the desired
engineering design process skills are successfully applied and learnt. In spite of the
problem encountered with the physical product at the later stage of the project, the
actions taken to encounter as much as possible is what matters at the end although not
as much. The project is successful when only taking into account the coding of the
graphic display for the LEDs and the tone function of the piezo-buzzer. The project is
sufficed to be considered partially successful with the fabrication of the physical
product. As stated, the issue was the overlooked trivial but vital steps in planning the
order of different fabrication stages. In particular, the wiring is cumbersome between
LEDs and to the Arduino board. All in all, the project has given the benefit of the
opportunity in designing and devising a product through the engineering approach.
25
APPENDIX
26