How would you do it? [pulse burst detection]

Go To Last Post
7 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

How would you do it?

I've thought of some ways to implement the solution, but as usual, there will always be a more elegant way to do the same.

The problem:

I have two possible signals coming from a telephone ring detector circuit. When the call is internal, from the PBX system (image), I get 2 packs of 10 pulses separated by a 300ms interval. When the call comes from outside (telephone company) I get a pack with 25 pulses with no interval. Both packs have a total duration of 1s. How to make a ring counter which works for both situations?

My idea:

I thought about counting, let´s say, 5 pulses, and after a break of more than 500ms count as a valid ring.

Any suggestions on how to do this for the sake of learning?

Any suggestion will be welcomed.

Attachment(s): 

Good Soldering JRGandara

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

count the pulses and use a monostable technique to detect the pause. What's a monostable? Google will explain. Simply load a counter with a given value and let it count down to zero. On each pulse, load the count. When it gets to zero, test the number of rings. If it's greater than 20, then it's probably an outside call.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

How close can two different (or same) "rings" be ?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

you can either take the pulses as a measurement, but also the time between the pulses.
it either is short(pulse train busy)
medium (the 300ms wait during internal call)
long (the 1s wait during external call)
in combination with the number of pulses
10 for internal and 25 for external.
wit the internal it even is count 10 quiet little count 10 quiet 300ms and external count 25 wait 1 sec count 25
Note that probably each country has its own standard, so if you are making a one off for yourself it is fine, if you want to export, you will need to check the regulations and standards. Also check if you comply with line loading regulations .

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

how clean are the signal?
is the freq always the same ?
etc.
If not I would make a LP filter so you either get two pulses or one.
And then a timer ISR (about 16Hz) check for the pattern, and after 16 ISR's clear itself.
I say 16 because then it can be made as a SW UART, that shift a bit up each timer ISR. and then check for 3-4 bit low at start and end and 3-4 bit high in center (you get the picture I hope), it's done with just an EOR and AND.

Add:
which AVR do you use? tiny4 or mega1280 may make a difference, and do you write in C or ASM?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Kartman: That´s the way I did. I don´t have to know if internal or external, just count each ring whatever the case. I´m counting 16 pulses (present in both cases) and adding a ring count. I still have to implement the pause detector to wait at least 400ms to be sure I will be looking in the next ring pulses.

Sparrow2: The PBX and external ring are pretty much the same every time and very clean. Although I noted some missing first or last pulse in a train. That´s the reason I think I should count something like 16, which are present in both cases. Frequency is 28Hz (width high 10ms/width low 25ms), total length in both cases 1000ms. I have a general idea what you mean about the uart counting, but looks more complex to me. Using attiny2313 with C.

Meslomp: All countries should follow the ITU standards, but in this case, is a local system and we don´t have to worry about that. Load regulations are met. We are using a 600/600 ohm transformer with all the other protections needed.

Thank you all for being kind enough to spend time in this solution.

Good Soldering JRGandara

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The way I did today and is working ok:

I counted 16 pulses, added one to ring counter, reset the pulse counter and added a 600ms delay before let the pulse counter start a new count. This 600ms guarantee whatever type of ring comes, the next count will only start when the previous finished.

What do you think?

Good Soldering JRGandara