Interface Arduino with Headset Serial Bus

I would like to interface an Arduino with an Plantronics Headset. The headset communicates with a desk phone though an adapter cable, that adapter cable also provides a 3.5mm jack that has 3 pins:

Tip - 9vdc (to power an external device)

Ring - Data Out (pulled up to 5v)

Sleeve - GND

Luckily someone has, for the most part, decoded this serial protocol:


Basically it outputs the following:

000011010000000110000000110011011001 (when on-hook) 000011010000000110000000101011011010 (when off-hook)

The signal is at 4500 Khz each Bit lasting 225us. (the link is more descriptive)

Normally a small "Online Indicator" is plugged into this port that alerts people when your using your on the phone. I would like to have a large traffic signal connected to this in my office. :)

I already have the Arduino connected to the light and flashing it. I just need to know how the Arduino can detect the on-hook/off-hook signal. I've seen more complicated things done than this so I know it can be, this is just slightly beyond my scope of expertise. So if anyone has any suggestions it would be much appreciated! Thanks!

Just as a guess, I would expect that you'd read this signal into an interrupt setup to respond to CHANGE. Then with a timer, you could track how many successive 0's or 1's went by. The onhook/offhook sequences are different, so you can derive from them a sequence of times between state changes (0 to 1, 1 to 0), and compare your incoming sequence to the known expected sequence for each case.

Do you know of any example sketches that do this or something similar?