SMS via pic


Closed Thread
Results 1 to 16 of 16

Thread: SMS via pic

Hybrid View

  1. #1
    Join Date
    May 2008
    Location
    Italy
    Posts
    825

    Default

    Tray to connect your system as per the attached schematic.This works for me.

    With MAX232 you should not use electrolytic capacitors. See the datasheet.

    Make sure you have proper contacts in your layout.

    .

    Al.
    Attached Images Attached Images  
    Last edited by aratti; - 8th November 2009 at 22:20.
    All progress began with an idea

  2. #2
    Join Date
    Oct 2009
    Posts
    8

    Default

    Thanks to your kind suggestions all, especially aratti;

    In fact, Ajay Bhargav from 8051projects.net forum, I really appreciate his latest comment .

    The solution is; making some additional connections at GSM serial port, as below;



    Before I only connected, RX,TX and GRND pins of the GSM serial port.

    And below you can see the general connection latest I made:



    And a program to send sms and or call a phone number is as follows:
    Code:
    'Definitions
    DEFINE OSC 4			'for 4 Mhz
    'DEFINE OSC 8			'for 8 Mhz
    
    DEFINE HSER_TXSTA 20h	'I wonder shall I define as DEFINE HSER_TXSTA 24h???
    DEFINE HSER_RCSTA 90h	'same for all
    
    DEFINE HSER_BAUD 2400	'for 2400 Baud rate
    'DEFINE HSER_BAUD 4800	'for 4800 Baud rate
    'DEFINE HSER_BAUD 9600	'for 9600 Baud rate
    
    DEFINE HSER_SPBRG 25		'for 4Mhz/2400 & 8Mhz/4800 with an error %0.16
    'DEFINE HSER_SPBRG 12	'for 4Mhz/4800 & 8Mhz/9600 with an error %0.16
    
    DEFINE HSER_CLROERR 1	'same for all
    
    ' Initialization & Declaration
    i var byte
    TRISB=%00000000
    PORTB=%00000000
    TRISD=%00001111
    PORTD=%00000000
    
    ' CHECK
    FIRSTCHECK:
        HIGH PORTB.7
        PAUSE 500
        HIGH PORTB.6
        PAUSE 500
        HIGH PORTB.5
        PAUSE 500
        HIGH PORTB.4
        PAUSE 500
        PORTB=%00000000
    
    GSM_CHECK:
    HSEROUT ["AT",13]                    'Send AT to modem followed by a CR
    HSERIN 5000, GSM_CHECK, [WAIT("OK")] 'Check OK reply, wait 5sec max.
    HIGH PORTB.7
    PAUSE 1000
    
    HSEROUT ["AT+GMM",13]                           'Ask model name
    HSERIN 5000, GSM_CHECK, [WAIT("T610 series")]   'Check model name
    HIGH PORTB.6
    PAUSE 1000
    
    HSEROUT ["AT+IPR=2400",13]      'Set transfer speed
    HSERIN 5000, GSM_CHECK, [WAIT("OK")]'Check OK reply, wait 5sec max.
    HIGH PORTB.5
    PAUSE 1000
    
    HSEROUT ["AT+CMGF=1",13]            'send AT to modem followed by a CR and line feed
    HSERIN 5000, GSM_CHECK, [WAIT("OK")]'Check OK reply, wait 5sec max.
    HIGH PORTB.4
    PAUSE 1000
    
    PORTB=%00000000
    
    BEGIN:
    IF PORTB.5=1 THEN ERROR_CALL
    IF PORTB.6=1 THEN ERROR_SMS
    HIGH PORTB.7
    pause 1000
    LOW PORTB.7
    if PORTD.2 = 0 then SEND_SMS
    IF PORTD.3 = 0 THEN CALL_PHONE
    PAUSE 1000
    GOTO BEGIN
    
    SEND_SMS:
    HIGH PORTB.6
    HSEROUT ["at+cmgs=",34,"XXXXX",34,13]
    PAUSE 1000
    HSEROUT ["this is a test message",26]
    HSERIN 10000, BEGIN, [WAIT("OK")]'Check OK reply, wait 5sec max.
    LOW PORTB.6
    GOTO BEGIN
    
    CALL_PHONE:
    HIGH PORTB.5
    HSEROUT ["atd[XXXXX];",13]
    HSERIN 5000, BEGIN, [WAIT("OK")]'Check OK reply, wait 5sec max.
    PAUSE 2000
    LOW PORTB.5
    GOTO BEGIN
    
    ERROR_CALL:
    FOR i = 1 to 5
    HIGH PORTB.4
    PAUSE 500
    LOW PORTB.4
    PAUSE 500
    next i
    PORTB=%00000000
    GOTO BEGIN
        
    ERROR_SMS:
    FOR i = 1 to 5
    HIGH PORTB.4
    PAUSE 500
    LOW PORTB.4
    PAUSE 500
    next i
    PORTB=%00000000
    GOTO BEGIN
    
    ' END
    End
    Thanks again for your attention and time, I will continue with :
    - Improving the program to a real case scenario,
    - Think more about the real case scenario, because at first stage I would like to use this as an alarm system for my garden house. I will need some sensors for unexpected visitors or animals.

    Do you have any idea, what kind of sensors I can use to detect unexpected visitors?

    Regards,

  3. #3
    Join Date
    May 2008
    Location
    Italy
    Posts
    825

    Default

    Glad to know you have finally your gsm system at work.

    - Think more about the real case scenario, because at first stage I would like to use this as an alarm system for my garden house. I will need some sensors for unexpected visitors or animals.

    Do you have any idea, what kind of sensors I can use to detect unexpected visitors?
    Just take a look at one of my project @ http://techni.caliti.es/blog/2008/12...ontroller.html

    Al.
    All progress began with an idea

  4. #4
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530

    Default

    Quote Originally Posted by kenandere View Post
    Do you have any idea, what kind of sensors I can use to detect unexpected visitors?
    Regards,
    Most (inexpensive) motion sensors use an infra red sensor with a fresnel lense on it. The heat of the human/animal is above background, so as it moves, the fresnel lense makes the heat hit and miss the sensor. This gives quick varying temperatures, where normal heating and cooling of the room, or outdoors, occurs slowly.

    You can go to the hardware store and buy a cheap outdoor light and steal the parts out of it like this:
    http://www.acehardware.com/product/i...LAID=109386813

    Or buy the parts:
    http://www.futurlec.com/PIR_Sensors.shtml

  5. #5
    Join Date
    Jan 2009
    Location
    California, USA
    Posts
    323

    Default

    Quote Originally Posted by kenandere View Post

    Do you have any idea, what kind of sensors I can use to detect unexpected visitors?
    These are nice little IR sensors. They even have serial interface. For outdoor use they'll obviously need some protection...

    http://www.zilog.com/docs/devtools/PS0284.pdf
    http://search.digikey.com/scripts/Dk...me=269-4710-ND


    steve

  6. #6

    Default interesting projects :-)

    Hi all

    As input sensors you could use security lights that have a PIR that have a 12Volt buzzer output and use that as the input trigger for your pic.
    Is there any possiblity of using the mobile phone's camera to take a pic and send that as an MMS ?

    Kind regards

    Dennis

  7. #7
    suwanggoh's Avatar
    suwanggoh Guest

    Default

    hi kenandere,

    i just want to confirm the connections of rs232 on the GSM side.

    you short the pin 1,4,6 and short pin 7,8?

    i succeed in sending sms from PIC, but i couldnt get any response from the phone t630.

    thank

    suwang

  8. #8
    Join Date
    Oct 2009
    Posts
    8

    Default

    Hello Suwang,

    Yeah as say, 1-4-6 and 7-8.

    Regards,

  9. #9
    Join Date
    Mar 2010
    Posts
    20

    Default SMS via PIC

    Hullo every one thankyou for ur help;
    I am doing project related to the one of kenandere above, but am not using the sensors, am using +5V to act as an interrupt to PIC16F84 microcontroller which is connected to the phone, the pic16f84 should send an SMS to the programmed number after receiving an interrupt;
    My questions are;
    How do i know whether my phone supports AT commands?
    Can program above work on pic16f84?
    Components i have so far
    -pic16f84
    -2330 nokia
    -max232
    pliz help me, i will be glad, thankyou in advance

Similar Threads

  1. Replies: 18
    Last Post: - 7th April 2009, 21:46
  2. HELP ME, SMS controlled relay using PIC
    By pazko1125 in forum mel PIC BASIC
    Replies: 14
    Last Post: - 2nd October 2008, 15:26
  3. Replies: 0
    Last Post: - 1st September 2008, 07:03
  4. Serial Pic to Pic using HSER
    By Chadhammer in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 11th March 2005, 23:14
  5. SMS decoding / encoding using PIC!
    By bitmaniac in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 19th March 2004, 07:03

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts