Project DescriptionWe will be using an MT8870 DTMF module with an Arduino UNO to control a small servo motor in this project. The DTMF module gives the Arduino super-powers and allows you to control the Servo motor in so many ways. For example, this tutorial will show you how to control the servo motor using:
- a YouTube Video
- a voice recorder
- A web application (Online tone generator)
- A smart phone app (DTMF Pad)
- A touch-tone phone to cell-phone call
The MT8870 DTMF decoder is quite a neat little module that allows you incorporate DTMF technology into your arduino projects. DTMF stands for Dual-Tone Multi-Frequency. DTMF tones are commonly associated with touch-tone phones and other telecommunication systems. When you press the number "1" on a touch-tone phone, two sine waves with frequencies: 697Hz and 1209Hz are combined to produce a unique DTMF signal which can be transmitted through the phone line. The MT8870 DTMF module can take this signal as an input, and decode it to produce a binary output.
The DTMF module does not care how you produce the DTMF tone. However, if it receives this tone, it will decode it. We can take advantage of this feature to supply the module with tones from different sources. The module has a 3.5mm port for line input. Providing you can connect your DTMF source to this line input in some way, it should work. I must warn you, however that this is a line input and NOT a microphone input. If you wanted to use a microphone, you will need to boost or amplify the signal before sending it to the DTMF module.
You will need the following parts for this project
- Arduino Uno or compatible board
- ICStation MT8870 DTMF decoding module
- Jumper Cable (Male to Female)
- Hobby Servo Motor
- A cable to connect DTMF source with MT8870 DTMF Module's 3.5mm port
- A voice recorder (optional)
- 2 x touch-tone phones / smart phones (optional)
- Arduino IDE
- DTMF Pad by IEIRISOFTWARE LAB. (for iOS devices)
- DTMF Tone Generator by Andrew M. Knott (for android devices)
- Online Tone Generator
- A YouTube video with DTMF tones
Upload the following sketch to the Arduino.
Connect the Arduino to the MT8870 DTMF module, and to a Servo.
Use the following Fritzing sketch as a guide.
You will need to connect a cable from the DTMF module's 3.5mm port to that of your smart phone, computer, voice recorder or any other DTMF source of your choice.
When you power up your Arduino, the Servo motor should turn all the way to the left to it's zero position.
Once the DTMF module receives a DTMF signal, it will identify the relevant frequecies as described in the table at the beginning of this tutorial,
and produce a binary like output. You will notice the DTMF module's onboard LEDs light up when a tone is detected.
Onboard LED (D5) will turn on for the length of the DTMF tone it just received, and turn off when the tone has stopped.
On the other hand, the onboard LEDs (D1 to D4) will light up depending on the tone received, and will remain lit until the module receives another tone.
The onboard LEDs are a visual representation of the voltages applied to the DTMF module's pins (Q1 to Q4, and STQ).
Q1 matches D1, Q2 matches D2 etc etc. and STQ matches D5.
You will notice that there are two STQ pins on the DTMF module. The STQ pin that is closest to Q4 will only go high when a DTMF tone is detected, and will remain high for the duration of the tone. The other STQ pin is the exact opposite. It will switch LOW when a tone is received and remain LOW for the duration of the tone. When there is no tone, this STQ pin will remain HIGH. The table below provides a summary of the DTMF module outputs, with a blue box representing a voltage applied to that pin (HIGH), whereas a black box indicates no voltage applied (LOW).
In order to follow this project, you need a source of DTMF tones. You can produce DTMF tones using a touch-tone phone, or through the use of a DTMF Pad app. If you are feeling creative, you can create a DTMF song/tune like the one I posted on YouTube. You can see the video below:
As you can see from the video, I also recorded the DTMF tune onto a voice recorder, and was able to control the servo that way. If you are not feeling creative, you can visit this website to create DTMF tones from your browser.
This project was very fun, and shows some novel ways to control your Arduino. After completing the project, I realised that I could use this module to alert me when new emails or messages arrive on my phone or computer. If you have the ability to change the email or message notification sound to a DTMF tone, you should be able to get the module and Arduino to respond accordingly. Oh well, maybe I'll save that project for another day.
If this project helped you in anyway or if you use my code within your project, please let me know in the comments below. I would be interested to see what you did.
Visit my ArduinoBasics Google + page.
Follow me on Twitter by looking for ScottC @ArduinoBasics.
I can also be found on Pinterest and Instagram.
Have a look at my videos on my YouTube channel.
However, if you do not have a google profile...
Feel free to share this page with your friends in any way you see fit.