Monday 8 April 2013

AT Command tests

As mentioned in the previous post you have to use Hyperterminal - there are others - e.g. minicom, but Hyperterminal seemed to be the most refered to in the Windows world.

Instructions can be found here:

http://www.developer.nokia.com/Community/Wiki/AT_Commands

The commands I am interested in are

ATDxxxxxxxxxx;    // Dials a number - colon on end
AT+CHUP  // Hangs up
ATA  // Answer an incomming call
AT+CBC  // current battery charge

When the Nokia rings the text "RING" is sent to the hyperterminal, it maybe possible to monitor for this or  detect the signal sent to the ringer in the mobile phone to activate one of the inputs on the PIC - if this voltage is high enough then this may be the best option.

Could Include an option that will indicate the charge on the battery when a certain sequence is dialled. This could be 4 pips for full charge 1 for 25% etc.

Next step is to get a RS232/USB cable to check that serial commands can be sent - I'll use Minicom under Linux for this (just to make sure that the modem features of the Nokia 6301 are not "WinModem").


GSM Module

I am sitting at my PC looking at www.proto-pic.com and their GSM module ADH8066. Seems that this is just what I need. I would also need an antenna and some method of connecting this or soldering to it. You can buy break-out boards which provide hardware interfaces, but this looks like it'll make the module quite big.

It then occured to me that all I need is an old mobile phone that is small enough to fit into the case of the old BT rotary phone.

It does everything for me:
  1. Battery power
  2. Charging
  3. Antenna
  4. Interface from COM port.
The phone I am going to use is a Nokia 6301, I have stolen my daughters for the time being but I'm sure I'll be able to get hold of one or something similar for next to nothing.

The command strings to send to the phone are standard Hayes AT commands. I have worked out the one I need is:

ATD01233454567;

Simple as that this (don't forget colon on end) command dials via the com port on the mobile phone from a command string.

You can simulate this by bringing up Hyperterminal, or download it if using Win 7, and connecting the phone as a USB COM port - my laptop does not have an RS232 COM port so it is emulated via the USB. I will try the same with my Linux server that has an RS232 port on it. I will also possibly need a mini-USB to RS232 cable. I haven't worked out exactly how to connect the output of the PIC, which has interpreted and constructed the AT command, to the Nokia phone - I hope that it is as simple as connecting the right wire from the USB connector to the output pin of the PIC....more on this later.

The plan is to butcher the phone a bit, the screen is not needed, so I'll make this optional - hopefully using an AT command of some sort, but if not then I'll just pull some wires out. The battery will have to be used to activate the ringer as well so I'll have to tap into this. The mic and earphone will either utilise the existing BT phone ones or if they are active devices, which I suspect they are, I will try and use the jack plug with the 'hands free' ear & mic - simples!

Basicall that's it, the design is now as follows:

Retro-mobile design