As descripted on the Phase 1, we get some pulses at 1200 bauds from the FSK chip. Every provider can give other kind of informations or messages. In Switzerland we use the ETSI FSK protocolWe can only get the single and multiple message type (month/day/hour/minute/phone number[/name]). If you need more documentation, there is a good page selling caller-id simulators and others: Check http://www.adventinstruments.com or download a PDF with all infos: CID1500_UG_R7.pdf.
Decode message
After the first ring, we will get a sequence of 1 and 0: 01010101, 30 times! At this point we get the total bytes to read. Then, we get the date/time and caller number (or P if private). * it is also possible that the provider send the caller name (multiple message type), but it is more used on business phones.
Swiss protocol: ETSI FSK
COMMAND
BYTES
Expected
Calling info
30
0x55, 30 times
Message type
1
0x80 calling message
Info length
1
0x16
Message header
2
0x01 and 0x08, type 1 and 8 bytes
Message body
8
month, day, hours, minutes as ASCII numbers (0x31 = '1')
Message header
2
0x02 and 0x0A, type 2 and 10 bytes
Message body
10
Phone number
Arduino usage
Memory usage for FSK:
20% - Flash (max 32kb)
16% - SRAM (max 2048 bytes)
0% - EEPROM (max 1024 bytes)
On the flash, we have also the bootloader (10%), the SoftwareSerial library and the message strings for the terminal (so we don't need SRAM).
Arduino Code
Main page tab:
//*********************************************************************//// PHONE SPAM PROJECT //// =========================== //// * on the phonebook but the spammers will call you without respect? //// This project is done to try to remove so much calls as possible. //// //// Open Readme or Changelog to read more. //// //// Version: 1.00 - june 2015 //// Author: Adriano Petrucci //// Web Page: http://phonespam.petrucci.ch ////**********************************************************************
#include <avr/pgmspace.h>
#include <SoftwareSerial.h>
#define VERSION 1.00 // Program version
#define REVISION 2 // Revision, until new version// Define all Arduino PINS
#define PIN_RX_HT9032 4 // Receive data at 1200 bauds
#define PIN_TX_HT9032 3 // Not used. We need it for the libraryint iTempNumberOk = -1;
voidsetup()
{
ht9032_setup(); // Setup the HT9032 decoder
serial_setup(); // Setup serial for terminaldelay(100); // Leave time for other devices to init.
serial_init(); // Write something to the serial
}
voidloop()
{
// Check if we got a phone number from decoder.if (ht9032_loop())
{
serial_showByte();
// If we got a phone number, show it to the terminal
serial_showNumber();
}
else
{
// No phone number, check if we got a byteif(ht9032_GetLastReceivedByte() > 0 && ht9032_IsReadingNumber())
{
// If we got a byte, show it to the terminal
serial_showByte();
}
}
}