Connect a microcontroller to a telephone line is a rather technical task and requires knowledge concerning the operation of the line, but it is not an impossible task, although it can be dangerous, and sample some nasty shocks if you're not prepared for such work.
Initially you should build a rectifier circuit, mainly for its polarizing power circuit, since you do not know which is the antibody positive your telephone line but know that tensions are measured inversely ie, when measured with respect to ground (GND) the measures will be negative, this is because it was discovered that the poles of the batteries used to be gnawed less well when connected to the system.
A second step is you develop a small coupler to avoid connecting your circuit directly to the telephone line. For this you can use a pair of low-pass filters, which are placed at each connection point of the line after the bridge rectifier, and the downside of the bridge rectifier is connected to ground your circuit with this filter. And the plus point is connected to a PWM output of your controller.
Other important information you can not connect the PWM port directly to this filter, because the voltage levels in the telephone line are quite different, namely:
- When the line rings you get a voltage exceeding 60V oscillating above 20Hz.
- When the line is in standby mode it remains between 30V and 48V as your carrier and region.
- When the line is busy or because your circuit or another extension you will have a voltage between 6V and 12V.
- Already the audio modulation in their line occurs with peak 0,7Volts equivalent to 3dBm therefore its PWM output should give output like this.
To match the level of your line voltage with the telephonic system you can use a voltage divider which has an output of 0 to 0,7Volts ie when the door PWM pulse maximum output voltage of 5V should be 0,7Volts the divisor resistive. Another way is to use an operational amplifier having a gain reverse, thus reducing output. you can also use a optoacoplado circuit with 4n25 and thus polarize the phototransistor for such variation with the pulses in your diode.
Another important component in this circuit is a pair of diodes to be done clipping the signal, ie, as our voltage limit for audio is 0,7Volts after the filters put a couple of diodes between the positive and negative of your signal filtered in the bridge rectifier, so prevent signals above this level reaches the arduino when ouver noise on the line.
More Information: http://carlosdelfino.eti.br/WorkshopTelefoniaAutomacao/
