Select your language

Sometimes you want to know: "is not called in the door when no one was home?". This will help offer a musical call that has a special memory function. Made it on the popular microcontroller families R/C, as a result appears to be very simple device, capable of playing several dozen tunes and remember the last button of the call, if the door is not was opened on time.

The principle of operation of this device is as follows: if within three minutes after pressing the call button the door will not open, the next to her the opening will be a reproduction of one of the programmed tunes Other words, opening the door and hearing this tune, you'll realize that someone in your the lack of called. The rest of his work is no different from a normal music call.

In the described embodiment, the device plays 16 melodies selectable randomly. Changing codes of the control program can replace ib ringtones any other, and change their number and the playing time.

Schematic diagram of the call depicted in Fig. 1. It is based on microcontroller DD1 (PIC16F84-04I/P Microchip). The clock speed specifies quartz the resonator ZQ1. The signal 34 is removed from the pin 7 (RB1) microcontroller, is amplified by the transistor VT1 and reproduced by the dynamic head of BA1.

Call button SB1 and the door sensor SF1 is connected to the terminals microcontroller through a current-limiting resistors R3, R5. Capacitors C5 and C6 preclude inadvertent operation call from interference electrical appliances.

The device is powered by AC through a step-down transformer T1. The secondary winding voltage is rectified by a diode bridge VD1. permanent the voltage stabilizing integrated stabilizer DA 1.

A drawing of the circuit Board and the arrangement of parts therein shown in Fig. 2. Fee is designed to install the resistors MLT. capacitors K50-35 (C1, C2) and km (the rest).

Diode bridge VD1 - KTS405 with any letter index. Quartz resonator ZQ1 - at a frequency of 4 MHz. Capacitors C3 and C4 for all-ceramic capacity 15...33 pF. Transistor VT1 is any of a series of KT815. The resistance of the resistor R1 must be more than 40 kω.

As a T1, you can use any transformer that provides the secondary winding of the voltage 9... 10 V at a current of 0.3 A. In the author's version of the applied transformer TS-W-SM. in which the number of turns of the secondary winding is reduced by 90.

Button SB1 - standard for door bell, door sensor SF1 - reed. mounted on the doorjamb. On the door magnet set. When the door is closed, the reed switch under the action of the magnet is closed, when opening -opens. The sensor may be of any design.

Program listing:

(click to enlarge)

To replace the music and will look at the principle of placing them in memory microcontroller. They are located in program memory in the range of addresses 200N at 3FFH. One note is in the memory of one machine word. Every melody needs end code N. Mask M_RAND. located at the addresses N and N. determines the number of tones I. accordingly, the maximum number of notes in the melody (PL. 2).

So, if the mask is equal to F8H (32 ringtone 15 notes), then the first melody is addresses 200H-20FH. second-210H-21FH.....32-I - 3F0H-3FFH. Obviously each of them is 16 words, and the maximum number of notes in the melody - 15 (one word is reserved for code N).

Note: if at the end of the melody code no N. it will be played without stopping the next and so on until then. until you meet this code. In this case (16 tunes in note 31) the first tune is addresses 200H-21FH. second-220H-23FH, etc. the Actual number of notes (1 to 31) depends on what place will put code N. Codes notes depending on their duration and belonging to a particular octave is presented in table. 3.

(click to enlarge)

For preview the ringtones you can use music.exe.

Address VN is constant Wait_D. defines the timeout the door is opened. This is the time (in seconds) is approximately equal to Wait_D-2. In our case constant equal to AN (decimal - 90) and the waiting time is 90 · 2 = 180 sec = 3 min.

To modify the program to download the file ring.hex to hex editor (usually it is built into the software programmer) and edit, taking into account the fact that a machine word of the microcontroller PIC16F84 has a length of 14 bits and presents the four-digit hexadecimal number. You only need to replace two of the Junior category, as senior are code instructions. For example, the memory location is N the number N, and you must write the code N. By changing only the lower ranks get the number N.

It is also possible to make changes directly to the source of the program (file nng.asm). For this you need to create a Ring folder in the root directory any drive, put back the files nng.asm, ring.pjt and ring.lkr. Then in environment MPLAB v4.12 open project ring.pjt and the file ring.asm. who should edit. Then you launch the building project and get the new file ring.hex.

The project files

Author: M. Boers, Kostroma