Control your world from your cell phone, III

5 April 2012

Power Up and Testing

I had already tested the POTS interface, but I assume nothing when new wiring has taken place. It is very easy for a small wire shard or solder ball to wedge between two or more connections covertly and really muck things up. After a close and thorough inspection of the wires and connections, I hooked up 12V to the banana jacks and applied power. No bellowing yellow smoke is always a good sign.

Using a meter, I probed all 12V and 5V points and verified that I had good grounds at all points and pins. I powered down and inserted the ICs (another reason sockets are good to use for prototyping). At this point, I could power up with all parts installed. I also plugged in the phone lines and a local handset.


Fig. 11 – The DTMF tones riding on the 2.5V DC center-point was accurately decoded as 1101, which is 0010 inverted. The LED above the decode LEDs is the Off-Hook detect.


Table 1 – With the outputs enabled, the binary codes corresponding to the 12 DTMF keypad signals could be verified. When we build a DTMF transmitter, we can test A-D.


Fig. 12 – With audio being transmitted out from the boom box source, the DTMF decoder was still able to pick up and decode the tones and output valid binary codes.


Fig. 13 – With reliable DTMF decoding out of the way, our next step is to create a digital combination lock that will serve as a security code to allow access to the control circuits.


Fig. 14 – A simple 2 inch by 3 inch PC board holds all the components and connectors for the DTMF decoding function. By matching the pin-outs of the POTS interface board, this PC board can ‘snap’ onto the POTS interface board without any cabling.


When power was applied, the Data Valid LED lit up. Since there is no data valid, this is correct. Remember, the LED is negative logic and lights up when a signal is inactive (as do the D0-D3 data bits). It goes out when data is valid. In this way, its rising edge can be used to latch the value into a latch.

With a scope wired to monitor the audio in from the phone lines, I picked up the handset and watched as the Off-Hook detect LED lit up. I didn’t see the dial-tone on the scope until I put the scope into AC mode and adjusted the sensitivity to 10 mv per division. The dial-tone signal was only around 10 milli-Volt peak to peak, but, it was there, and audible in the handset earpiece.

With the scope on DC mode I adjusted the sensitivity to 1V per division and set the trace zero line to center. This moment was the moment of truth. I pushed the number one button on the phone keypad and heard the DTMF tone. There on the scope was the DTMF signal and the LEDs on the board lit to display a 1110 pattern indicating a value of 0001 (remember to invert). On to two and there it was, 1101. (See Fig. 11.)

I sequenced up the keypad and watched as the negative logic binary count tracked and followed the binary number corresponding to the digit pressed. I was able to verify the 12 codes available to me on the keypad, but I would need to make a DTMF transmitter to get the other four. (See Table 1.)

It was time to test the audio output section. I used an old boom box and plugged in a mono cable into the headphone jack. I know this jack will only give me one channel of the stereo audio, but that’s OK. It’s perfect for testing.

I figured this would be a good level to allow experimentation. All of us have access to some audio device, such as a tape player, CD player, Radio, Ipod, etc. A ‘music on hold’ feature is a perfect application.

With a test wire soldered to the output of op-amp U2-d (pin 14), I could monitor the level shifted audio that I was presenting to the transformer on the oscilloscope channel 2. It also is set for 1V per division sensitivity in DC mode, as is the receive. I want to be able to see both traces simultaneously to see how much isolation the transmit and receive side have from each other. 

I turned on the boom box and could see the audio from it on the scope channel 2. As I adjusted the volume control on the Boom Box, I could see the waveform clipping at a little over 3.5V.

To test, I was using the LM324 we had used in previous projects. While it is a good general purpose part, it is not a rail-to-rail op-amp. That means it will never hit a true 5V level or a true zero-volt level for that matter.

In Part 1, we used an op-amp that was rail-to-rail and was similar to the National Semiconductor LMC6044IN/NOPB quad op-amp. The rail-to-rail feature would allow it to get a full voltage swing. I installed one of these parts and tested again. This time, the waveform was clean without any clipping, and I could get the full 5V waveform.

I wanted to see how well the 2-to-4 wire function was working. While the audio stream was playing from the boom box, I pushed and held one of the DTMF buttons on the local handset. I was happy to see that virtually no crossover was present. I did not see any receive audio being transmitted back out. Likewise, I did not see any transmit audio entering the DTMF decoder. (See Fig. 12.)

As a final test, while the audio was being transmitted out over the telephone lines, I sequenced a bunch of DTMF signals from the local handset. The decoder was able to pick up each one and decode the corresponding binary values on the digital outputs. The Data Valid signal transited each time. We now have clean and reliable DTMF decoding, even while audio is being sent out. 

Putting it to Work

Our next step is to make it control things. You do not, however, want just anyone who calls your line to be able to control your appliances, lights, and equipment.

We can use digital logic chips and/or PLDs to create a sequencer that will decode when a valid sequence of digits has come in. This function acts as a digital combination lock that only provides access if you know the proper preamble code. (See Fig. 13.) Likewise, we can use a microcontroller. Both exercises are good for learning.

There are advantages to both approaches. There are also disadvantages.

A micro can mean less chips than a logic design, but, a PLD or FPGA can do this in a single chip as well.

Micros and PLD’s need programming. Furthermore, a setup feature would be nice to allow non volatile memory to store access codes. While this is another chip, it can eliminate the multiple DIP switches and even provide different access codes for different functions and users.

In the next installment, we will look at both approaches. In the meantime, a small modular PCB can be made of just the DTMF decoder if desired. Since I defined all parts as through hole, I was able to place and route an example PCB layout in a 2 inch by 3 inch, double-sided printed circuit board. (See Fig. 14.) 

This board is not being fabbed at this point, but it could be if there is a lot of reader interest. We can do the same with the POTS line interface board. What do you think? What ideas come to mind when you think of using these boards and functions. Your world is yours to control.

Have fun and let us know what you come up with. Also let us know if you want us to fab this board as well as the POTs line interface board for student, inventor, and hobbyist purposes.

Dr. Gizmology









Page 1 | Page 2 | Page 3

Review Part One of this project here: Build your own crack 'POTS' Visit Building Innovation for more great projects from Dr. Gizmology.
Also available in the Building Innovation series:
Build a 'Hall Effect' sensor interface, and Build an interfacing linear sensor

Leave a Reply


* * *


New Products From Avnet

  • HP 3PAR StoreServ 7000

    The world’s most advanced storage platform has extended its midrange offerings, delivering effortless, efficient, bulletproof, and future proof storage to the entire midrange. Store all of your data on a single system that supports advanced features, such as storage federation and automated tiering, and which enables you to start small and grow without disruption.

  • Advantech RISC Computing Platforms

    UBC-DS31 is powered by a Freescale ARM Cortex-A9 i.MX6 dual core processor, with 1GB DDR3 memory & 4GB flash onboard. It has 2D and 3D graphics built in, and supports dual displays with up to 1080p high resolution output on low power consumption.

The Way Back Machine

The Way Back Machine

Connect With Us

Find us on Facebook

Follow us on Twitter

SELECT id,views_count FROM wp_bs WHERE bs_date='2014-04-25' AND bs_post_id=5945