sábado, 24 de enero de 2009

SMS REMOTE CONTROLLERWho has not wanted to arrive at home and immediately turn on the heating system
-- or know that the alarm of your car that is parked two blocks away is on and
working?.
I created this gadget because I needed a remote way to control a water pump that
it is 500 meters from my house. Thanks to the GSM technology, inexpensive
cellular telephones and the SMS (short message service) messages, it is now
possible to build a gadget that fills these needs. Using the serial port incorporated
in the mobile telephones. it is possible to design an SMS remote controller
systems.
The SMS remote controller allows you to send a short SMS message that can turn
on or to turn off an electric device such as watering pump, vending machines or
whatever. The system has two inputs. When they are active, a message it is sent
describing which the device is on or off.
Using the SMS, you can interrogate the system, which will immediately forward
an SMS reply with the state of the device you are querying. The SMS alert and
confirmation are sent by the G7 which is stored directly in the memory of the
cellular phone. You can build this system and connect it to your car or home
alarm - or any other device - to ascertain the status of the device and change that
status if necessary.
Specifications:
.
It has two input Z1 and Z2. The Z1 input is active when it is applied a trigger
pulse or a constant level of continuous tension between 6V and 15V, and the Z2
input it is activated when the open normal contact of a sensor close down.
An output for relay of 220 V / 5 A.
Main power source through a current adapter between 9V at 12V DC / 500mA.
This incorporate battery charger for the telephone.
A 9V backup battery in case to fail the main power source.
Does not lose programming on complete DC or battery failure.
Led to indicate the operation state.
Communication:The communication with the cellular one is through the AT commands.
The communication cable between the cellular one and the main board is the
pattern DCU-11 that comes to connect to the port USB of the PC, for this
application, I had to dismantle it and to adapt, in short, the only thing that I use is
the connector for the telephone and a piece of the cable.
If you have an old Sony Ericsson mobile phone and you are not using it, it is the
time to build some useful with that.
I used the Sony Ericcsson T290 pattern but you can use another model such as
T10s, T18, T28, T230, J300, Z300.
Use only the pins 4 (Rx), 5 (Tx),10 (GND), and 11 (Power).
This connector is for the telephones Sony Ericsson model T230, T290, J300 and
Z300,
the used cable is the DCU-11 model.
For more informations refer to this web page: http://pinouts.ru/CellularPhones-PW/
erics_t28_pinout.shtml
The main board:
I use the pic 16F628A, it is not expensive and it already has incorporate serial port
(Usart), what simplifies the programming and the communication a lot with the
cell phone.
The jumper is to enter in the programming mode, when this position, the micro
obtains of the telephone the messages commands and the number of the cellular
one of who sends it. All this information is stored in the eeprom memory (not
volatile) of the micro.
The firmwareThe firmware of 16F628 is very complicated because we should obtain of the
received message the telephone number of who sends it and a part of the text of
the message, and then to decode it.
The program of the microcontrolador (firmware) it was written in language “C”
using the compiler CCS.
The messages:
I process the messages in the PDU mode; if one reads them, it does not
understand anything because a chain of characters in hexadecimal forms it. What
I use is the phone number of who sends the SMS and a part of the text of the
message, everything the rest (dates, hour, number of the center of messages, etc) I
discard it.
The project it is based on the Uruguay mobile phone network (Ancel) and I don't
know if the SMS message in other country have the same syntax. For this reason,
the Telecomando_G7 version, perhaps do not work very well, because the
program has to process the SMS message.
Try with the SMS Send code first, in this case, the program only has to send the
messages, it is not necessary to process them and it doesn't care the syntax of the
sms.
G7 Wiring Diagram.How it is work?
If you are using only the version for to send messages, follows these steps
in order to configure the cell phone.
1. Erase all the inbox and outbox messages of the cell phone.
2. Write the first message, it is corresponding when the input Z1 is active,
for example “The car siren is sounding”. Do not send the message
stores it in the portfolio draft.
3. Write the second message, it is corresponding when the input Z2 is
active, for example “The water deposit is full”. Do not send the
message stores it in the portfolio draft.
4. Connect the phone to the system through the cable and turn on it, then
connects the main power source at the system, the red led will blink,
now is ready for to be used.
I add in the program portfolio a hex file of a control version called
Telecomando_G7, which might to control an electric device but does not verify
the phone number of the sender sms.
Fallow these steps in order to configure the system.
1. Erase all the inbox and outbox messages of the cell phone.
2. Write the first message; it is corresponding when the input Z1 is active,
for example: The car siren is sounding. Do not send the message stores
it in the portfolio draft.
3. Write the second message; it is corresponding when the input Z2 is
active, for example: The water deposit is full. Do not send the message
stores it in the portfolio draft.
4. Write the third message; it is corresponding when the relay output is
active, for example: The output is active. Do not send the message
stores it in the portfolio draft.
5. Write the fourth message; it is corresponding when the relay output is
inactive, for example: The output is disconnected. Do not send the
message stores it in the portfolio draft.
6. Here you have to send from your own cell phone the first commands
messages to the cell phone connected at the system. The first message
that you have to send is the status message, for example send: Report,
and when the system read this message immediately send you a SMS
with the status of the relay output.
7. The second SMS that you have to send will light the relay output, for
example send: Light.
8. The third SMS that you have to send will turn off the relay output, for
example send: Turn off.
9. Connect the phone to the system through the cable and turn on it, then
connect the main power source at the system, the red led will blink,
now put the jumper and the led stop to blink, remove the jumper and
wait some seconds until the led begin to blink, now the system is
clever one to use.
Warning: The program in the pic only compares the first five letters of the
message command that you send to the system; therefore, don't send in the steps
6, 7 and 8 messages that coincide in the first 5 letters.
RESOURCES:
Learn more about PDU mode:
http://dreamfabric.com/sms/
Sony Ericsson pin out cable connector:
http://pinouts.ru/CellularPhones-P-W/erics_t28_pinout.shtml
Ericsson T28 AT command online reference:
http://mobileinternet.ericsson.se/emi_manuals/T28/ATCommand/T28_R1A.pdf

No hay comentarios: