I've pulled out my old arduino! Ready to try again 
I've got a Rotary phone connected to a VoIP ATA. The ATA expects DTMF tones, however this old phone can only pulse-dial. I've seen several Arduino projects where people connect their inputs to the rotary dial. But I want to connect my arduino inbetween the ATA and the phone.
Output of Cisco ATA is ~42-48vdc when the phone is idle. 6-8vdc when phone is in use, and 50+vAC when phone is ringing. Using a bridge rectifier I can turn all of these voltage into DC.
Next, I'm using a voltage divider to bring that all down to something safe for my arduino. Measured on my multimeter, I'm getting ~1.1v when in use, and ~3v when idle.
When I connect the 5V PSU from the ATA directly to the analogue input + ground, I get 1023. Perfect! When I connect to the divided voltage on the phone line output, I get a crazy scatter of valued jumping up and down. I used some code which gets the mode of 100 values and that seems to be fairly good - but why is it so inaccurate?
I've never been able to get good results when measuring voltages generated from something external. I couldn't smooth the input with a resister or capacitor but it just seems like I'm not going to be able to get fast accurate reading from this ATA? (When the rotary dial pulse dials, it does about approx 10 pulses per second, which isn't much - but when there's a lot of noise amongst it, it makes the readings difficult).
There are commercial devices like 'Dial Gizmo' which do it (and even get their power from the line) www.dialgizmo.com
Any advice? There must be a way.
So it turns out the bridge rectifier was responsible for the noise. Now I need a new way of dealing with the higher AC voltages... I might try a single diode.
If you just want your Arduino to detect dial pulses, you shouldn't need to rectify the voltage.
I'm guessing that the rectified signal still has a lot of ripple on it so you really need to smooth it out quite a lot either by repeatedly measuring it like you did or using a capacitor and resistor.
To actually use it as a phone rather than just a dialler is going to be more complicated isnt it? You have to somehow filter the pulses from the dialer out, inject the DTMF tones in their place but allow the audio signal through.
Did you see GitHub - markfickett/Rotary-Dial: Arduino library to receive numbers dialed by a rotary telephone dial via pulse dialing ? Although I suspect its written for an arduino-friendly DC supply rather than real telephone voltages.
rw950431:
I'm guessing that the rectified signal still has a lot of ripple on it so you really need to smooth it out quite a lot either by repeatedly measuring it like you did or using a capacitor and resistor.
As the dial pulses are "loop disconnect", I would expect the dial pulses to be 42-48V peak-to-peak. Any ripple or dial tone signal will be very much smaller.
BTW: I'm very surprised the ATA is producing 42-48Vdc. That much voltage is only needed when a phone may be on the end of a few miles of cable.
rw950431:
To actually use it as a phone rather than just a dialler is going to be more complicated isnt it? You have to somehow filter the pulses from the dialer out, inject the DTMF tones in their place but allow the audio signal through
Yes!