This unit monitors a phone line for incoming and outgoing calls, and logs them in a 4095-record circular buffer (actually, I don’t expect to receive and make more than 4095 calls anyway).
Interface to the phone line uses a Retell 142. The 142 connects directly to the phone line (not to an individual phone) and monitors all activity on the line. In addition, there is a cut-down old telephone receiver, which allows the unit to answer the phone, and a Retell 157 allows it to insert sound (pre-recorded messages or “hold” music) onto the line. This also allows the ringing signal to be detected.
“Progress tones” (incoming call alerts at 2130Hz and 2750Hz, dial and ringing tones at 350Hz, 400Hz and 440/450Hz) are identified using LM567 tone decoders.
The number of an incoming call (caller ID) is decoded using an XR2211, using the circuit described here http://www.electronicoscaldas.com/datasheet/XR2211-Application-Notes_Exar.pdf, although some of the values needed tweaking to get more reliable action. The format of the calls is described here https://www.openreach.co.uk/cpportal/content/dam/cpportal/public/images-and-documents/home/help-and-support/sins/documents/SIN_227.pdf (although this is an updated version of the one I used).
Outgoing calls use a pre-assembled MT8870 to decode DTMF number tones.
Pre-recorded messages are played using the SPE035 MP3 module. Calls can be dialled using an HT9200 DTMF generator.
An “address book” directory of names and numbers is maintained on two Microchip 24FC1025 1Mbit EEPROM chips, each holding up to 4096 32-bit records. The directories can be searched sequentially or, in the case of the numbers, a hash search is used to find a number quickly. This means that a number can be identified (if it is in the address book) between the time the Caller ID is received and the first ringing signal arrives. If a number has previously been identified as a scam, the number can be answered by the unit (and a suitable message played) without the phone ever ringing. Numbers can also be screened to check for plausibility – for example, a number starting “01” which is flagged on the Caller ID as “international” is fake. Such calls can also be blocked automatically.
The keypad uses a variation of the circuit described here https://picaxeforum.co.uk/threads/converting-a-digital-keypad-to-an-adc-keypad.24850/#lg=post-250886&slide=0 . It actually uses 16 “keys”, the last four are the “function keys” below the main keypad.
The Picaxe hardware consists of a 40X2 (using all four slots); a 20X2 dedicated to the phone line, decoding incoming and outgoing calls; and another 20X2 to transmit the “incoming call” alert via an NRF24L01, and receive date and time information from another Picaxe which has a GPS module.
This was originally designed for the BT copper telephone line service. Last year we were switched to “Digital Voice”, but the system still works, with the phone wiring for the house plugged into the “telephone” socket on the modem.
Setting up the tone decoders and the XR2211 was something of a nightmare, and would not have been possible without a tone generator (XR2206 kit) and the OSC001 oscilloscope.