4innovation
Newbie level 1
Hello everyone..
As a part of my project, I want to take input from sensor and send it to PIC16F877A MC,which sends an SMS through GSM SIM900A to another GSM module at the other side.Another PIC MC at the receiving GSM module turns ON an LED , which is the output required. I am a newbie to GSM modules and hence I tried sending an SMS to a mobile phone basing on the codes in mikroC and circuits that are available in the internet, but failed in making the circuit work. The code was built without any errors though. I cross-checked the hardware connections, but I was unable get a single clue on how to proceed further... Well, I have some questions now and I will be glad to get all kinds of suggestions.
Used mikroC lang and mikroC PRO for PIC.
1.I have used a 4Mhz crystal for PIC.. Is it sufficient or should I replace it?
2. Is the code correct? this is my code.. actually the one I took from the opensource sites.
3. Am I supposed to give connections for serial communication between SIM900A and PIC other than the ones specified in the circuit diagram?
As, I am using a GSM module which has inbuilt converters, I have ignored the connections of voltage converter between the SIM900A and PIC MC.
As a part of my project, I want to take input from sensor and send it to PIC16F877A MC,which sends an SMS through GSM SIM900A to another GSM module at the other side.Another PIC MC at the receiving GSM module turns ON an LED , which is the output required. I am a newbie to GSM modules and hence I tried sending an SMS to a mobile phone basing on the codes in mikroC and circuits that are available in the internet, but failed in making the circuit work. The code was built without any errors though. I cross-checked the hardware connections, but I was unable get a single clue on how to proceed further... Well, I have some questions now and I will be glad to get all kinds of suggestions.
Used mikroC lang and mikroC PRO for PIC.
1.I have used a 4Mhz crystal for PIC.. Is it sufficient or should I replace it?
2. Is the code correct? this is my code.. actually the one I took from the opensource sites.
Code:
void main() {
//
//Negotiate baud rate
UART1_Write_Text("AT"); // Send "AT" string then wait for a short delay
UART1_Write(0x0D); // Termination by CR (ASCII value of Enter in Hex)
Delay_ms(100); // 100 ms delay
//Disable Command echo
UART1_Write_Text("AT0"); // Send "AT0" string then wait for a short delay
UART1_Write(0x0D); // Termination by CR (ASCII value of Enter in Hex)
Delay_ms(100); // 100 ms delay
//Set message type as TEXT
UART1_Write_Text("AT+CMGF=1"); // Send "AT+CMGF=1" string to set SMS mode
UART1_Write(0x0D); // Termination by CR (ASCII value of Enter in Hex)
Delay_ms(100); // 100 ms delay
//
//Send message
UART1_Write_Text("AT+CMGS=\"mobileno.\""); // Send SMS to cell number
UART1_Write(0x0D); // Termination by CR (ASCII value of Enter in Hex)
UART1_Write_Text("Hello World"); // Send "Hello World" text message
UART1_Write("0x1A"); // Cntrl+Z (0x1A ASCII value of Cntrl+Z in Hex
UART1_Write(0x0D); // Termination by CR (ASCII value of Enter in Hex) // 100 ms Delay_ms(100);
}
3. Am I supposed to give connections for serial communication between SIM900A and PIC other than the ones specified in the circuit diagram?
As, I am using a GSM module which has inbuilt converters, I have ignored the connections of voltage converter between the SIM900A and PIC MC.