Menu English Ukrainian russian Home

Free technical library for hobbyists and professionals Free technical library


ENCYCLOPEDIA OF RADIO ELECTRONICS AND ELECTRICAL ENGINEERING
Free library / Schemes of radio-electronic and electrical devices

Memory music call on PIC16F84. Encyclopedia of radio electronics and electrical engineering

Free technical library

Encyclopedia of radio electronics and electrical engineering / Calls and audio simulators

Comments on the article Comments on the article

Sometimes you want to know: "Didn't they ring the doorbell when no one was at home?". This will help the proposed musical call, which has a special memory function. It was made on the microcontroller of the popular R/C family. The result was an extremely simple device that can play several dozen melodies and remember the last press of the bell button if the door was not opened on time.

The principle of operation of this device is as follows: if the front door is not opened within three minutes from the moment the bell button is pressed, then the next time it is opened, one of the programmed melodies will be played. In other words, when you open the door and hear this melody, you will understand that someone called in your absence. Otherwise, his work does not differ from the usual musical call.

In the described embodiment, the device plays 16 melodies, which are selected randomly. By changing the codes of the control program, you can replace ib melodies with any others, as well as change their number and sound time.

Schematic diagram of the call is shown in fig. 1. Its basis is the DD1 microcontroller (PIC16F84-04I / P from Microchip). The clock frequency is set by the quartz resonator ZQ1. Signal 34 is taken from pin 7 (RB1) of the microcontroller, amplified by transistor VT1 and reproduced by dynamic head BA1.

Memory Music Call on PIC16F84

The bell button SB1 and the door open sensor SF1 are connected to the microcontroller outputs through current-limiting resistors R3, R5. Capacitors C5 and C6 exclude spontaneous operation of the call from interference caused by electrical appliances.

The device is powered from the AC mains through a step-down transformer T1. The voltage of the secondary winding is rectified by the diode bridge VD1. DC voltage is stabilized by the integrated regulator DA 1.

A drawing of a printed circuit board and the location of parts on it are shown in fig. 2. The board is designed to install MLT resistors. capacitors K50-35 (C1, C2) and KM (the rest).

Memory Music Call on PIC16F84

Diode bridge VD1 - KTS405 with any letter index. Quartz resonator ZQ1 - at a frequency of 4 MHz. Capacitors C3, C4 - any ceramic with a capacity of 15 ... 33 pF. Transistor VT1 - any of the KT815 series. The resistance of the resistor R1 should be no more than 40 kOhm.

As T1, any transformer is suitable that provides a voltage of 9 ... 10 V on the secondary winding at a current of 0.3 A. In the author's version, a transformer TS-Sh-ZM1 is used. in which the number of turns of the secondary winding is reduced by 90.

Button SB1 - usual for a doorbell, door opening sensor SF1 - reed switch. attached to the door frame. A magnet is placed on the door itself. When the door is closed, the reed switch closes under the action of the magnet, and when it is opened, it opens. The sensor can be of any design.

Program listing:

Memory Music Call on PIC16F84
(click to enlarge)

To replace melodies, let's get acquainted with the principle of placing them in the memory of the microcontroller. They are located in the program memory in the address range from 200H to 3FFH. One note occupies one machine word in memory. Each melody must end with the code 07H. M_RAND mask. located at addresses 0079H and 0085H. determines the number of melodies and. respectively, the maximum number of notes in a melody (Table 2).

Memory Music Call on PIC16F84

So, if the mask is F8H (32 melodies of 15 notes), then the first melody will take addresses 200H-20FH. the second -210H-21FH ..... 32nd - 3F0H-3FFH. Obviously, each of them occupies 16 machine words, and the maximum number of notes in a melody is 15 (one machine word is reserved for code 07H).

It should be noted: if there is no code 07Н at the end of the melody. then the next one will be played without stopping, etc. until then. until this code is encountered. In this case (16 melodies of 31 notes), the first melody occupies addresses 200H-21FH. the second -220H-23FH, etc. The actual number of notes (from 1 to 31) depends on where the code 07H will be placed. Note codes, depending on their duration and belonging to a particular octave, are presented in Table. 3.

Memory Music Call on PIC16F84
(click to enlarge)

You can use the music.exe program to preview melodies.

At address 008BH is the Wait_D constant. determining the waiting time for the door to open. This time (in seconds) is approximately equal to Wait_D-2. In our case, the constant is 5AH (in decimal - 90) and the waiting time is 90 2 = 180 s = 3 min.

To change the program, you need to load the ring.hex file into a hex editor (usually built into the programmer software) and edit it, taking into account that the machine word of the PIC16F84 microcontroller is 14 bits long and is represented by a four-digit hexadecimal number. Only the two least significant digits need to be replaced, since the most significant ones represent the instruction code. For example, in memory at address 208H is the number 3483H, and you need to write the code 07H. By changing only the lower digits, we get the number 3407Н.

It is also possible to make changes directly to the source code of the program (file nng.asm). To do this, you need to create a Ring folder in the root directory of any disk, place the nng.asm, ring.pjt and ring.lkr files there. Then, in the MPLAB v4.12 environment, open the ring.pjt project and the ring.asm file. which needs to be edited. Next, start building the project and get a new ring.hex file.

Project files

Author: M. Burov, Kostroma

See other articles Section Calls and audio simulators.

Read and write useful comments on this article.

<< Back

Latest news of science and technology, new electronics:

Artificial leather for touch emulation 15.04.2024

In a modern technology world where distance is becoming increasingly commonplace, maintaining connection and a sense of closeness is important. Recent developments in artificial skin by German scientists from Saarland University represent a new era in virtual interactions. German researchers from Saarland University have developed ultra-thin films that can transmit the sensation of touch over a distance. This cutting-edge technology provides new opportunities for virtual communication, especially for those who find themselves far from their loved ones. The ultra-thin films developed by the researchers, just 50 micrometers thick, can be integrated into textiles and worn like a second skin. These films act as sensors that recognize tactile signals from mom or dad, and as actuators that transmit these movements to the baby. Parents' touch to the fabric activates sensors that react to pressure and deform the ultra-thin film. This ... >>

Petgugu Global cat litter 15.04.2024

Taking care of pets can often be a challenge, especially when it comes to keeping your home clean. A new interesting solution from the Petgugu Global startup has been presented, which will make life easier for cat owners and help them keep their home perfectly clean and tidy. Startup Petgugu Global has unveiled a unique cat toilet that can automatically flush feces, keeping your home clean and fresh. This innovative device is equipped with various smart sensors that monitor your pet's toilet activity and activate to automatically clean after use. The device connects to the sewer system and ensures efficient waste removal without the need for intervention from the owner. Additionally, the toilet has a large flushable storage capacity, making it ideal for multi-cat households. The Petgugu cat litter bowl is designed for use with water-soluble litters and offers a range of additional ... >>

The attractiveness of caring men 14.04.2024

The stereotype that women prefer "bad boys" has long been widespread. However, recent research conducted by British scientists from Monash University offers a new perspective on this issue. They looked at how women responded to men's emotional responsibility and willingness to help others. The study's findings could change our understanding of what makes men attractive to women. A study conducted by scientists from Monash University leads to new findings about men's attractiveness to women. In the experiment, women were shown photographs of men with brief stories about their behavior in various situations, including their reaction to an encounter with a homeless person. Some of the men ignored the homeless man, while others helped him, such as buying him food. A study found that men who showed empathy and kindness were more attractive to women compared to men who showed empathy and kindness. ... >>

Random news from the Archive

Ear shape affects hearing 03.04.2018

Changing the shape of the auricle can deprive a person of the ability to determine where the sound source is. Canadian scientists came to this conclusion by temporarily changing the shape of the ears of several people.

The fact that we have two ears, not one allows us to localize sound in a horizontal plane; the brain takes into account the time gap between how the sound wave reaches the ears, and interprets it as a displacement of the source to the left or right. But this system does not help to understand whether the sound comes from below or above: the complex shape of the auricle helps us in this. Scientists from the University of Montreal figured out how the shape of the ear affects the ability to navigate by sounds.

16 volunteers took part in the experiment. Each of them sat in a chair in a specially equipped room, where speakers were placed at different heights to the left and right of the chair. Participants in the experiment had to determine where the sound was coming from. They did it well, but only until the scientists fixed silicone pads on their ears that changed the shape of the auricle. After that, the volunteers began to say that the sound came from above, while the bottom speaker actually worked, and vice versa. True, after a while, the pads stopped interfering with sound localization: the brain adapted to the new shape of the ear. The shape of the auricle of each person is individual; There are no two identical ears, just as there are no identical fingerprints, so the specific criteria by which the brain determines the height of a sound source are also strictly individual, the authors of the work conclude.

During the experiment, the scientists recorded the activity of neurons in the auditory cortex using MRI. Scanning showed that the higher the sound source, the weaker the response of neurons; it is possible that the brain determines the height of the sound source by the level of cell activity, Trapo and Schoenwiesner believe.

Other interesting news:

▪ The main problem of the colonization of Mars

▪ Potato milk

▪ diamond watch

▪ Magnetic portable charger Anker 622 Magnetic Battery

▪ supermassive star

News feed of science and technology, new electronics

 

Interesting materials of the Free Technical Library:

▪ section of the site Big encyclopedia for children and adults. Selection of articles

▪ article Razzut, shoulder! Wave your hand! Popular expression

▪ article How long does Goethe's Faust last? Detailed answer

▪ article Providing first aid for bleeding. Health care

▪ article Zigzag active UHF antennas. Encyclopedia of radio electronics and electrical engineering

▪ article A device for testing LCD modules based on the HD44780 controller. Encyclopedia of radio electronics and electrical engineering

Leave your comment on this article:

Name:


Email (optional):


A comment:




Comments on the article:

Sergei
Instead of RTCC it is better to write TMR0 according to 16F84inc. On page 2, the PCLATH counter for some reason sends us past the list of melodies (maybe it was intended?) Just in case, at the end of the program, after IDLOCS, I put DT instead of DW. Let's return to TEMP1. In general, I haven’t fully figured out the program yet. And I don’t want to stupidly download the hix file indiscriminately. In general, the program is witty, it has all the interrupts. Although for some reason TOIE is not connected in the INTCON register. [up]


All languages ​​of this page

Home page | Library | Articles | Website map | Site Reviews

www.diagram.com.ua

www.diagram.com.ua
2000-2024