Professional Documents
Culture Documents
Diamond The Ultimate Semiconductor
Diamond The Ultimate Semiconductor
CHAPTER 1: INTRODUCTION
The Bluetooth based notice board also called Digital Display System (DDS) is
aimed at the supermarkets, restaurants, cafes, colleges and universities for displaying
day-to-day information continuously or at regular intervals during the working hours.
Being Bluetooth-based system, it offers flexibility to display flash news or
announcements. Bluetooth-based digital display system can also be used at other public
places like schools, hospitals, railway stations, gardens etc. without affecting the
surrounding environment.
The DDS mainly consists of a Bluetooth receiver and a display toolkit which can
be programmed from an authorized mobile phone. It receives the message, validates the
sending Mobile pairing with Bluetooth module and displays the desired information after
necessary code conversion. It can serve as an electronic notice board and display the
important notices instantaneously thus avoiding the latency. Being wireless, the Bluetooth
based DDS is easy to expand and allows the user to add more display units at any time
and at any location in the campus depending on the requirement.
1.3.1 Microcontroller
1.3.2 LCD
The Bluetooth based DDS uses JHD 16*2A LCD for displaying the text data. It is
16character x 2 line display module. But in practice, it should be replaced by the large
multiline, multicolor commercial display units.
Finally, this project uses FTI serial interface for interfacing the arduino with a PC.
This interface is used to setup the Bluetooth module and arduino. A hyper terminal
application is used to issue AT commands to the Bluetooth module.
The operation of the system is very simple. Sending message from any of the
Arduino based mobile phone to the distant located notice board using Bluetooth
module. For sending the text message from android phone we need to interface the
mobile phone with Bluetooth module. For developing some of Bluetooth based
applications we need to have some commons peripherals including Bluetooth module,
microcontroller, LCD (Liquid crystal display), power supply and also some connecting
wires.
From Fig 2.1, there are at least three interfacing circuits, Bluetooth module,
Arduino-uno with Microcontroller and LCD display. It is not a hidden fact that
interfacing a module with a normal PC is quite easy with the help of the AT commands
sent to it from the Hyper Terminal window. But we must take into account the fact that
the module requires a wired connection at one end and wireless at the other. Dedicating a
general purpose computer at each and every site of the display boards, although makes
the task a lot easier but is too expensive to be a possibility.
This circuit uses Arduino board that accepts via HC-05 Bluetooth module from
various types of gadgets like Android based smart phones. Arduino is the heart of this
programmable display. The Power supply is applied through the USB port to drive
Arduino and LCD display. In this application the Bluetooth module acts as both
transmitter and receiver, and is compatible with most smart phones. Different port pins of
Arduino are used to drive the 16x2 LCD as shown in the circuit.
denotes that the module is not paired with other device. When this module is connected
to/ paired with other Bluetooth device, the signal goes high. At this high state, the led
blinks with a constant delay say for example 2s delay which indicates that the module is
paired.
BUTTON SWITCH:
This is used to switch the module into AT command mode. To enable AT
command mode, press the button switch for a second. With the help of AT commands,
the user can change the parameters of this module but only when the module is not paired
with any other Bluetooth device. If the module is connected to any other Bluetooth
device, it starts to communicate with that device and fails to work in AT command mode.
One of the most common devices attached to an Arduino is an LCD display. Some
of the most common LCDs connected to the Atmega328 are 16x2 and 20x2 displays.
This means 16 characters per line by 2 lines and 20 characters per line by 2 lines,
respectively. In recent years the LCD is finding widespread use replacing LED‟s.
This is due to the following reasons:
1. Declining prices.
2. Ability to display numbers, characters and graphics.
3. Incorporation of a refreshing controller into the LCD.
4. Ease of programming.
The EN line is called "Enable." This control line is used to tell the LCD that you
are sending it data. To send data to the LCD, your program should make sure this line is
low (0) and then set the other two control lines and/or put data on the data bus. When the
other lines are completely ready, bring EN high (1) and wait for the minimum amount of
time required by the LCD datasheet (this varies from LCD to LCD), and end by bringing
it low (0) again.
The RS line is the "Register Select" line. When RS is low (0), the data is to be
treated as a command or special instruction (such as clear screen, position cursor, etc.).
When RS is high (1), the data being sent is text data which should be displayed on the
screen. For example, to display the letter "T" on the screen you would set RS high.
The RW line is the "Read/Write" control line. When RW is low (0), the
information on the data bus is being written to the LCD. When RW is high (1), the
program is effectively querying (or reading) the LCD. Only one instruction ("Get LCD
status") is a read command. All others are write commands--so RW will almost always be
low. Finally, the data bus consists of 4 or 8 lines (depending on the mode of operation
selected by the user). In the case of an 8-bit data bus, the lines are referred to as DB0,
DB1, DB2, DB3, DB4, DB5, DB6, and DB7.
The LCD panel's Enable and Register Select is connected to the Control Port. The
Control Port is an open collector / open drain output. While most Parallel Ports have
internal pull-up resistors, there is a few which don't. Therefore by incorporating the two
10K external pull up resistors, the circuit is more 18 portable for a wider range of
computers, some of which may have no internal pull up resistors.
We make no effort to place the Data bus into reverse direction. Therefore we hard
wire the R/W line of the LCD panel, into write mode. This will cause no bus conflicts on
the data lines. As a result we cannot read back the LCD Internal busy flag is noticed if
the LCD has accepted and finished processing the last instruction. This problem is
Overcome by inserting known delays into our program.
The 10k Potentiometer controls the contrast of the LCD panel. Nothing fancy
here. As with all the examples, I've left the power supply out. You can use a bench power
supply set to 5V or use a onboard +5 regulator. Remember a few de-coupling capacitors,
especially if you have trouble with the circuit working properly.
3.2.1 Applications
3.2.2 Features
The Atmega328 is one of the microcontroller chips that are used with the popular
Arduino Duemilanove boards. The Arduino Duemilanove board comes with either 1 of 2
microcontroller chips, the Atmega168 or the Atmega328. Of these 2, the Atmega328 is
the upgraded, more advanced chip. Unlike the Atmega168 which has 16K of flash
program memory and 512 bytes of internal SRAM, the Atmega328 has 32K of flash
program memory and 2K of Internal SRAM.
The Atmega328 has 28 pins, It has 14 digital I/O pins, of which 6 can be used as
PWM outputs and 6 analog input pins. These I/O pins account for 20 of the pins.
As stated before, 20 of the pins function as I/O ports. This means they can
function as an input to the circuit or as output. Whether they are input or output is set in
the software. 14 of the pins are digital pins, of which 6 can function to give PWM output.
6 of the pins are for analog input/output. Two of the pins are for the crystal oscillator,
this is to provide a clock pulse for the Atmega chip. A clock pulse is needed for
synchronization so that communication can occur in synchrony between the Atmega chip
and a device that it is connected to.
The Atmega328 chip has an analog-to-digital converter (ADC) inside of it. This
must be or else the Atmega328 wouldn't be capable of interpreting analog signals.
Because there is an ADC, the chip can interpret analog input, which is why the chip has 6
pins for analog input. The ADC has 3 pins set aside for it to function- AVCC, AREF, and
GND. AVCC is the power supply, positive voltage, that for the ADC. The ADC needs its
own power supply in order to work. GND is the power supply ground. AREF is the
reference voltage that the ADC uses to convert an analog signal to its corresponding
digital value. Analog voltages higher than the reference voltage will be assigned to a
digital value of 1, while analog voltages below the reference voltage will be assigned the
digital value of 0. Since the ADC for the Atmega328 is a 10-bit ADC, meaning it
produces a 10-bit digital value, it converts an analog signal to its digital value, with the
AREF value being a reference for which digital values are high or low. Thus, a portrait of
an analog signal is shown by this digital value; thus, it is its digital correspondent value.
The last pin is the RESET pin. This allows a program to be rerun and start over. And this
sums up the pin out of an Atmega328 chip.
3.4 ARCHITECTURE
The Arduino has 8bit of resolution, when outputting a signal using PWM.
The range of output voltage is from 0 to 5 Volts.
28=255 Increments
Average of on/off(digital signals to make an average voltage),Duty cycle in 100%
of 5Volts.
3. 8 LANGUAGE REFERENCES:
3.8.2 Wiring
artists, designers, researchers, and hobbyists who use Wiring for learning, prototyping,
and finished professional work production.
3.9.1 Processing
3.10.1 Embedded C
Though C and embedded C appear different and are used in different contexts,
they have more similarities than the differences. Most of the constructs are same; the
difference lies in their applications.
must fit into the available program memory. If code exceeds the limit, the system is likely
to crash.
Embedded systems often have the real-time constraints, which is usually not
there with desktop computer applications.
Here by developing the programs as per the electronic hardware using Atmel
Atmega328 micro controller. For the operations like: blink led, increment decrement
counters, token displays etc.
embedded system might not have a complete standard library, if there is a standard
library at all. Few embedded systems have capability for dynamic linking, so if standard
library functions are to be available at all, they often need to be directly linked into the
executable. Oftentimes, because of space concerns, it is not possible to link in an entire
library file, and programmers are often forced to "brew their own" standard c library
implementations if they want to use them at all. While some libraries are bulky and not
well suited for use on microcontrollers, many development systems still include the
standard libraries which are the most common for C programmers.
3.10.3 Software
The software used by the arduino is Arduino IDE. The Arduino IDE is a cross-
platform application written in Java, and is derived from the IDE for the Processing
programming language and the Wiring project. It is designed to introduce programming
to artists and other newcomers unfamiliar with software development. It includes a code
editor with features such as syntax highlighting, brace matching, and automatic
indentation, and is also capable of compiling and uploading programs to the board with a
single click. There is typically no need to edit make files or run programs on a command-
line interface. Although building on command-line is possible if required with some
third-party tools such as Ino.
The Arduino IDE comes with a C/C++ library called "Wiring" (from the project
of the same name), which makes many common input/output operations much easier.
Arduino programs are written in C/C++, although users only need define two functions to
make a runnable program:
setup() – a function run once at the start of a program that can initialize settings
loop() – a function called repeatedly until the board powers off
A typical first program for a microcontroller simply blinks a LED on and off. In
the Arduino environment, the user might write a program like this:
#define LED_PIN 13
void setup (){
pinMode(LED_PIN, OUTPUT);// enable pin 13 for digital output
}
void loop (){
digitalWrite(LED_PIN, HIGH);// turn on the LED
delay(1000);// wait one second (1000 milliseconds)
For the above code to work correctly, the positive side of the LED must be
connected to pin 13 and the negative side of the LED must be connected to ground. The
above code would not be seen by a standard C++ compiler as a valid program, so when
the user clicks the "Upload to I/O board" button in the IDE, a copy of the code is written
to a temporary file with an extra include header at the top and a very simple main()
function at the bottom, to make it a valid C++ program.
The Arduino IDE uses the GNU tool chain and AVR Libc to compile programs,
and uses AVR dude to upload programs to the board.
PROGRAM COMPILING
SELECTING BOARD
SELECTING PORT
UPLOADING PROGRAM
Arduino programs can be divided in three main parts: structure, values (variables
and constants), and functions.
void
boolean
char ( 0 – 255)
float
double
String - object
array
3.11 AT COMMANDS.
The Hayes subset commands are called the basic commands and the commands
specific to a Bluetooth network are called extended AT commands.
1) AT - This command is used to check communication between the module and the
computer.
For example, AT OK
The command returns a result code OK if the computer (serial port) and module
are connected properly. If any of module or SIM is not working, it would return a result
code
ERROR.
2) +CMGF - This command are used to set the SMS mode. Either text or PDU mode can
be selected by assigning 1 or 0 in the command.
SYNTAX: AT+CMGF=<mode>
0: for PDU mode
1: for text mode
The text mode of SMS is easier to operate but it allows limited features of SMS.
The PDU (protocol data unit) allows more access to SMS services but the operator
requires bit level knowledge of TPDUs. The headers and body of SMS are accessed in
hex format in PDU mode so it allows availing more features.
For example,
AT+CMGF=1
OK
As one types AT+CMGW and phone number, „>‟ sign appears on next line where
one can type the message. Multiple line messages can be typed in this case. This is why
the message is terminated by providing a „Ctrl+z‟ combination. As Ctrl+z is pressed, the
following information response is displayed on the screen.+CMGW: Number on which
message has been stored
As the command AT+CMGS and serial number of message are entered, SMS is
sent to the particular SIM.
For example,
AT+CMGS=1
OK
7) ATH - This command is used to disconnect remote user link with the GSM module.
The AT commands for both, bluetooth module and the mobile phone, are
listed below. Some of these commands may not be supported by all the bluetooth
modules available. Also there might be some commands which won’t be
supported by some mobile handsets.
CALL CONTROL
Command Description
ATA Answer command
ATD Dial command
ATH Hang up call
ATL Monitor speaker mode
ATM Monitor speaker mode
ATO Go on-line
ATP Set pulse dial as default
ATT Set tone dial as default
AT+CSTA Select type of address
AT+CRC Cellular result codes
PHONE CONTROL
Command Description
AT+CBC Battery Charge
AT+CGMI Request manufacturer
identification
AT+CGMM Request model identification
AT+CGMR Request revision identification
AT+CGSN Request product serial number
identification
AT+CMEE Report mobile equipment error
AT+CPAS Phone activity status
AT+CPBF Find phone book entries
AT+CPBR Read phone book entries
AT+CPBS Select phone book memory storage
AT+CPBW Write phone book entry
AT+CSCS Select TE character set
AT+CSQ Signal quality
Command Description
ATE Command Echo
ATQ Result code suppression
ATV Define response format
ATX Response range selection
AT&C Define DCD usage
AT&D Define DTR usage
AT&K Select flow control
AT&Q Define communications mode
option
AT&S Define DSR option
AT+ICF DTE-DCE character framing
AT+IFC DTE-DCE Local flow control
AT+IPR Fixed DTE rate
SERVICE
Command Description
AT+CLIP Calling line identification
presentation
AT+CR Service reporting control
ATV+DR Data compression reporting
Command Description
ATB Communications standard option
AT+CBST Select bearer service type
AT+CEER Extended error report
AT+CRLP Radio link protocol
AT+DS Data compression
MISCEELANEOUS
Command Description
AT/ Re-execute command line
AT? Command help
AT*C Start SMS interpreter
AT*T Enter
AT*V Activate V.25bis mode
AT*NOKIA TEST Test command
AT+CESP Enter SMS block mode protocol
Command Description
AT+CSMS Select message service
AT+CPMS Preferred message storage
AT+CMGF Message format
AT+CSCA Service center address
AT+CSMP Set text mode parameters
AT+CSDH Show text mode parameters
Mobile phone
Bluetooth module
Arduino with Atmel Atmega328 microcontroller
LCD display
First block portrays to be Bluetooth which receives, verifies and forwards the
message to the Microcontroller. Micro is the second block. Micro processes the message
and sends to the LCD. LCD behaving as the third constituent part displays the message
until it is invoked by micro to display a new message.
4.2 DATA FLOW DIAGRAM
Fig 5.1 is the quite simple schematic. The LCD panel’s Enable and Register Select
is connected to the Control Port. The Control Port is an open collector / open drain
output. While most Parallel Ports have internal pull‐up resistors, there is a few which
don’t. Therefore by incorporating the two 10K external pull up resistors, the circuit is
more portable for a wider range of computers, some of which may have no internal pull
up resistors.
There no effort to place the Data bus into reverse direction. Therefore we hard wire
the R/W line of the LCD panel, into write mode. This will cause no bus conflicts on the
data lines. As a result we cannot read back the LCD‟s internal Busy Flag which tells us if
the LCD has accepted and finished processing the last instruction. This problem is
overcome by inserting known delays into our program. The 10k Potentiometer controls
the contrast of the LCD panel. Nothing fancy here. The user may select whether the LCD
is to operate with a 4‐bit data bus or an 8‐ bit data bus. If a 4‐bit data bus is used, the
LCD will require a total of 7 data lines.
If an 8‐bit data bus is used, the LCD will require a total of 11 data lines. The three
controls lines are EN, RS, and RW. Note that the EN line must be raised / lowered
before/after each instruction sent to the LCD regardless of whether that instruction is read
or write text or instruction. In short, you must always manipulate EN when
communicating with the LCD. EN is the LCD‟s way of knowing that you are talking to
it. If you don’t raise/lower EN, the LCD doesn’t know you’re talking to it on the other
lines.
5.2.1 Overview
5.2.2 Proposal
It is proposed to place display boards at major access points. But, The Bluetooth
based display toolkit can be used as an add-on to these display boards and make it truly
wireless. The display board programs itself with the help of the incoming message with
proper validation. The centralized system can be placed as the Computer Center for
access by any other valid users with authentications. Message from these users is treated
to be valid and is displayed. Other messages from any other mobile phone is discarded.
Thus information from valid sources can be sent easily. Such a system proves to be
helpful for immediate information transfer and can be easily implemented.
CHAPTER 6: TESTING
6.1 INITIALIZATION
The baud rate of the module was set to be 9600 bps using the command
AT+IPR=9600.The ECHO from the module was turned off using the command
ATE/ATE0 at the hyper terminal. For serial transmission and reception to be possible
both the DTE and DCE should have same operational baud rates.
After setting the baud rates of the two devices both the devices are now ready to
transmit and receive data in form of characters. Transmission is done when Tx flag is set
and similarly data is known to be received when the Rx flag is set. The microcontroller
then sends an AT command to the module in form of string of characters serially just
when the Tx flag is set. After reception of a character in the SBUF register of the
microcontroller (response of module with the read message in its default format or
ERROR message or OK message), the Rx flag is set and the received character is moved
into the physical memory of the microcontroller.
6.4 RESULTS
Snapshots
1. Welcome Note
Figure 6.1a: Snapshot of the System
7.1 ADVANTAGES
As it's a Bluetooth wireless transmission system it has very less errors and needs
less maintenance
Prevents unauthorized access of notice board (password for Bluetooth module).
Multiple Users are authorized to update notices on the electronic notice board.
No printing and photocopying costs. Thus saves time, Energy and finally
environment.
7.2 DISADVANTAGE
It is applicable only for shorter distances around 100 meters range.
7.3 APPLICATIONS
Advertisement Conference hall.
Bus/Railway station.
Any Public utility places.
Educational institutions.
CONCLUSION
The prototype of the Bluetooth based display toolkit was efficiently designed.
This prototype has facilities to be integrated with a display board thus making it truly
mobile. The toolkit accepts the message, stores it, validates it and then displays it in the
LCD module. We intend to extend this work to provide a keypad programmed to allow
manipulation of the characters displayed on the screen. This future work will also explore
to the use of a bigger LCD with suitable hardware to manipulate and display graphics in
addition to the characters.
FUTURE SCOPE
The use of Atmel Atmega328 microcontroller in place of a general purpose
computer allows us to theorize on many further improvements on this project prototype.
Temperature display during periods wherein no message buffers are empty is one such
theoretical improvement that is very possible. The ideal state of the microcontroller is
when the indices or storage space in the Bluetooth memory are empty and no new
message is there to display. With proper use of interrupt routines the incoming message
acts as an interrupt, the temperature display is halted and the control flow jumps over to
the specific interrupt service routine which first pairs the user’s mobile phone Bluetooth
with Bluetooth module and then displays the information field. Another very interesting
and significant improvement would be to accommodate multiple receiver modules at the
different positions in a geographical area. After a display board receives the valid
message through the module and displays it, it withdraws its identification from the
network & synchronously another nearby module signs itself into the network and starts
to receive the message. The message is broadcast by the mobile switching center for a
continuous time period during which as many possible display board modules “catch” the
message and display it as per the constraint of validation.
Multilingual display can be another added variation of the project. The display
boards are one of the single most important media for information transfer to the
maximum number of end users. This feature can be added by programming the
microcontroller to use different encoding decoding schemes in different areas as per
local language. This will ensure the increase in the number of informed users. Graphical
display can also be considered as a long term but achievable and target able output.
REFERENCES
2. M. Banzi, Getting started with arduino. " O'Reilly Media, Inc.", 2009
3. Arduino, "Arduino uno." Last visited on 06/09/2014
4. A. M. Gibb, New media art, design, and the Arduino microcontroller: A
malleable tool. PhD thesis, Pratt Institute, 2010
5. M. Margolis, Arduino cookbook. " O'Reilly Media, Inc.", 2011
6. D. Mellis, M. Banzi, D. Cuartielles, and T. Igoe, "Arduino: An open electronic
prototyping platform, " in Proc. CHI, vol. 2007, 2007
7. Shahrzad Tadjpour "A 900MHz Dual Conversion, Low-IF CMOS GSM
Receiver" Department of Electrical Engineering University of California 2001
8. Theodore S. Rappaport "Wireless Communications: Principles & Practice"
Prentice Hall PTR, 1996
9. http://electronicsforu.com/electronics-projects/hardware-diy/arduino-lcd-using-
bluetooth-module
10. H. Khalid, “Microcontroller Based LCD Display system”,
http://www.researchgate.net/.
11. https://static.secure.website/wscfus/5655211/4550650/v8n1-2p8-2015-ajocict-
prototyping-of-an-arduino-micro-controlled-digital-display-system.pdf
APPENDIX - A
#include <LiquidCrystal.h>
LiquidCrystal lcd(12,11,5,4,3,2);
String inData;
void setup(){
Serial.begin(9600);
lcd.begin(16,2);
lcd.print("Welcome!");
delay(3000);
lcd.clear();
}
void loop(){
int i=0;
char commandbuffer[100];
if(Serial.available()){
delay(100);
while(Serial.available()&&i<99){
commandbuffer[i++]=Serial.read();
}
commandbuffer[i++]='\0';
}
if(i>0)
Serial.println((char*)commandbuffer);
lcd.print((char*)commandbuffer);
delay(100);
lcd.clear();
}