DTMF-Controlled Switch

This circuit can be called using your mobile or a regular telephone set (with DTMF keys) and after passing some procedures, you can control DC-powered appliances installed in your home. Examples include the front door latch and the pump of a plant watering system.


  • Controls 6 high-power DC devices Five digits password security
  • User-defined password
  • Feedback to user by sounds
  • Password and device status retained in EEPROM
  • Device status on LED panel

You call the circuit and after three rings, it will answer your call and you will hear two little beeps. Next you enter your password. The default password for the circuit is: 12345. Finish the password number with a hash (#) character. If your password is correct, you will hear two short beeps and you can control your devices or change a password. If you push the character * you will enter the password menu. Enter a new password using numbers (0-9) and with five digits length. Close off with a # at the end of the new password (e.g. 54321#). You will hear one long beep indicating that your new password is stored in memory and the circuit will disconnect the phone connection. If you do not push *, you can control your devices by entering pre-assigned numbers. For example, the number ‘1’ is for home front or rear door and every time you push it the door will open. Numbers 2-6 are for controlling five other devices. With every key push you change a device status and you will hear appropriate sounds that relate to the device status (see flowchart). After every command, the new device status will be stored in EEPROM. Once all devices have been controlled, simply hang up.

If the circuit is called but the user doesn’t enter any numbers, the circuit will hang up after 7 seconds. In all of these procedures, when you enter any number, the circuit will acknowledge reception with one short beep. Please wait briefly for the circuit to receive and process the number pressed. A maximum of three wrong password entries is accepted. With every wrong password you enter, you will hear one long beep and if you enter a wrong password thrice, you will hear one long beep again and the circuit will hang up on you. The circuit shows the status of all devices by its LED panel. D1 indicates the circuit power, D2 the answer status (ON: phone line is busy; OFF: phone line is free). The other LEDs indicate the status of the controlled devices (LED ON: device = ON, LED OFF: device = OFF).


Figure 1: DTMF Controlled Switch Schematic Diagram

The schematic diagram Figure 1 has these main parts: power supply, ring detector, answering circuit, tone decoder, microcontroller, output relays and LED panel driver. The power supply includes IC3, C6, C7 and C8 producing the +5V supply voltage for the circuit. The ring detector comprises B2, C1-C4, R1, R2 and D9. C1, C2 and C3 pick up the ring (AC) voltage of between 80V and 100V, 25Hz. B2 converts the ring voltage to DC. C4 serves for noise reduction and R1, R2 and D9 create a suitable voltage level at the PD4 pin of the microcontroller.When you call the circuit, one +5V ring pulse appears at the cathode D9. The answer circuit includes B1, C5, R4, R3 and T1. If you want the circuit to answer to one ring, put one resistor in parallel with the telephone line, reducing the line voltage to approximately 15VDC and passing about 20mA through the resistor. Answering the call implies driving T1 into saturation. Therefore the telephone line current will pass through R3. To hang up, T1 is switched off. The function of C5 is to inject a sound produced by the microcontroller. The DTMF tone decoder circuit includes R5, R6, R7, C9, C10, C11, X1 and IC2.

IC2 (an MT8870) is a DTMF tone decoder IC. It receives the DTMF tones via R5, R6 and C9. The corresponding binary data of each code appears on the Q1-Q4 pins. An incoming code is indicated by a rising edge on the STD pin. The event is fed to the INT0 pin of the microcontroller. A High level on the TOE pin of the MV8870 enables the outputs Q1-Q4. Here it is strapped to the +5V rail. The micro is an ATMega8 from Atmel. The final stage has a ULN2003 high voltage and high current Darlington transistor array IC, that easily copes with the relay and LED panel currents. Each output pin of this IC can drive up to 500 mA. The LED panel includes D1-D8 that indicate circuit activity and status of all devices. Caps C11 and C12 are included for noise reduction and it is to use multilayer capacitors ceramic for this purpose.

dtmf-2Figure 2: PCB Layout

The PCB for the controller is shown in Figure 2. One PCB section comprises the main circuit the other is for the LED panel. The two PCBs are interconnected with a 10-way (2×5) IDC connector.  Connect the 9-12VDC mains adapter to J1. Next, program the microcontroller by means of the ISP socket, K2. Select an 8-MHz internal clock source for the micro by setting the fuse bits per Table1.

dtmf-3Don’t forget to program both the Flash (filename.hex) and the EEPROM (filename.eep) file! Connect your electrical appliances to the circuit observing all relevant electrical safety precautions. The EEPROM in the circuit ensures that settings are not lost after a reset or when a mains power interruption occurs. Finally, we can calculate the security of the system. With a five-digit password, we have a 1 in 100,000 probability of hitting the correct code by chance, which seems adequate for such a simple system.

Caution. This circuit is not approved for connection to the public switched telephone network (PSTN).

Caution. Observe electrical safety precautions when connecting mains operated loads to the circuit !


B1,B2 = B40C1500 (80Vpiv, 1.5A) D1-D8 = LED, low current, 3mm D9 = zener diode 4V7 400mW D10-D15 = 1N4001
T1 = BD139 IC1 = Atmega8-16PC IC2 = MT8870 IC3 = 7805
IC4 = ULN2003 RE1-RE6 = 12V coil X1 = 3.5795MHz Resonator
C1,C2,C3,C5,C9-C12,C15 = 100nF C4 = 2μF2/40V radial C13 = 1000μF/40V radial C14 = 100μF/40V radial
R1 = 68kΩ R2,R4 = 1kΩ R3 = 330Ω R5 = 10kΩ
R6 = 100kΩ R7 = 220kΩ R8-R15 = 220Ω

Support Documents