Introduction: DIY Altoid DTMF Encoder/Generator!
We take it for granted in the modern age, but just a couple of decades ago (!), I still vividly remember using my rotary phone to dial out. Sometime in middle school, with the advent of three-way calling, our family switched over to a Touch-Tone phone. Replacing the familiar clicks were now DTMF frequencies for each key pressed!
This works because DTMF uses 2 tones of specific frequencies in the human hearing audio range to encode each number pressed on the phone. Pulse dialing worked by mechanically hanging up the line over and over in specifically time patterns. New equipment doesn't always understand pulse dialing but given that the touch tones are played as audio, it is possible to just play them into the microphone of the telephone.
Put in another way, let's say you've recently acquired a rotary phone, or a phone that isn't Touch-Tone enabled, what then? Fear not! With this nifty DTMF generator, play the tones directly into the telephone handset microphone and your telephone system will believe you have touch tone dialed a number!
- Microcontroller - We used a Propeller board we had created, but you can use any MCU capable of creating 2 sine waves simultaneously.
- Power Switch - Preferably one that can be mounted to the side of the altoids tin
- Battery - Ensure this can power your microcontroller. Our's happened to be a 3.7V lithium battery pack formerly used in a cell phone
- Altoids Tin - Minty freshness! (Or at least you will be to get the Altoids tin!)
- 3x 10uF capacitors - These do not need to be polarized and can be SMT or Throughhole
- Soldering Station + Solder
- Drill Press + Drill Bits
- Double-sided tape
Step 1: Program the Microcontroller
The schematic we will be following is as pictured. We happened to use a Parallax Propeller microcontroller so the code available through this link is for that:
Or if you'd rather not download a zip file/would like to browse the code first, here're pastebin versions of the Object and the main code:
Object:http://pastebin.com/tGjmzWvP (You just need to have this spin file in your library somewhere for the Main Code to reference when it is first burned onto the eeprom)
Main Code:http://pastebin.com/4U93hGs2 - This code produces the DTMF/TouchTone tones!
To hear how it'd sound:https://soundcloud.com/tymkrs/dtmf-mf-acts-st-kp-k...
Step 2: Connect 3x 10uF Capacitors to Your MCU Board!
We happened to have a small Parallax Propeller prototyping board available that we had made, but you can use any MCU that is capable of producing 2 sine waves simultaneously.
- Connect a 10 uF capacitor between pins 0 and 1.
- Connect a 10 uF capacitor between pins 1 and 2.
- Connect a 10 uF capacitor between pins 2 and 3.
We chose to use SMT capacitors and just solder them onto the pads, one after another. Note that we're just borrowing the pads for Pins 2 and 3 as soldering points but NOT using those pins on the Propeller for anything!
Step 3: Connect Your Capacitors to GND and Audio
- Solder/breadboard a connection from pin 3 of your MCU to Ground.
- Then solder/connect a wire from between the capacitors sharing the connection to Pin 2. This will be your audio output line.
Step 4: Add a Switch to Your Power Supply
We happened to find a 3.7V Lithium battery pack which still had plenty of juice left in it for our purposes! Please do this carefully if you do it the same way we did it, you do NOT want to heat this battery pack up anymore than it has to be.
Since you don't want the battery pack to be constantly drained by the circuit (nor would you want your microcontroller constantly on), add in a power switch.
- Solder a wire to one of the power switch leads.
- Solder the end of that wire to the battery's + pad.
- Then solder another wire to the other lead on the power switch, and solder that/connect it to your MCU's VDD (whatever rail is powering the microcontroller).
- Solder a third wire to go from the MCU's GND to the battery's - pad.
Step 5: Add in Your Speaker
- Using a small 8 ohm speaker, solder your + terminal on the speaker to the small wire coming off of capacitors 2 and 3 connected to your microcontroller.
- Take off some of the insulation around a small spot in the GND wire (that's now between the microcontroller and the battery, and solder a wire between your - terminal on the speaker to the newly exposed wire.
Step 6: Put It Together!
An altoids tin just happened to be the perfect size for this project, and who can resist its charm? Double-sided tape is also your friend in this endeavor!
First step is just to adhere the microcontroller to the battery pack. Double sided tape - bam! Since the pins required for programming the Propeller are on this board, make sure you allow for access!
Place another piece of double-sided tape on the back of the battery pack, but do not expose it yet.
Step 7: Expose Sound Holes for Your Tones!
You probably don't want to mar the Altoids front logo, so your speaker will most likely go in the back - so nutritious!
- Make light marks at N, S, E, W.
- Add marks for the center, and then going clockwise, go out 4mm from the center towards N, NE, SE, S, SW, and NW
- Use your drill and an appropriately sized drill bit to make your small holes! You may notice there are 4 additional holes there, that was because I initially thought I would screw mount the speaker onto the tin, but then I remembered that double-sided tape was my friend!
Step 8: Mount Your Speaker
Add a couple of double-sided pieces of tape to the edges of your speaker, and press down! Make sure the speaker lines up with the holes you just made.
Step 9: Make the Hole for the Switch
Get a matching drill bit for the screw/mounting portion of your switch and drill!
You may choose to tap where the bit goes or start with a pilot hole and go up in drill size. I felt that the metal was thin enough that my drill bit could handle it without becoming damaged.
Test the fit to make sure it works. Also make sure that your lid can close with the switch in place.
Step 10: Finish It!
Now you can finally take the sticky tape protection off of the piece you had placed on your battery, and adhere this to the lid of the tin! You may be asking why I chose to put it on the lid.
- The speaker was on the bottom. and,
- I wanted access to the programming pins so that you could easily program it!
Now when you close it, and hold down the button for a few seconds, you can hear your tones being played, and play them directly into your pulse phone!
We have a be nice policy.
Please be positive and constructive.