Introduction: SMS to Moving Message Display With an AT89C52
This is a classic 40 columns moving message display enhanced to incorporte a SIM300Z GSM modem so that the message can be communicated using SMS.
This can be quite useful e.g. installed at backside of a classroom the principal can commnicate with the teacher without disturbing the class. I know you are quite intelligent and will find even better uses.
[I sure hope my display goes viral on the web :-).]
The photo (that I created using MS paint) is just a representative of the final look of the thing because I did not take any photos or videos of the project at the time I built it.
Because the message enters the the controller (AT89C52) using the built in asynchronous serial port so it can come from any source off course including the SIM300Z.
First of all the design is to be entered in some schematic capture program. Although I directly built this one (i.e. without any schematiccapture) I usually use ORCAD10 capture for the purpose and have especially made a schematic for this instructable.
The things required to build this project are,
- Two large vero / strip boards for the assymbly of the circuit
- An AT89C52 (infact any µ-controller with enough IO lines and a serial port) as the main computer note: AT89x51 will not work because message memory is the idata which is only present in the 52 devices
- One serial EPROM AT93C46B to hold the number from which we recieve the SMS
- One SIM300Z or copmatible TTL GSM Modem.
- A programmer for the AT89C52
- 7 Nos. ULN2803 buffer IC to drive the rows and columns of the display.
- 6 Nos of (2SA683) PNP transistors to drive the rows
- 8 Nos 5 × 7 (cathode column) or 5 nos 8 × 8 LED matrix displays giving us the 40 columns.
- One 7805 regulator for the µController
- I gave the GSM modem its own battery so a regular mobile phone battery will be needed too.
- Soldering equipment
- A PC with a serial or USB port (to configure the MODEM)
- The list goes on ............ ;-)
Step 1: The Hardware Circuit Schematic
I built the circuit directly from my own mind. Don't worry I creadted a schematic afterwards just for this instructable.
It should be downloadable at this step. both in jpg format and pdf format.
Step 2: The Program
Well I made the choice of the AT89C52 because it is cheap and it has a built-in RS232 compatible UART. The GSM modem here used (the SIM300Z) communicates through a standard serial port.
My Algorithm required a master number to send the SMSs so that unauthenticated use of the display can somewhat be proteced.
The program has been written in the C51 language using a KEIL µVision2 IDE.
a follower of the instructable was unable to compile using three files so I have attached the Keil µvision2 project directory as a zip file too.
There are a total of 3 files:
I have delibrately not included the hex / bin file beacuse then where is the fun? Besides hex files can't be modified.
All the files are maximum documented inside so open them and try to make some sense out of the embedded comments.
- MOVING_MESSAGE-1 (1-on).c
This file has the main code i.e. the actual algorithm that manages full functionality of the display.
This file holds the lookup table for converting ASCII characters in the message to LED display fonts
This file implements a general purpose code for interfacing with the AT93C46B EEPROM.
Step 3: GSM MODEM Configuration
The GSM modem needs to be preconfigured for using with the display. This involves sending a few AT commands to it. Besides it provides an oppertunity to play with the modem and learn the AT commands for it. This also provides a quick check if the modem is working correctly. Here is how it will go.
Connect the modem to PC. using a USB to TTL or Serial to TTL gadget commonly available for arduino.
Power it up.
Send at least the following AT commands to it using a terminal software. (I use Hyperterminal)
- [AT+IPR=9600] set the communication baud rate to 9600bps to match with our µC.
- [AT+CMGF=1] for setting the message format to text (default is binary)
- [AT+CNMI=1,1,0,0] for making it send all recieved SMS directly to the serial port (by default it stores them and only alerts)
- [ATE0] Sets serial port echo to OFF(default is ON) so it disturbs us only when a message or call comes in.
- [AT&W] Write down this configuration pemanently.
There is huge amounts of information on the WEB about the AT commands. Do not hesitate in learning.
Hyperterminal is no more provided with the Microsoft® WindowsTM OS. I have another instructable showing you how to get it.
Step 4: PROTEUS SIMULATION
At last I got a follower and he was unable to get the project up and running.
Since I had not the hardware I decided to simulate it using Proteus8 that I had lying around in my PC
The schematic in Proteus is not exactly the same but is equivalent. This is because Proteus 8 does not provide displays with ROW anode so I had to invert the driver logic. moreover proteus does not simulate ULN2803 using other than power connections for Pin 9 (GND) so they had to be replaced with 74LS244 buffers.
I converted the The proteus 8 folder into a zip file which is attached here.
enjoy simulating.any changes you make to the code.
used the DEBUG TAB on the main tool bar to show the terminal window
Type Exactly following
+CMT: "+923212345678" CRLF = (PLUS)(CAP-C)(CAP-M)(CAP-T)(COLON)(SPACE)(Qoutation)(PLUS)( 12-digits)(Qoutation)(Enter-Key)(Right-ALT+Numpad)
The Scrolling Display Should Pause
Now type any Message not starting with $ sign and press CRLF i.e.(Enter-Key)(Right-ALT+Numpad)
Your Message will start scrolling on the display
The message can be 108 characters long.
I have given two screenshots one when power on and other with scrolling "HELLO WORLD"
A Message that Starts with a $ symbol will create a Master number as explained in the next step.
Step 5: Usage of the Gadget
Build the hardware. (It took me a nighter) (the coding took 2 days and 2 nighters) and writing this instructable has taken even longer (guess I am becoming old ;-))
Build the hex or bin file using the three provided .C files (you'll need a keil IDE or similar software tool) or use the hex file in the provided Proteus folder.
Program an AT89C52 or compatible microcontroller
Check and double check power connections of the board. (Wrong connections can damage any thing)
Plug in the preconfigured GSM modem on board
Plug in the microcontroller keep the DEFAULTS jumper inserted and Power up.
Now remove the DEFAULTS jumper.
A moving Message saying "WAITING FOR A MESSAGE FROM " ANY NUMBER " should appear.
Try sending some text messages of your own. If the modem was properly configured the messages will show on the display.
to set a master number type a message like $+923211234567 and send it to the SIM inserted in the GSM MODEM. Make sure the number is 13 digit long including the + sign. if your country uses a different length you will need to modify the code (thats why i gave you the code). once a master number has been properly set messages coming only from it will go on display and all others will be discarded.
Anyhow you may never like to set a master and any one knowing the number in the GSM modem may be allowed to send a message. This can be achieved using the DEFAULTS jumper or no or a new EEPROM IC.
We have a be nice policy.
Please be positive and constructive.