News:

"The phone is a remarkably complex, simple device,
and very rarely ever needs repairs, once you fix them." - Dan/Panther

Main Menu

Detecting pulses, or digits.

Started by mR_Slug, February 08, 2024, 02:52:50 PM

Previous topic - Next topic

mR_Slug

I have searched high and low on here and the internet, I cant find it.

Is there a simple circuit to interpret a number dialed, say a 1 and then activate a relay? Ok there's a Strowger, but is there something simpler? How do you actually detect digits? Just a relay across tip+ring?

Here is what i am trying to achieve. I want to connect a local battery magneto phone to a FXO port on a Cisco 2901 router. But I don't want to modify the phone. The FXO port seems to be a better fit than an FXS port, as it can recieve a ring, and be programmed to dial an extension, or operator.

In the other direction, the router can also initiate a call. It connects the loop and dials a number, tone or pulse. Now we don't need to dial the phone, but if we can capture the dialed number, we can then activate a relay, and send a ring to the phone. Basically a dial to ring converter. Now this could be extended to provide selective ringing. A 1 could produce one ring frequency, a 5 another. I suppose another method would be ring on loop connect. 

I think I'm coming at this from a different direction, What i want is to emulate the interface that magneto phones use, but have a connection to the world. I want to have the phone operate as it originally did. Question, do you ring off to end a call that you recieved?

I'm of two minds, keep it very simple/possibly vintage components, or build something modern that could perhaps allow for voltage discrepancies + other features. Also of interest how was LB and CB interfaced when CB was new?

This operator could be an asterix server with voice recognition. Another project I'm looking at.

Any pointers or ideas? Can someone give me a simple circuit showing pulse detection, I guess then you need a counter to detect the digit.

Thanks.

countryman

When I was young I built a small automatic phone exchange for a few extensions. It still exists but I did not fire it up in a long time... I used a decade counter to count the pulses, I believe it was a 4017 CMOS IC.
https://www.elprocus.com/ic-4017-pin-configuration-application/

A zener diode would submit voltage to the clock input whenever the line voltage goes higher than e.g. 20 Volt. A timer circuit would reset the IC when high level voltage is on the line for more than 1 second (phone on hook).
More details would have to be observed but a decade counter can emulate a strowger selector quite well.

ka1axy

Detecting a dialled number could easily be done with a cheap processor, like an Arduino. It's all in the timing. Detect loop current with an optocoupler and use the Arduino to look for a transition to open loop...which is either a hangup or the first pulse of a dialled digit. If the loop current returns in 0.1 sec or less, you have a dial pulse.

Keep counting pulses until you *don't* get a transition to open loop within 0.1 sec. That's the end of the digit. Now, look for another digit. If you don't get one within, say 5 sec, consider the dialled number complete and pass it on for further processing. (someone will no doubt post a link to a BSP with the exact timing spec)

Place protection around the optocoupler to bypass the high ring/magneto voltage and current. Arduinos are very easy to program and very versatile. They're about $20 and you program them with a PC or Mac. They are designed to be used for this sort of thing.

5415551212

I highly recommend getting a key system powersupply, and a 66 punch down block.
It makes experimenting easy and fun.

I did a silly fun intercom for kids to play with using a DP-1900 intercom combined with a key powersupply (I salvaged from a job). However instead of ringing each phone when dialed I set it up to blink lights (as kids ringing phones gets annoying).
My setup required an extra pair to each phone, and I used 10VAC as that works with dial lights and key phone lights (already in my old phones) or four 2.5 volt Christmas lights (also salvaged) in series added near the phone off the second pair.

I second the idea to use an Arduino with the opto isolators.
You would need a ringing power supply to get the 90-105V @ 20hz and a relay that can be controlled by the Arduino.


ka1axy

Quote from: ka1axy on February 08, 2024, 07:21:12 PM(someone will no doubt post a link to a BSP with the exact timing spec)

It's in Notes on the Network, section 6.10


mR_Slug

Thanks for posting the spec and theory of operation. There are many ways to control this, but at present that is not my main concern. It is the actual dial pulse receiver apparatus labeled A in the diagram. I've played with counters before, its the input to the counter from the line that i want to understand.

For an FXO port, I would assume i'd need a circuit to simulate a line. As I understand it tip and ring need to be tied together. When the FXO port dials, there is in addition, the pulse detection circuit requirement. How was this originally done? This is the bit i'm hung up on.

I think in this application, a single stage, single digit detection would be sufficient. Don't think more than 10 on a party line, is fun :) . It could be simplified even further to detect any digit and ring if selective ringing was not required. My primary interest lies though in providing an interface for an unmodified magneto phone.

countryman, having a bit of trouble understanding how you would connect that zener?

As for going the other way, and doing it with vintage electronics, this is something i'd like to explore. Are there small uniselectors?

5415551212

So you have a Cisco 2901 (PBX) with some FXO and FXS ports installed and you'd like a local battery maginito phone to ring the Cisco over a FXO port and have it answer ?
 

ka1axy

#7
Quote from: mR_Slug on February 09, 2024, 08:41:35 AMThanks for posting the spec and theory of operation.

OK, as to the input from the line to the counter -- The Phone Company used a relay there, and it activated when it sensed current flowing in the loop. We don't need to use a relay, an optocoupler will do the trick. As to the counter itself, the phone company used a selector, so if you can find one, go ahead, but I think you'll find that an Arduino is cheaper, more available and not too hard to program. The selector had a couple of other relays attached to it to sense the long gaps between digits and the long break in loop current to reset it, so just a selector isn't enough to detect a digit and then reset itself.

I'm not totally familiar with the Cisco FXO port, but it sounds like it emulates a telephone set - outgoing dial and incoming ring (from the magneto in this case). So you'd need to provide loop current (you say you have local battery for this) and detect the FXO port going off-hook and dialling. This would be done by the Arduino and the optocoupler in series with either the Tip or Ring wire.

In the drawing I posted, the Cisco FXO port is on the left and your phone is on the right, the "loop" is the Tip and Ring wires of each device connected together (Tip to Tip, Ring to Ring). So that little box on the right is the optocoupler and the phone itself is connected in parallel with that.

Some more details on how to protect the optocoupler from the magneto "ring" voltage coming from your phone. The optocoupler input is an LED, which requires an external resistor to limit the current through it. You usually want about 20mA through the LED, so depending on your loop current, you may need to do some calculating and build a current divider so you don't put ALL the loop current through the optocoupler LED (which would reduce its life). Once you get that figured out, you'll want to put a bidirectional TVS (transient voltage suppressor) across the optocoupler. Pick a voltage for the TVS that is perhaps 25% larger than the voltage you measure across the optocoupler when there's current flowing in the loop. It will be something around 2-3 volts, so a 5V TVS would work fine. This will clamp any magneto voltage to a safe level. A TVS is just a pair of hefty zener diodes back to back, so if you can't find one, use a couple of zeners in series (anode to anode). You want the full magneto voltage to be seen by the FXO input, so you don't want to clamp across Tip and Ring. Instead, you go across the optocoupler diode, and the TVS shorts the diode out when it sees more voltage than regular loop current generates. The series resistor for the optocoupler limits the current through the TVS and allows a voltage to develop across T/R.  All this sounds complicated, but it's simple when you draw it out.

The output of the optocoupler is usually an open collector transistor, which, with a pull up resistor to logic supply voltage, becomes the "Loop Current Sensed" input to your Arduino, which does the actual pulse timing/sensing and counting and (if needed) switches a ringing supply onto your telephone set.

mR_Slug

#8
Sorry its been a few days, been trying to read up on things so I can respond better.

QuoteSo you have a Cisco 2901 (PBX) with some FXO and FXS ports installed and you'd like a local battery maginito phone to ring the Cisco over a FXO port and have it answer?

Yes, but a bit more than that. What I want to build is an interface that is the same standard that lb magneto phones used. I want a device that I can connect these old phones to. It differs obviously compared to modern systems. For example the ring on ring off procedure. But I also want it to be connected to a standard telephone network. To me, interfacing to an FXO port seems like a better idea than an FXS port. As far as i'm aware the router is not capable of initiation of a call without dialing a number. If it were, we could just detect the closed loop, and initiate a ring to the phone. However, instead we can dial a number, this can be used to initiate a ring. This is where i'm at.


ka1axy

I guess the reason you are suggesting the optocouple instead of a relay, is the spec it requires, I.e ~100V ac tolerant AND closes at loop voltage. Curious could an miniature inductor be used to provide the pulse detection? Saw this, http://www.unterzuber.com/tap.html

I'm not very familiar with optocouples except the setup in old mice. "All this sounds complicated, but it's simple when you draw it out." Yes i think i just about follow you but can you link to a diagram?

Thanks for your explanation of the old relay pulse and digit detection. Don't suppose anyone can supply a diagram? I love relay logic. As far as I'm aware the Cisco FXO port just follows the standard. Here is a high level diagram that shows the basics as i understand it.



I'm not quite sure how a digital telephones or FXO ports take the audio. What is the peak-to-peak of audio on the standard telephone interface? I guess the DC offset is not that important? to the FXO port, however is the peak-to-peak audio of magneto and modern phones much different?


ka1axy

#9
Think the fundamental problem here is the magneto. If that's the way you want to initiate a call, you're going to have to use a FXO port on the router (because only FXO can detect ring voltage).

Problem here is that you're "ringing" the router with the magneto. That's fine, the router (acting as a phone) will see the magneto voltage and answer the call (you'll need to figure out how to shut the magneto output off when the FXO port goes off-hook).

If the router wants to connect to your phone, it's going to need to ring it. An FXO port can't do that (it's a phone so can't generate ring voltage), all it can do is go off hook and dial. So your magneto phone needs to be able to do two "extra" things: detect dialling, and generate its own ring voltage when it detects its extension number has been dialled.

So 2 problems, really: you're using the router's ports backwards to accomodate your lack of a dial and the presence of the magneto, and because of this, your phone needs to detect outpulsing from the router in order to ring itself. That means it also needs to be able to stop its internally generated ringing when you take it off hook.

It's certainly possible to do this, but it does seem to be doing things the hard way. You also mention that you'd like to add a number (< 10 ) of phones off this single router port, without a PBX. Each one of those phones would need one of these number recognition and ring generation circuits, and those without magnetos wouldn't be able to get the attention of the FXO port, unless they used their ring generators to "ring" it.

You see how the challenges kind of multiply?

Your diagram is basically correct for the case of one phone. You could certainly  centralise the pulse counter at the expense of running an additional line to each phone to ring it. Don't know if this would work for you but it is definitely a way to simplify things.

mR_Slug

In short i agree. One thing i want to clarify is that it is not really a pbx. What I envisioned was a party line with multiple magneto phones. As we are generating a ring, we can use the most basic form of selective ringing, code ringing. A 1 has one cadence, 2 another and so on. All the subscribers hear the all the rings. We just map the number to a "ring tone", In code its really simple to add. Now i suppose the device is kind of like a pbx, it routes calls based on a number, but the route is always the same line, just the ring differs. This way you can either have a single magneto connected the 'posh-top-hat'/expensive dedicated line way. Or it can double as a party line simulator for the 'pauper-working-class' :).

Quote from: ka1axy on February 14, 2024, 05:27:48 PMThink the fundamental problem here is the magneto. If that's the way you want to initiate a call, you're going to have to use a FXO port on the router (because only FXO can detect ring voltage).

Problem here is that you're "ringing" the router with the magneto. That's fine, the router (acting as a phone) will see the magneto voltage and answer the call (you'll need to figure out how to shut the magneto output off when the FXO port goes off-hook).

Ahh now I forgot about this, never heard what a ring sounds like through the earpiece, I should imagine its not pleasant. How was this handled back in the day?
As I understand it, you ring then lift up and wait for the operator but there is no tone?

Quote from: ka1axy on February 14, 2024, 05:27:48 PMSo your magneto phone needs to be able to do two "extra" things: detect dialling, and generate its own ring voltage when it detects its extension number has been dialled....It's certainly possible to do this, but it does seem to be doing things the hard way....and those without magnetos wouldn't be able to get the attention of the FXO port, unless they used their ring generators to "ring" it.

You see how the challenges kind of multiply?

Yes. But it seems to me, (correct me if wrong) harder to interface to an FXS port. It can generate a ring, and receive digits, but none of the phones have dials. Also the phones can generate a ring, which the FXS port wont like. You also need a magneto-ring to number-dialer converter. Not saying it can't be done, but looks harder to achieve. Would like to point out that I don't intend to attach CB and automatic dial phones to the device. They can hang off a FXS. Open to suggestions though.

I've been reading https://www.epanorama.net/documents/telecom/teleinterface.html and came across the back-to-back zener setup in an audio circuit. If i have understood correctly this will clip audio close to its voltage. In the pulse detection you describe this is exactly what we want though. So I at least understand a TVS now. 

5415551212

I second the idea of doing the ring circuit on a dedicated pair, like a key system.

Since magneto phones only connected to a human operator I could see building a special 'magnito card' that answers ringing then implement some voice recognition, like alexa and have that place your call. 

G-Man

#12
If you want to create a standalone, magneto party-line with coded ringing, I do not understand why you want to decode dialed digits or to connect it to a router/ATA.
 
So if it is to be standalone, what is the advantage of using the router?

Of course if you wanted to connect your party-line to a conventional common battery telephone, depending on the router/ATA, you may be able to program it for ringdown service to a specific station.
 
That said, wouldn't it be easier to use an inexpensive, off-the-shelf Rotary/Touch Tone intercom to decode the digits. Some of those manufacturers included MELCO, TELTONE, etc.
 
Also, remember that an FXO port wants to see 24-48 D.C. volts except during the period that it is detecting ringing voltage.
 
 And while an FXS port could also be used with a simple adapter, the primary problem is that with the exception of a few, most magneto sets are not configured to provide D.C. continuity to hold the connection at either of those ports.
 
Another point to remember is that magneto sets were often used on party-lines and could signal both others on the same line or the operator, who through her switchboard, could manually switch a call to other subscribers, whether they were on another magneto, manual or dial common battery line, or to the long-distance operator.

Catalina Island, California, Virginia City, Nevada and Bryant Pond Maine are some more modern examples of this.

However there were other variations of magneto sets that allowed their use on common battery lines but they are not commonly available.

Oh, by the way, coded ringing is NOT selective ringing, it's quite the opposite where everyone can hear the others ring.
 
But of course I may be misunderstanding what your goal is, so it may be that none of the above is applicable to your project.
 
 
 

G-Man

There are ways to provide for selective ringing on magneto lines but currently they are not practical since polarized or frequency selective ringers are no longer commonly available. Ditto for the means of generating the required polarities and frequencies for these ringing schemes.

G-Man

This film shows how the operator switched both common battery manual and local battery magneto telephone lines. While the Catalina and Michigan used combined manual/magneto boards, the Virginia City board was strictly magneto. The dials shown on these boards were for calling other exchanges.
 
"A visit to the Bryant Pond (Maine) Telephone Company in 1981. Bryant Pond was the last place in the USA to convert from a hand crank magneto telephone system, which was in use until days after this video was taken."
Starting at the 6:17 mark-