Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Microcontroller based Electric Switching Device via GSM

Status
Not open for further replies.

dijam014

Newbie level 4
Joined
Dec 14, 2010
Messages
7
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,346
Hi everyone, I need help about my project on the interfacing part of the GSM to the microcontroller(pic16f877), I need to control some switching devices(outlets using relays) to turn them on and off using text message(sms) via GSM. I am using mikrobasic as my programming language, and as a temporary replacement for the GSM I am using the mikrobasic usart terminal for testing some codes. Currently I am trying to figure out how to use the usart_data_ready command and I tried the code below. Can anyone kindly share with me some codes regarding this project and any advice or clarifications with the code below. Thanks in advance for the help :D

program readstring
dim txt, delim as char[20]

trisA= %000000

main:
porta = %000000
USART_init(9600)
delim = "ON"
while true
if Usart_Data_Ready = 1 then
Usart_Read_Text(txt, delim) ' read text until "OK" is received
Usart_Write_Text(txt) ' write back what has been read
delay_ms(400)
porta = %011011
else
'if not equal to ON then reply "invalidkeyword" the GSM will send a 'message invalid
end if
wend
end.
 

first make some key words (for toggle on / off particular pins)
then make ur hex do that exactly ____when u got that from your code input
___first delay some time ___ then do switch ur relay___then again start loop____
this is same for every module ;;gsm,rxtx,i2c;ir;bluetooth etc
in any lang. like c c++ basic whatever,,who cares
practice this with ur pc serial cable rx tx rs232 first
go further step by step,,then u get what u deserve by ur effort
peace :)
 
Hi thanks for the reply, but still I dont know how to write the codes that would exactly do as you have said. I have some ideas but im still working on it. I really need it to figure it out asap so if you or anyone have any sample codes for it or any related to it can you please share it to me. thanks
 

you should use a rs232 tool to monitor whats going on

this will help you more than any code others post

a good one is portmon Portmon for Windows

if you add just a simple 1n4148 signal diode to break out the tx or rx stream to the rx pin {and ground obviously} on a pc

you can see whats flying around

your code is on the right track
stick to stive and get your code right
with as little help with others code as possible
is the best advice ,,,

usualy with 877 you need to turn off the a-d on port A before use

its much better to use port B pins or c for hardware uart etc...
port A can be tricky with some compilers
ive never used the microbasic one
 
Hi
Firstly u should skip u controller and use hyperterminal to figureout how to
send sms via gsm modem , u should be familiar with AT commands
u can start with simple AT commands
during this debugging you can use Hextool6 program to monitor the transactions between PC and gsm modem
Once u able to send SMS just program the ucontroller to act like Hyperterminal
 
I am already doing what you have said khabbash, I managed to test the GSM sending process using the hyperterminal properly and I do have a reference already for the AT commands. Now my problem is how will the microcontroller understand if the sent SMS is correct. I prefer to use proton or mikrobasic for the codes.

Ex.
I sent an sms "ON"
then the microcontroller will check the sms if it is correct and trigger some ports to be turned ON or else if the message was wrong the GSM will send back an SMS that it is "Invalid".

Thanks for the Help.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top