Saturday, August 30, 2014

GSM Portable Alarm DIY Project for Hobbyists using a Nokia 3310 Mobile Phone.

Features and Specifications:

      • 12 VDC operation
      • 6 hour Battery Backup time (1.3A/h batt)
      • Audible Arm/Disarm Buzzer
      • Remote ON/OFF and PANIC!!! Function
      • Customised PANIC!!! SMS Messages
      • Battery LOW/RESTORE SMS reporting
      • Missed Call on Activation of Infrared Detector
      • Use in Caravan, Boat, Car/Bakkie, Holiday Home, Guard Livestock, Guard Passage to valuables such as copper cable and many more.
        This is a project that I have done for a friend who were involved in protecting people against farm attacks in South Africa. The main concern was to inform their neighbours about possible danger and this had to be done by sending out SMS messages by simply pressing a remote button with a range of at least 150m from where the unit was placed. Now I want to share this piece of work to the world, expecially to all my Electronic enthusiast friends an all hobbyists around the globe. Take note that this project is medium advanced but can be build without any problems if the instructions that I give is followed very carefully. I will include the Eagle Schematic and PCB Layout files for you to download. The Hex file for writing the PIC16F88 will also be available to download.

        How it works.

        There are several ways to manupulate a Mobile Phone to accept commands from a Micro Controller.

        Method 1 is to connect the MCU to the phone through the F-Bus.
        These connectors are visible on the back of the phone and is normally used for Software and Firmware updates. Although these connections to the phone is quite simple, the hard part is to get the two to communicate. There is no user interface between you and the phone using this method, meaning that all commands must be written in machine language. This is done in Hex code and is extremely diffucult to learn. For those of you who have the time to learn this, visit the following web page. This is the only and best page to explain this.

        http://web.archive.org/web/20120712020156/http://www.embedtronics.com/nokia/fbus.html

        Method 2 is to connect to a phone with a Modem through the Serial Port. This is the best method of connecting MCU's to Mobile Phones. The only disadvantage is that Phones with Modems become quite expensive and it would not be nice to make a mistake and destroy an expensive phone. On the other hand if you can get this working you can send and recieve almost any data through the Network using AT Commands. Serial TX and RX functionality is available on almost all modern MCU's. From Microchip, Atmel to Phillips and many more. This is the only method of taking full control of a Mobile Phone. Using this configuration you can connect to the Internet, send and receive e-mail and SMS's, MMS's and even integrate to your MySql web server database. This sound too good to be true, but is worth considering. I will write a post on this at a later stage.

        Method 3 is the one that we will construct now. This involves simply getting the MCU to control the 'Clear', 'Menu' and 'Down' buttons on the cellular phone's keypad. Now a program can be written using any compiler and sequences of keypresses just the way you would do with your fingers. The MCU will actually press the buttons on the phone's keypad. By doing this we can now control the phonebook, the 'Dial' button, send SMS's using the 8 templates included in the 3310's memory and many more. The firmware offered here to download, will also report 'Low Battery' and 'Battery Restored' messages. It is recommended to download the .hex file to get the system working. Once familiar with the operation, you can start compiling your own source code.


        Things you will need to build this project:

        1. Computer Hardware and Software to program the PIC16F88 Microcontroller. More information on this can be on the official site www.microchip.com. I have sucsessfully used the Velleman K8048 development board to do this.
        2. All the equipment needed to make a PC Board as described on my pageon making your own PC boards. Alternatively you can order it from me.
        3. A good working Nokia 3310 Mobile Phone and SIM Card.
        4. One Passive Infrared Detector, the ones they use in home and office Security Alarm Systems.
        5.  One x 2 Channel remote receiver with remote transmitter (Optional). This can be used to switch the unit ON/OFF and to operate the PANIC!!! Function.
        Helpful Links:
        http://www.conrad.com/ce/en/product/191020/Velleman-K8048-Programming-Experimentation-Box
        http://www.velleman.co.uk/contents/en-uk/p469.html
        http://ww1.microchip.com/downloads/en/DeviceDoc/30487c.pdf
        Now lets take a look at the Schematic Circuit Diagram first.

        The PC Board:


        Component Placement PC Board Layout:


        Connector Description.
        1 - 12V +
        2 - GND
        3 - ON/OFF Trigger (-)
        4 - ON/OFF GND
        5 - PANIC!!! Trigger (-)
        6 - GND
        7 - Alarm Zone 1 Input
        8 - Alarm Zone 2 Input

        Description of operation.

        The heart of this circuit is the PIC Microcontroller. When the unit is powered up, it will send a 5V+ signal of 1.2 seconds to the 4 channel opto coupler, which will convert the signal to a ground pulse due to its NPN configuration. This negative output is connected to the ON/OFF button on the power button of the mobile phone. On power-up the phone will switch on automatically.

        Now the Microcontroller will wait for a period of 45 seconds to give the mobile phone time to register on a network. After this time period has passed, a single 100ms beep will be heard from the onboard buzzer, BUZ1. This will indicate that the unit is now ready to receive user commands. On initial startup the system will be in the "Disarmed" state.

        When Pin 3 & 4 is pulsed for 250ms, an 250ms audible 'Beep' will be heard from the onboard buzzer. This is to indicate that the system is now 'Armed'. If  Zone 1 or 2 is violated it the 'System Armed' mode the Microcontroller will take control of the Mobile Phone