martes, 17 de noviembre de 2009

Enviar un sms con un celular y un pic: el programa


Ahora que tenemos el circuito hay que hacer el programa para cargar en el pic.
El programa principal va a estar vigilando al pulsador conectado al pin RBO del pic , en caso de detectar que fue presionado va a la función de envío de sms.
El puerto serie del pic se configura para transmitir en 9600 baudios.
Es necesario enviar algunos comandos para configurar al teléfono:

It's necessary to send some commands to set the phone like these:

ATEO- cancelo el modo eco // cancel eco mode
AT+CMGF=1- selecciono el modo texto para los mensajes// select the text mode for the msgs.
AT+CPMS="ME";"ME"-los mensajes se leen, borran, envían y reciben desde la memoria del teléfono //Select phone memory to read, erase receive and send sms .

We have the circuit, let's make the program to load into the microcontroller.
The main program will be monitoring the push button connected to pin RBO of the pic, if pressed it going to send a sms message.
The pic's serial port is configured to transmit at 9600 baud
ios.

Con el diagrama de flujo queda mas claro cómo funciona todo.
El programa puede crecer aún mas, agregando la función de manejo de un relay al recibir un sms, pero eso quedará para la próxima vez......

With the flow chart is more clear how the system work
The program can grow even more, adding the role of managing a relay when the system receive an incoming sms, you'll get for next time...

domingo, 15 de noviembre de 2009

Enviar un sms con un celular y un pic

dEl objetivo es construir un sistema que permita enviar un sms cada vez que se presiona un pulsador. Necesitamos un celular en este caso un Sony Ericsson T290 (es lo que consigo en mi país), sirve el T230, por si no consiguen el anterior, el cable de comunicación es el DCU
-11 y un pic 16F628A.

The objective is to build a system that allows to send a sms every time a push button is pressed.
We need a mobile phone in this case a Sony Ericsson T290 or T230 (it is what I get in my country), a DCU-11 communication cable and the pic is the 16F628A.

El circuito:

Como ven es un circuito muy simple, los 2 transistores adaptan la señal proveniente del celular para ser aplicadas al terminal Rx del pic.

As you can see is a very simple circuit, the two transistors adapt the signal from the cell phone to be applied to Rx terminal of the pic.


El cable:

El modelo del cable es el DCU-11, se quita el adaptador usb a serie y solo se usa el conector que va al celular.
Los pines que se usan del conector es el 4 (Rx), 5
(Tx), 10 (GND) el 11 es alimentación que se puede usar para cargar al celular.

The cable model is the DCU-11, removes the USB to serial adapter and only used the connector that goes to the phone. The pin connector used is 4 (Rx), 5 (Tx), 10 (GND) on pin 11 is Power pin that can be used to charge the phone.












Materiales:
2 C2,C1 22pF
1 D1 3,3V
1 PIC16F628A
2 Q2,Q1 BC548
3 R1,R2,R5 10K
1 R3 560
1 R4 1K
1 R6 4,7K
1 SW1 SW PUSHBUTTON
1 Y1 4MHz crystal
1 Cable DCU-11


EN LA PRÓXIMA ENTREGA PUBLICARÉ EL PROGRAMA PARA ENVIAR SMS.

IN THE NEXT ISSUE PUBLISHED THE PROGRAM TO SEND SMS