VCR Remote Control via SMS

Imagine it, it’s 3:15 on a weekday afternoon and you’ve just realised you’ve forgotten to set the video to tape ‘Pet Rescue’. Usually you would be condemned to an afternoon of misery and disappointment, knowing you had no heartwarming cute animal stories to come home to. But not any more. Below I describe a simple interface between a T28 mobile phone (ME) and Matsui VX770 VCR to allow remote recording of programmes.

Block Diagram

The heart of the interface, the only active component, is a PIC16x84 microcontroller.

It has 1024 bytes of program/data memory, 36 bytes of static RAM and 64 bytes of non-volatile RAM. In this application it runs at 6 MHz, giving an instruction cycle of 0.67us (1.5 MIPS), plenty to handle the low data rates of the two interfaces. Read all about the awsome power of the 16×84 here.

Two interfaces are required, one to the ME to send and receive SMS messages and one to the VCR to control channel selection and recording. These are described below.

VCR interface

This is a simple interface as we can exploit the existing infra-red (IR) remote control interface which will provide all the necessary functions via a single wire link. The VCR’s IR sensor output was disconnected and replaced with a link to one of the pins of the PIC.

Then the required IR codes were captured by connecting a photosensor to the microphone input of a PC soundcard and recording the appropriate transmissions from the remote control.

An example of the captured output is shown below. You can hear the output by downloading matsui_ir_code-stop.wav.

The high/low transitions are clearly visible and easily interpreted. There is an initial long high level followed by a low. This is to allow the IR receiver’s automatic gain control to adjust to the signal level. There then follows 32 bits of data forming 4 bytes. A binary ‘0’ is coded as a high->low pulse of equal mark-space ratio while a ‘1’ is coded with a mark-space ratio of about 3.5. The waveform above is the ‘STOP’ command and represents the bitstream:

i.e. the bytes:

Studying other codes showed that the first two bytes, 0x80 and 0x7B, are constant and are probably manufacturer/model specific. The next byte is the command code and the final byte is its complement, probably for error checking.

The timing of the stream was easily measured from the captured waveform and code to emulate the stream developed. In addition to the control line, a power sense line was connected to the VCR’s power LED so the PIC knows if it has to turn the VCR on before recording can commence. The bitstreams of the other functions are given in matsui_codes.txt.

ME interface

A standard data connector was used to connect the PIC to the ME.

The link is 9600 bps, 8 data bits, 1 stop bit, no parity. This is implemented in the PIC by simple toggling of the data lines in a similar way to the IR emulator. An example of the byte 0x30 (00110000) which represents the character ‘0’ is given below.

The use of a TTL-RS232 level converter is not required as both the PIC and the ME use TTL levels. The Ericsson T28 supports most of the AT command set as described in GSM specification 07.05 (freely available from
) which allows the reception and transmission of SMS messages from external equipment (TE). This page explains the message formats very nicely.

A typical exchange between ME and TE is given below. The ‘<‘ and ‘>’ characters show direction of data (> = from TE to ME, < = ME to TE), # denotes a comment.

The format of the received SMS message string is as follows:

You can see that it is a simple matter to check the originating number corresponds to your phone so no one else can seize control of your VCR! In my implementation it also provides a convienient point to synchronise to when looking for the start of the message. The parser on the PIC is quite unintelligent so any deviation from the format described above will result in failure.

Code was developed in the PIC to configure the ME and listen for incoming messages. Two SMS commands were implemented, record and stop. The command formats are as follows:


In addition, the PIC echoes the message back to the sender to confirm reception using the send message (+CMGS) command. The ME uses a Vodafone Pay As You Talk SIM which has the advantage of no line rental. Even if it runs out of calling credit it can still receive messages okay, but will no longer be able to acknowledge received commands. If you have an old mobile phone lying around then this system will just cost you the price of a PIC (about £2.50). Once these interfaces are implemented, some simple logic holds it all together to control channel selection and recording functions. The PIC ASM code can be downloaded here.



Tweet about this on TwitterShare on FacebookShare on Google+Share on LinkedInPin on PinterestShare on RedditShare on StumbleUponEmail this to someone