` i ABSTRACT The main goal of this project is to design system that can display a twitter in real time. Rather than connecting the display to the computer, this project comes out with a more interesting method, which is to connect the display directly to the twitter server without the need of a computer. This concept require a display and Ethernet Shield – each one of them has their own functions, which consist of Local Area Network (LAN) connection to the internet. Both item are connected together and are connected by the RJ45 Cable to a modem. The display used are LED matrix type and it works as an output of the system which is to display any data received from the twitter server. This project is divided into two parts. The design and construction of a hardware part of this project is carried out by this author, while coding and programming implementation is done by a project partner. In this part, the hardware system is design from the scratch. From the basic of how the single color single LED matrix work principal until the design of a working 64x32 multicolor LED matrix has been carried out. Furthermore, the hardware construction and programming coding of a Clock Shield also has been done. The project for me is a success since the display is fully functional and the clock shield is already up and running. I also successfully connect the Ethernet Shield to the modem and it can now post a message to twitter. However, there are slight problem to display the twitter message since twitter change its API’s a few months ago and most developer is struggling to find a way to connect to the server and grab the data from it.
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
`
i
ABSTRACT
The main goal of this project is to design system that can display a twitter in real
time. Rather than connecting the display to the computer, this project comes out with a
more interesting method, which is to connect the display directly to the twitter server
without the need of a computer. This concept require a display and Ethernet Shield –
each one of them has their own functions, which consist of Local Area Network (LAN)
connection to the internet. Both item are connected together and are connected by the
RJ45 Cable to a modem. The display used are LED matrix type and it works as an
output of the system which is to display any data received from the twitter server.
This project is divided into two parts. The design and construction of a hardware
part of this project is carried out by this author, while coding and programming
implementation is done by a project partner. In this part, the hardware system is design
from the scratch. From the basic of how the single color single LED matrix work
principal until the design of a working 64x32 multicolor LED matrix has been carried
out. Furthermore, the hardware construction and programming coding of a Clock Shield
also has been done.
The project for me is a success since the display is fully functional and the clock
shield is already up and running. I also successfully connect the Ethernet Shield to the
modem and it can now post a message to twitter. However, there are slight problem to
display the twitter message since twitter change its API’s a few months ago and most
developer is struggling to find a way to connect to the server and grab the data from it.
`
ii
ACKNOWLEDGEMENT
First praise is to Allah, the Almighty, on whom ultimately we depend for
substance and guidance. Second, my appreciation goes to my supervisors Mr Mahazani
bin Mohamad, whose guidance careful reading and constructive comments were
valueable. His timely and efficient contribution helped me a lot to shape this into current
form and I’m expressing my sincerest appreciation for his assistance in any way that I
may have asked.
In particular, I would like to thank my working partner, Mohd Ifwat for his
contribution and invaluable support throughout this project.
Last but not least, I would like to thank my parents and family for their
unconditional loves, constantly supporting and encouraging me to work hard on this
project. That my inner strength and their support and encouragement are much valued.
`
iii
Contents
Declaration by the candidate
Abstract
Acknowledgement
List of tables
List of figures
Abbreviation
Chapter 1 Background of the research
1.1 Introduction ……………………………………………………… 1
1.2 Project overview …………………………………………………. 3
1.3 Objectives ………………………………………………………... 5
1.4 Problem statement ……………………………………………….. 6
1.5 Report structure ………………………………………………….. 7
Chapter 2 Introduction to main concept of the project
2.1 Hardware
2.1.1 The Arduino UNO ………………………………… 8
2.1.2 The Ethernet Shield …………………………….... 13
2.1.3 The Clock Shield ………………………………… 16
2.1.4 The LED Matrix Display ………………………… 18
`
iv
2.2 Software
2.2.1 Arduino Programming Language …………….….… 20
2.1.2 Visual Studio 2010 ……………………..……..….... 21
Chapter 3 Hardware implementation
3.1 Design Introduction ……………………….………………….……. 23
3.2 System Overview ………………………………………………....… 23
3.3 System Flowchart ……………………………………………….….. 24
3.4 Hardware Building
3.4.1 LED Matrix ……………………………...………… 25
3.4.2 Clock Shield ………………………………………. 35
Chapter 4 Result and analysis
4.1 Simulation of Operation …………………………………………… 44
Chapter 5 Conclusion and recommendation
5.1 Conclusion ……………………………………………………….… 46
5.2 Recommendation for future work …………………………………. 46
References ………………………………………………………………………. 48
`
v
List of Figures
Figure No. Title Page
1.1 Windows Twitter Layout 2
1.2 Overview of the project 4
2.1 Arduino UNO 9
2.2 Arduino UNO Connection 12
2.3 Ethernet Shield 14
2.4 Ethernet Shield Reset Button 15
2.5 Clock Shield 17
2.6 LED Matrix Display 18
2.7 Arduino Programming Language 21
2.8 Microsoft Visual Studios 2010 22
3.1 Overview of the project 23
3.2 Project Flowchart 24
3.3 LED Matrix 25
3.4 7x5 LED Matrix Schematic 26
3.5 Multiple LED Matrix Schematic 27
3.6 Multiple LED Matrix on Breadboard 28
3.7a Multiple LED Matrix Circuit 29
3.7b Completed Multiple LED Matrix 29
`
vi
3.8 Multiple tricolor LED Matrix Schematic 31
3.9 LED Matrix Pin Connection 33
3.10 Acrylic Design 33
3.11a Top plate Measurement 34
3.11b Bottom plate Measurement 34
3.12 DS1307 RTC Chip 35
3.13 Clock Shield Schematic 39
3.14a Completed Clock Shield - Back 40
3.14b Completed Clock Shield - Front 40
4.1 Completed System 41
4.2a Prototype Display - Top View 42
4.2b Prototype Display - Side View 42
4.2c Prototype Display - Perspective View 42
4.3 Initialization of The System 43
4.4 Date and Time Mode 43
4.5a Attempting Connection 44
4.5b Connection Failed 44
4.6a Display Time Mode 45
4.6b Display Date Mode 45
`
vii
List of Tables
Table No. Title Page
2.1 LED Matrix Pin Function Description 20
3.1 LED Matrix Pin Function Description 32
3.2 DS1307 Pin Function Description 36
`
viii
Abbreviations
PCB Printed Circuit Board
WLAN Wireless Local Area Network
LCD Liquid Crystal Display
DC Direct Current
AC Alternating Current
WI-FI Wireless Fidelity
LAN Local Area Network
USB Universal Serial Bus
`
1
CHAPTER 1
Background of Research
1.1 INTRODUCTION
Twitter is a social networking and microblogging service that allow users to answer
question by sending short text messages 140 characters in length, called “tweets”, to
your friends, or “followers”. There are many methods to send and view the tweets
nowadays. The most common method is using windows apps via computer or using
mobile apps through mobile phone. [1]
Micro-blogging can be defined as simple and quick update. It usually contains a very
limited number of characters, 140 to be exact for twitter. It is a very important feature of
social network nowadays like Facebook where anyone can update their status, but it has
become best known because of twitter.
Twitter is more like a miniature blog or online diaries. It is perfect for people who
don’t want a blog but want to share their thought online. A personal blog let people
around you keep informed on what happen in your life, but not everyone willing to
spend a hefty hours to create a beautiful post about something simple. Sometimes, I just
want to say “She sure look good in that dress. I want to find something similar later”.[2]
`
2
So what is twitter? It is easy to explain twitter as a great place for letting your friends
and family keep updated about what you are up to without the need to spend long time
on creating the entire post of what is happening. You can say anything and leave it at
that. It is a social messaging, event coordinator, business tool, news reporting service
and marketing utility. It is many different things to different people to different usage.
Figure 1.1 Windows Twitter Layout
User
Tweets
Timeline
No of
Tweets
`
3
1.2 PROJECT OVERVIEW
The most important component of the project is the display. Since twitter works
by sending short text messages, the display doesn’t need to be too high in resolution. So,
even a simple LED matrix can be used to display the message. To make the project more
intuitive, arrays of LED matrix are used. Which means, the LED matrix are combined to
make it able to display several characters at the same time. A microcontroller is needed
to control the output of the displays. This microcontroller will work as a “brain” of the
array displays. The microcontroller doesn’t need to be very fast and powerful since it
only needs several bytes of data to be sent to the array of display.
The microcontroller will connect with the router through Ethernet connection. It
will feed the data directly from twitter without any computer. To do this, we have to get
an Ethernet shield since this hardware enable us to directly connect to the internet via
RJ45 cable. By using Ethernet shield, it writes sketches which connect to the internet
using the shield. The Ethernet shield connects to an Arduino board using long wire-wrap
headers which extend through the shield. This keeps the pin layout intact and allows
another shield to be stacked on top.
This thesis project concentrates on designing a display hardware. The wide uses
of twitter nowadays make this project very useful especially to display important tweets.
`
4
Figure 1.2 shows the operation of this project.
Figure 1.2 Overview of the project
This project is divided into two parts, in which the title of the author’s part is
“Hardware Development of Twitter Display”. The other part of this project entitled
“Software Development of Twitter Display”, which was done by the author’s partner.
The concept that the author has applied in this project is quite simple. In this part, LED
matrix act as display, the Ethernet Shield, Arduino UNO and Clock Shield act as the
brain of the system and twitter server is the input of the system. This project requires the
author to create a system, in which the LED matrix should be able to retrieve data from
the combination of Arduino and the Ethernet shields. The LED matrix must display the
feed in real time whenever there are input coming from the twitter server. If there is no
input from Ethernet shield, the UNO will just take the input from clock shield.
LED Matrix
Display
Ethernet
Shield
Arduino
Uno
Clock
Shield
Twitter Server
`
5
1.3 OBJECTIVE
The aim of this project is to get a fully functional display with custom circuit
design that can communicate with twitter server to display twitter status in real time. It
should be capable of receiving necessary data from the twitter server in order to view it
on display panel. Communicating to and from the server will be done using this Ethernet
Shield standard. In theory, by using this hardware, the microcontroller should be able to
load the status from within the twitter server.
The program that will be loaded to the microcontroller will have to be able to
work with the Ethernet shield and retrieve the data in real time. All the hardware should
work together without the need of any human operating the device.
The main objective of this project is to design a display module for a twitter message. A
few secondary objectives are as follow:
i) Connect to the twitter without the need of any computer
ii) Use a Arduino UNO to program the task of a controller
iii) Setting clock and date using Clock Shield
`
6
1.4 PROBLEM STATEMENT
The increasing numbers of people who use twitter as their social network service
keep increasing from day to day. This make twitter as one of the most popular social
network platform as of today. The popularity of twitter is achievable because more and
more peoples are become aware of their services. One of the reasons why twitter is so
popular compared to other social network service is its simplicity.
Twitter doesn’t have crowded and complicated interface. Twitter also doesn’t
need lots of personal information to get started. One email account is all its need before
we can start tweeting. The simple user interface make people tend to choose it and the
ability to update status in almost an instance become the added bonus for this great
software.
Because of this, we planned to make a display panel that can display specific
twitter to a specific group of people. By doing that, important information can be spread
in a mere seconds especially in a closed environment community. Instead of using the
application in windows or mac desktop/pc, we choose a different approach for this
project which is to display the status directly from twitter server to the microcontroller
and to the display panel. This concept saves a lot of cost since the most basic PC will
cost at least Rm1000 and also the power consumption for the PC is enormous, let alone a
very effective cooling system is needed to power up a PC around a clock.
`
7
1.5 REPORT STRUCTURE
There are 5 chapters in this report, with respective subtopics. Each chapter is described
as follows:
Chapter 1 provides the introduction of Twitter, project overview, problem
statement and report structure. The objectives of this project are also stated in this
chapter. Several steps have been done in order to meet the objective of this project
Chapter 2 provides a review about the important concept used in this project.
The topic covers the study on the details of one of the core concepts used in this project
which is the display. Furthermore, other studies that are related to this project are also
described including the time shield, C# Programming Language and also Arduino
Programming Language.
Chapter 3 represents the methodology of project conducted. The methodology
written in this report described five stages, on how this project is conducted. An
overview of hardware and software implementation also explained in this chapter. The
design and making of the project is explained in details. In addition, deep explanation on
constructing the clock shield with LCD display are done, including how to construct the
circuit board and the programming.
Chapter 4 elaborates the results and analysis obtained from the project.
Chapter 5 will conclude the whole project and thus provide the problems
encountered by the devices, the solutions and also the conclusion of this project
`
8
CHAPTER 2
Introduction to Main Concepts of Projects
Wide coverage of internet connection today lead humans to a new way of
interacting with peoples using a social media. The number of people using this
application keeps growing as the time goes by. Majority of people prefer to use this
method compared to conventional method of socializing is mainly because they can still
interact and socialize with other people from the comfort seat of their couch at home
without the need to go out at all.
Design a twitter based application is a unique and difficult challenge. In the old
days, people just use a computer to connect to the internet. This is because computer is
the most user friendly interface that can help user to interact with any kind of program
easily. However, this project is about displaying a twitter status update without any
means of connecting it to a computer. The only thing controlling the whole circuits is the
Arduino UNO
`
9
2.1 Hardware
2.1.1 The Arduino UNO
The Arduino UNO is a microcontroller board based on the ATmega328. It has 14
digital input/output pins (of which 6 can be used as PWM outputs), 6 analog inputs, a 16
MHz crystal oscillator, a USB connection, a power jack, an ICSP header, and a reset
button. It contains everything needed to support the microcontroller; simply connect it to
a computer with a USB cable or power it with a AC-to-DC adapter or battery to get
started.
The UNO differs from all preceding boards in that it does not use the FTDI USB-
to-serial driver chip. Instead, it features the Atmega16U2 (Atmega8U2 up to version R2)
programmed as a USB-to-serial converter.
Figure 2.1 Arduino Uno
`
10
"UNO" means one in Italian and is named to mark the upcoming release of
Arduino 1.0. The UNO and version 1.0 will be the reference versions of Arduino,
moving forward. The UNO is the latest in a series of USB Arduino boards, and the
reference model for the Arduino platform. [3]
Summary
Microcontroller ATmega328
Operating Voltage 5V
Input Voltage
(recommended) 7-12V
Input Voltage (limits) 6-20V
Digital I/O Pins 14 (of which 6 provide PWM output)
Analog Input Pins 6
DC Current per I/O Pin 40 mA
DC Current for 3.3V Pin 50 mA
Flash Memory 32 KB (ATmega328) of which 0.5 KB used by
bootloader
SRAM 2 KB (ATmega328)
EEPROM 1 KB (ATmega328)
Clock Speed 16 MHz
As our project require us to communicate and handle data transfer between the
Ethernet Shield, Clock Shield and LED matrix display, we have decided to use Arduino
UNO as the brain for the system. This Arduino make the programming command for
hardware to be systematic and easier because this Arduino basically control everything
that are connected to its pin.
`
11
The Arduino UNO is used for connecting the Ethernet Shield, Clock Shield and
LED matrix display together and since the data coming from the Ethernet shield is not in
a language that the display can understand, Arduino will acts as translator which will
translate the data into something the display can understand. This will enable the display
to convert the digital data into the pattern of display that can easily be seen by human.
Each of the 14 digital pins on the UNO can be used as an input or output, using
pinMode(), digitalWrite(), and digitalRead() functions. They operate at 5 volts. Each pin
can provide or receive a maximum of 40 mA and has an internal pull-up resistor
(disconnected by default) of 20-50 kOhms. In addition, some pins have specialized
functions:
Serial: 0 (RX) and 1 (TX). Used to receive (RX) and transmit (TX) TTL serial
data. These pins are connected to the corresponding pins of the ATmega8U2
USB-to-TTL Serial chip.
External Interrupts: 2 and 3. These pins can be configured to trigger an
interrupt on a low value, a rising or falling edge, or a change in value. See the
attachInterrupt() function for details.
PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the analogWrite()
function.
SPI: 10 (SS), 11 (MOSI), 12 (MISO), 13 (SCK). These pins support SPI
communication using the SPI library.
LED: 13. There is a built-in LED connected to digital pin 13. When the pin is
HIGH value, the LED is on, when the pin is LOW, it's off.
The UNO has 6 analog inputs, labeled A0 through A5, each of which provide 10 bits
of resolution (i.e. 1024 different values). By default they measure from ground to 5