8 RELEE comandate cu MOBILUL prin SMS

Discutii despre cum poate fi automatizata casa noastra pentru a o face cat mai confortabila.

Moderator: MeDeVe

ce parere aveti despre acest proiect?

nu sunt interesat pentru ca e prea greu de facut....
super, cred ca mi-ar folosi, o sa-l construiesc :)
Total votes : 8

8 RELEE comandate cu MOBILUL prin SMS

Postby puiu on 22 Nov 2008 00:15

With this circuit we can controll up to 8 devices (4 devices in our example project), by sending a specific SMS message with any mobile phone. Its very usefull at the cases that, at the place we have the devices, we have not a wired telephone line. If you have an old ericsson mobile phone and you are not using it, its the time to build some useful with that. The controlling that we can do to the devices, it is ON , OFF or Reset.

Usage of this circuit
With this circuit you can switch-ON , OFF or Restart some Linux servers, ADSL modems, Printers, Door with electric lock, Garage door, House lights, Water pumps, electric sunshade, Block the engine of your car or your motorcycle, at the steal case and much more. The purpose of this circuit is to make the human life better and easier.

The circuit
The hardware of the circuit its very very simple, because the communication port of ericsson mobile its working at the 5 volts with AT commands ( like the modem commands, but for mobile phones).

The firmware of the AT90S2313 (or ATtiny2313) its very complicated because, we have to convert the 'septets' of the phone to 'octets' because the AVR need bytes with 8 bits length ( The 'septet' is 1 byte with 7 bits length and 'octet' is 1 byte with 8 bits length). All this proccess its necessary to decode the message from SMS.

This circuit is working on both AT90S2313 and ATtiny2313 microcontrollers. In case of ATtiny2313 you have to select "External Crystal Oscillator" instead of default "internal RC oscillator" from the "Fuses" tab of your programmer's software. You have to uncheck the "Divide clock by 8 internally".

When you finish the circuit connect it to the mobile phone, turn on the phone and then power on the circuit, not before . The AVR now its trying to read the message from the 1st memory location of the phone, for that i suggest to delete all SMS messages from the phone before connect it to the circuit. If there is no message to the 1st memory location, the AVR its trying again until you sent any.

The format of the message must be only '1' or '0'. '1' to enable, or '0' to disable the device. The message must have only 8 numbers, '1' or '0' , alone or mixed .

Example: if you send the message 11000100 then you enable, starting from the right, the devices 3,7,8 ('1') and disabling the devices 1,2,4,5,6 ('0') .

If you want to send a new message and you don't want to change some device, must send the same number as the old message.

Example: If you want to enable only the 5th device, you must send a new message like 11010100 to keep the other devices as there are (we send the same message as the old ( 11000100 ) and we change only the 5th bit from '0' to '1' to enable the device

>> You can remove the <NO> key from T10s and solder an ON-OFF switch in this place. If you put it in ON position, the phone is will power-ON automaticly every time you cut and then apply, the main +12V DC power supply. To add this switch you have to disassemble the T10s.

>> The PDU decode proccess. Take 7 bytes (8bits) and convert them to 8 bytes (8bits) by adding one zero at the start of each byte. The PDU format is use bytes with 7bit length.

Advice !
If you want to protect your devices from other person's messages, modify the source code, to read the AVR, your telephone number before execute any message. In the source code i have some part of code, to read the telephone number, the service center number, the date and the time of the received message.

The project its based on the Greek mobile phone network of <Vodafon GR> and i don't know if the SMS message in other country, have the same syntax ( I mean the form of the septets that the GSM receiving from the GSM network ).

After the GSM receive the message, the AVR execute it, delete it from the phone memory, to release the 1st memory location and start again to search for a new message.

Service mode
If you connect the pin7 (PD3) of the AVR to MAX 232 chip and this to computer, you will see at the terminal window software, all the data that the GSM is send to the AVR (Sender's number, service center number, date, time and the AT commands ) . Setup the COM port to 19200 bps 8n1.

I have test it only with Greek sim cards and T10s mobile phone. I don't know if this circuit its working fine to other countries or other mobile phone models. You can build the diagnostic circuit that is in the dot frame of the schematic, and to connect the circuit with PC via RS232 port.

When you power-on the circuit and the phone, the AVR it will send the follow commands to the mobile phone:

1) AT+CPMS="ME" (Select the phone memory "ME")


2) AT+CMGR=1 (read the received message from memory possition 1)

If the mobile phone will response with:

AT+CMGR=1[CR][CR][LF] (this message its sended when there is no message in the phone memory)


At this case the AVR it will send again the commands 1 & 2

If the mobile phone will response with:

AT+CMGR=1[CR][CR][LF] (this message its sended when a new message arrive in the phone memory)

+CMGR: 0,,26[CR][LF]



(xxxxxxxxxxxx is the phone number of the sender)

the AVR will decode the septets message to octets, execute it (arm or disarm the relays) and send the command

AT+CMGD=1 (delete the received message from memory possition 1)

to delete the message from the phone memory.

You can see the voltage of the PortB with any voltmeter if you have +5 or 0v voltage, to check if the command you send, for example"11001010", its executed.[


V2.0 is now available.

I have rewrite the code again from the start and I add 2 more features
Plug 'n' play: now you can connect the SMSRC (SMS Remote Control) circuit with T10s mobile phone, power them ON both and then send any command '1' or '0' from some other mobile phone to the T10s of the circuit. The AVR will read the message and execute it and change the relay state.
Send response message: when you send some command message from some other mobile phone (like nokia, siemens etc) to ericsson T10s like "11001010", the AVR will execute the command and then it will response to the sender's mobile phone, if command is executed.


Reset command: Added a reset command. By sending the letter "r" or "R" , the AVR will disarm for 2 seconds the specific relay and then it will arm it again, until rext received SMS. It is perfect to reset ADSL modems, WiFi Access points, linux servers e.t.c.
Transmition bytes to PC: The transmition pin has changed. Now the pin7 (PD3) is sending the data to PC, to see if the circuit is working propperly. The serial data communication has changed to 19200bps 8 none 1 .
Problem with unrecognized characters is fixed. Now if you send SMS to T10s with any different character than "1" , "0", "r" and "R" , the AVR it will ignore it. At the previous versions (up to V2.0) when received any unknown character, the specific relay was went to <disarm> state.
Send response message: is removed because the cell phone provider is inform you for free, if SMS is delivered (this service in lot of countries is free).
The command method has not change it, you must send only up to 8 numbers '1' , '0' , 'r' and 'R' . For example 110r101R


Plug 'n' play function: Some times the AVR stopped to communicate with T10s. Fixed!

Mii de multumiri lui Serasidis Vasilis pentru acest articol imprumutat: ..serasidis.gr
User avatar
Posts: 63
Joined: 16 Apr 2008 23:49

Re: 8 RELEE comandate cu MOBILUL prin SMS

Postby stress on 24 Nov 2008 14:32

pentru cine nu are programator pentru atmel gasiti aici unul simplu: viewtopic.php?f=31&t=10
User avatar
Posts: 87
Joined: 06 Apr 2008 02:14

Re: 8 RELEE comandate cu MOBILUL prin SMS

Postby ulybmw on 11 Dec 2009 00:07

O compatibilitate cu alte tipuri de mobile, genaratii mai noi unde se poate gasi? Ca aceste tipuri de Ericssoane nici la muzeu nu mai gasim ;)
Posts: 18
Joined: 10 Dec 2009 22:56

Re: 8 RELEE comandate cu MOBILUL prin SMS

Postby ciocanaru on 05 Feb 2010 13:58

Banuiesc ca se poate adapta orice telefon care "stie" TxD RxD. Nu am probat dar teoretic ar fi posibil. Tot ce ar trebui facut este sa identifici pinii corespunzatori din telefon.
Posts: 1
Joined: 05 Feb 2010 12:58

Return to Automatizari in casa

Who is online

Users browsing this forum: No registered users and 2 guests

Sedo - Buy and Sell Domain Names and Websites project info: elektronica.us Statistics for project elektronica.us etracker web controlling instead of log file analysis Powered by  MyPagerank.Net