Monday, January 3, 2011

Neighbour Showering With Blinds Open

A key DTMF 4 or 8 channels

We propose in this paper a DTMF remote control of the third generation produced with the new ST6265 microcontroller provided with an internal EEPROM.
This device can turn on or off, via radio or telephone, any electrical appliance.
It is possible to remotely change the password and all operational parameters of the key.


Technical
Our remote control can operate both connected to a telephone line to a radio. The card, which uses the standard DTMF is entirely controlled by a microcontroller and has the following characteristics:
-management by 8-bit μC equipped with nonvolatile memory,
-protocol communication following the standard DTMF
-four (extension possible eight) controllable devices,
-functioning channels on / off or pulsed.
-activation key five colors (100000 possible combinations) modified by the user and stored in its nonvolatile memory can
-key protection,
;-programming, telephone operation, with the keys 1 to 9.
-tones different response to confirm the order, opportunity-
interrogation of the state canals,
-management of PTT relay operating radio-based recovery
channels, signaling
-cuts Power,
-operation of the DTMF key, in turn connected to an answering machine.

yesterday, the phone will not allowed to transmit your voice. Today it is also your fax, answering machine, modem, and also ... your key DTMF.
Joking aside, the telecommunications market is constantly changing. Just to be convinced, think of the success of the Internet, the network that connects the global thousands of computers. Using DTMF keys, and more generally through remote control systems, it is possible to activate remotely - via radio or telephone - any electrical charge.

Overview DTMF!
These devices use an input audio signal coded in DTMF (Dual-tone multifrequency, multifrequency two-tone signaling) and have the output of a or more relays can be connected to as many devices.
The name "Key DTMF" is that to ensure the exclusivity of the order, that is to say, to ensure that one person can access the control relays, the circuit must have a activation code particular, as a "key" for access. The symbol indicates the DTMF communication standard used to transmit the codes.
Choosing the DTMF system is dictated by two substantial reasons.
First, almost all telephone and radio have the capability to generate such signals. Secondly, the fact as DTMF tones (actually two-tone) can not be reproduced by the human voice, thereby avoiding false activations due to the presence of voice signals over the same transmission line.
The first DTMF key, made with discrete components, had a considerable complexity of circuits and were characterized by modest benefits! Then arose the first key DTMF digital logic. Then, immediately after, those to microprocessors, with a marked improvement that benefits both the flexibility of remote monitoring.
The DTMF key that we are about to describe to you, represents the evolution of the previous and can be defined as belonging to the third generation with the quality and variety of available functions. This new key can operate either with radio (PTT management) or with a phone line with the possibility to choose the number of rings required to activate the card.
The circuit has four relay output number that can be expanded to eight by using an additional card to be presented later. The new key DTMF responds to each command with a different tone to confirm the opening or closing of the relay. In addition, channels can operate on / off or pulsed mode. An option is also provided for automatic reinstatement of the canals, very important in case of power failure. In this mode, the relay will resume the status it had before the interruption. For other functions, we report the ability to query the map to check the status of each channel before switching them.
activation code to five digits, relay status, number of rings and all other options are stored permanently in a nonvolatile memory, even in the absence of food.
Unlike DTMF key using microcontrollers equipped with RAM, it means that after any power failure all settings will be restored as they were before. Let us now into the details of this new remote control by analyzing the circuit diagram in Figure 1.

Figure 1: Diagram of the key DTMF 4 / 8 channels.

Figure 2: Flowchart of the program in the microcontroller ST6265

Figure 2a: The organization's main menu shows the two different modes of operation of the key: by radio or telephone.

Figure 2b: Flowchart of procedure remote programming code and the number of rings.

Figure 2c: Flow controls the key.

Figure 3: PCB scale 1.

Figure 4: Components layout of the DTMF key 4 channels on the PCB.

Component List
R1 : 1 kΩ
R2 : 1 kΩ
R3 : 33 kΩ
R4 : 100 Ω
R5 : 390 Ω
R6 : 4,7 kΩ
R7 : 1 kΩ
R8 : 1 kΩ
R9 : 47 kΩ trimmer
R10 : 100 kΩ
R11 : 100 kΩ
R12 : 100 kΩ
R13 : 4,7 kΩ
R14 : 330 kΩ
R15 : 15 kΩ
R16 : 15 kΩ
R17 : 150 Ω
R18 : 150 Ω
R19 : 4,7 kΩ trimmer
R20 : 150 kΩ
R21 : 150 kΩ
R22 : 4,7 kΩ
R23 : 33 kΩ
R24 : 100 kΩ
R25 : 15 kΩ
R26 : 15 kΩ
R27 : 1 kΩ
R28 : 1 kΩ
R29 : 1 kΩ
R30: 1 kilohm
R31: 1 kilohm
R36: 15 kΩ (the resistors are 1 / 4 W)
C1: 220 nF 250 V polyester
C2: 220 nF 250 V polyester
C3: 100 nF multilayer
C4: 100 nF multilayer
C5: C6 100 nF multilayer
: 1 uF 16 VL chem.
C7: 100 nF multilayer
C8: 220 nF 100 V polyester
C9 220 nF 250 V polyester
C10: 100 nF multilayer
C11: 22 pF ceramic
C12: 22 pF ceramic
C13: 1 uF 16 VL chem. rad.
C14: 470 uF 25 V chem. rad.
C15: 470 uF 25 V chem. rad.
C16: 100 nF multilayer
D1: 1N4007
D2 1N4007 D3
: 1N4148
D4: 1N4007
DZ1: 5.1 V Zener
DZ2: 12 V Zener
LD1: 5mm Red LED
LD2: LED 5 mm red
LD3: LED 5 mm red
LD4: LED 5 mm red
LD9: Green LED 5 mm
LD10: LED 5 mm yellow
PT1: 1 A diode bridge
T1: BC547
T2: BC547
T3: MPSA42
T4: BC547
Q1: Q2
Quartz 3.58 MHz: 6 MHz Quartz
U1: U2 4N25
: 8870
U3 ST62T65 (software MF51)
U4: U5
ULN2803: 7805
RL1: Miniature relay RL2
12 V: 12 V
Miniature relay RL3: Miniature relay RL4
12 V: 12 Miniature Relays V
RL9: Miniature relay 12V
DS1: Dip-switch 4-pole
S1: Push CI
1 holder 2 holders
6 pin 18 pin 28 pin socket 1

4 terminal blocks terminal 5
2 points 3 points 1 CI
ref. : F033


Figure 5: The ST6265 microcontroller

The card uses the new microcontroller from SGS-Thomson ST6265. All operations and managements are assigned to a single circuit, which gives us the advantage of having both a simple and a reliable product. The choice of this microcontroller has been done for several reasons, including the need to provide the key to a nonvolatile memory for retaining code and relay status. The ST6265 has built-in three different types of memory: a ROM of 3884 bytes to accommodate the program, a RAM of 128 bytes and finally a 128-byte EEPROM which maintains data continuously. Lines available inputs and outputs in the ST6265 are more than sufficient to meet our application, in addition to their flexibility allowed us to significant simplifications of the circuit.

View on the ST6265 microcontroller.

In the DTMF key we use only three integrated: the ST6265 microcontroller, DTMF tone decoder G8870 referenced and relay driver for the ULN2803.
The microcontroller must be mounted with the actuator upwards, unlike the two other integrated circuits.

Figure 6: 8870.

Figure 7: The ULN2803

view of the connections of two other integrated circuits used in the key. On the left, built 8870 and is entrusted the task of decoding the DTMF tones outputting a digital signal. Right, the ULN2803 driver that drives the output relays. This circuit also has diodes to protect against surges generated by the coils of the relays.

View on the expansion card 4 to 8 channels.

Our remote control can handle up to eight relay outputs.
The first four outputs, that is to say, Channel 1 to 4, are available on the base map. To increase from four to eight the number of channels, just use the deck extension visible in the photo.

Figure 8: The positioning of dip switches.

Operation Summary of key
If the DTMF key is connected to a telephone line, we must first dial the telephone number thereof. After the note in reply, send in the correct order, the five-digit access code. If the code sent is false, the key will automatically mute the line, if we receive a second note in response.
Now we can execute the desired commands:
- Press any key from 1 to 8 to act on the relay.
- Press the # key followed by a key from 1 to 8 to enable the questioning of the status of the selected relay.
- Press * to open all relays.
- Press the # key to exit.
- Press 0 followed by # to enter programming mode, if the key is not protected. Where it is protected, the command will be ignored.

Positioning
switches S1 to select the mode. If the key is to operate in radio mode, positioning it to ON, otherwise leave it on OFF mode phone. If the relay should operate in pulse mode (activated a second), positioning S2 OFF. If they have to operate in bi-stable, are putting S2 ON. Finally, if we want to activate the recovery relays, are putting S3 ON.

Overview of the plate mounted.

from 4 to 8 channels.

Our key DTMF was designed to control up to eight devices. The microcontroller, software and driver power (ULN2803) to enable or disable eight relays.

The Hardware
Despite all these benefits offered by our key DTMF, the wiring diagram is simple. It has the advantage of being very reliable and very easy to achieve.
The core system is the integrated circuit U3 the new ST6265 microcontroller, an EEPROM with managing all functions of the card.
To function, this circuit must be powered at 5 volts between pins 11 (+5 V) and 12 (mass), leaving pin 3 (test) to ground during normal operation. The power stage consists of C15 and C16 for smoothing the voltage of diode D1 protects the card in case of reverse polarity, LD9 LED that indicates the presence of voltage and finally the 5 volt regulator U5 whose function is to power the microcontroller (U3) which decodes the DTMF. The card, it must be supplied with a voltage of 12 volts and has a consumption of 200 mA.
Now to the description of the integrated circuit U3 and all the pins. The RC network comprising resistor R24 and capacitor C13 allows, when the first power is supplied or when the card to reset (reset) by setting a moment to ground pin 22 to that the program can be properly put "in place".
The 6 MHz quartz Q2 and capacitors C12 and C13 ser wind to operate the oscillator for the microcontroller and to "turn" the program.
The dip-switch with four switches DS1 is directly connected to pins 10, 13 and 14 of the microcontroller without any resistance. The first switch selects the operating mode of the key: if the radio is ON, or by phone if it is OFF. Switch 2 selects the operating channel, bi-stable if the switch is on (ON) or pulse if the switch is on (OFF). Through the switch 3, it is possible to enable (switch ON) or disable (switch OFF) the function of restoring the state relays in the event of possible power failure. The fourth and final switch is not connected and it is reserved for future applications.
The switch S1 connected to +5 V through resistor R36 is set to 0 to the EEPROM present within U3 (Action NMI pin 23). We will act on this button during the initialization phase of the card and each time we want to change the access code of the key if it is protected. Notes
response (continuous, modulated or programming) are generated by the microcontroller through the clock (timer) internally, and are sent out on pin 28 in the form of square wave. This signal is then applied through R23 to the base of transistor T2 which can amplify it before sending it to all T1, R20, R21 and R22. The signal on the emitter of T1 is then sent either to the telephone line, through C9 and R18, or at the AF output through C8, R2 and the R19 trimmer, which adjusts the level. Each time a note is generated, the pin 26 of microcontroller goes to +5 V for the duration of the note, and in this way is closed, with R25 and T4, the PTT relay RL9. The closure of this relay is indicated by lighting the LED LD10.
management of the telephone line is assigned to the pins 24 and 25 of the microcontroller. The pin 24 is used as output push-pull: it can either be grounded, and this case the phone line is open or at +5 V, and in this case the line will be brought to ground by resistance of 150 Ω (R17) through the transistor T3 and resistor R15. The pin 25 of microcontroller receives, for its part, the phone rings through the ring detection circuit "ring detector" consisting of the optocoupler U1 and resistors R12 and R13. This LED inside U1 activates whenever the line gets a ring, using the circuit formed by resistors R4, R5 and capacitor C1. Each ring is a positive pulse output of the optocoupler (Pin 4), pulse that is sent to pin 25 of microcontroller.
Our remote monitoring is controlled by a DTMF signal (either radio mode or phone mode), which is not directly understandable by the microcontroller which can only generate digital signals. To overcome this obstacle, it is necessary to use a decoder - in our case a 8870 - can convert the two-tone DTMF signals into digital signals. This circuit, U2 noted on the schedule requires to operate only three external components: a crystal of 3.58 MHz (between pins 7 and 8), a resistance of 330 kΩ (between pins 16 and 17) and a 100 nF capacitor between +5 V and pin 17. The signal taken from the contactor telephone through the diode bridge (PT1) then comes to the input (pin 2) of 8870 through the R9 trimmer. By using radio signals collected on the terminal "IN BF" also arrives on the same pin 2 through resistor R8 and R9 trimmer. In both cases, radio or telephone, the R9 trimmer adjusts the signal level while limiting zener diode DZ 1 to 5 V signal amplitude to protect U2. The DTMF tones are then converted into digital signals and then available on pins 11, 12, 13 and 14 (Q1, Q2, Q3 and Q4) of 8870. These pins are respectively connected to U3 pins 19, 18, 17 and 16 which are programmed without pull-up resistor (pull-up) and without interruption. The digital signal is read each time the pin 15 (STD Delayed Steering Output) of 8870 increased to 5 V. This pin, connected to pin 15 of microcontroller U3 is configured as input with interrupt. The output consists of four small power relays (1 Amp max).
The number of outputs can be extended to 8 using an option card: the four relays on the board of the key plus the four DTMF relay expansion card, all managed by the eight lines output of the microcontroller U4 through the driver (ULN2803).
The microcontroller pins used to drive relays CH1 to CH8 are 1, 2, 4, 5, 6, 7, 8 and 9. The integrated ULN2803 is designed to simplify both the circuit assembly. He has eight power relay drivers and eight protection diodes. This circuit can replace the conventional driver transistor that would have required the use of eight transistors, all diodes and resistors 16. DL1 to DL8 LEDs are also controlled by U4 and to visualize the relay activated.
The hardware description is complete, it remains for us to turning to the description of software program contained in U3. For that, look at the charts of Figure 2. The Software


To better understand the operation of remote control, we have shown the software (MF51) using three different charts. The first (Figure 2a) is the main program, the second (2b) the routine of programming and the third (Fig. 2c), relating to orders, indicates that the operations can be performed on the card once the code access enabled.

The main program
But proceed in order and first analyze the program main. At power up the card, the microcontroller initializes all inputs and outputs through the input pins designed to receive data and output pins provided to send data.
Remember that starting the program takes place at each of the ST6265 microcontroller power (power-on function) and if that starts to fail, the microcontroller automatically retries initialization until there reaches. In conclusion, it is impossible that the microcontroller hangs during power up.
After the doors are initialized other internal devices used, two timers, then RAM.
Then the program reads in the nonvolatile memory EEPROM, the data recorded, the access code, the number of rings and the state of channels. If the function of "Recovery" is enabled, the program places the relay in the state where they were before the power failure. At this point, the program will be divided into two parts according to the chosen mode of operation, phone or radio.
In the first case, the program supports the "ring detector" that is to say, and count the rings expected to compare with the number of ringtones stored.
When the number is identical, the card takes the phone line and then waits for the five tones of the access code of the key with a maximum interval between two tones of 20 seconds.
If the received code is identical to the stored code, the card is positioned front desk to execute different commands. Then we open the line and then loops back.
We can see that throughout the program, in the phase of ring detection, the decoding key or the control, a period ("time out") is provided: in this way, any telephone line cut in any part of the program not to block the card, on the contrary, release itself from the line. If
DTMF key is used in radio operation, the microcontroller is in a program similar to the first except for the control of the bell and the telephone line.

Routine Order Management
The second chart shows the handling routine orders. Each note is available on the telephone keypad or the radio, we have associated a function trying to make our remote control as user-friendly as possible.
DTMF tones used are the keys 0-8, * (star) and # (pound sign). The program interprets
these sounds and performs the function associated with the star opens all the relays, causing the pound out of the subroutine and eventually hung up and the sounds of 0-8 respectively actuate relays CH1 to CH8.
Relay operation can be pulsed or on / off depending on the position of S1.
Whenever a relay changes state, a note of response is generated (if the relay is still closed or modulated if the relay is open). By sending a 0 followed by a number from 1 to 8, it activates the "interrogation" of the card: the program reads the state of the relay "interrogated" and responds with a note complying with the standard set forth above (continue = closed relay module = open relay).
In this mode, we can know the status of a channel without editing. If sending the tone of your # 0 followed it activates the remote programming.

Remote programming
For this description, we use the third chart. The software first sends a note to inform that we are in programming mode: At this time, the card waits for a sequence of seven tones that will be stored in the EEPROM.
In the end, it sends an endnote programming and disable the remote control possibly hanging up the phone line. The seven tones
received and stored in the EEPROM has a precise meaning: the first tone is the number of rings required for the card connects to the line, the five following are the new access code and the last active or disable protection. If it is '1 ', the software disables the remote programming thus making it impossible to change remote access code by a remote user.
To remove the protection, it is necessary to reset, locally, EEPROM, a procedure that we describe when we will be concerned with the installation of the card.
If the key is configured to operate radio programming procedure is slightly different: for clarity, in this case, the soft tones awaits only six (five for code and one for the possible protection).
The first tone corresponding to the number of rings is not used because, in the radio version, the program does not handle the phone line.
A final clarification: the note generated at the beginning and the end of programming mode is different from the response of the relay (continuous or modulated).
Indeed, continuous tone lasts about 3 seconds and has a frequency of 1000 Hz, the note consists of three modulated pulse at 1000Hz for a duration of 0.5 seconds, while the score at the beginning and end of programming is formed eight pulses at 1000 Hz with a duration of 100 ms. Description app is finished, it remains for us to proceed to the realization of the remote control.

Mounting
Our new key DTMF was designed to be carried by all, even by players without much experience in this field.
All components used are readily available at your regular supplier, with the exception of ST6265 microcontroller that comes programmed (software MF51) by the company COMELEC (see advertisement in the magazine).
In implementing the single-sided PCB, you can use the method of photogravure using the photo of the PCB shown to scale 1.
We can then begin the assembly by first inserting the small components such as resistors and diodes, respecting the polarity of the latter. We will continue
welding, in the right direction, supports integrated circuits, capacitors (the polarity of chemicals), the transistors, the diode bridge PT1, quartz, and the 7805 LED (polarity).
Finally, we assemble the relay and terminal blocks. Integrated circuits are then inserted into their respective support respecting the meaning.
We can now proceed to connect the card.

Connections and installation
Before powering up the card, we must select the type of operation by acting on the switch S1. If the key is to operate in radio mode, positioning the first and switch to ON, otherwise, OFF. If the relay should operate in pulse mode, that is to say be activated only 1 second, positioning the switch 2 to OFF and, conversely, if the ON relay must store their states. Finally, if we want to activate the "recovery" are putting the switch 3 to ON, otherwise leave it OFF.
raccordons now the phone line to terminal "AS" key or the HP output of the radio terminal "IN BF". If we want the radio unit sends the signal response, we must connect the "OUT BF" card at the entrance to the microcontroller and the PTT. At this point, we can supply the key with a voltage of 12 volts between terminal " + 12 "and the" mass ". If everything is correct, the LED should light LD9.
wait about 10 seconds and a minute support on the switch S1. Immediately, LD10 should glow for a few seconds.
The card initialization ends: at that time in the EEPROM of microcontroller code access to five counts of five zeros is stored (00000) and the number of rings is set by default to three. Our
DTMF key is now ready for use. Just recall that the switch S1 must be changed, unless to resume the initialization phase described above. To connect the card, it is necessary initially to position the adjustable R9 and R19 halfway.
checking the operation of the card in phone mode, it is necessary to connect the pre-entry "AS" contactor to call. It should then call the card in another phone line! At the third ring, the card must get the line and send a reply note. By typing the access code, or five "0", we hear a second note which confirms the fact that we fitted into the key. If this is not the case, this means that the level of the line is too low and that therefore, the 8870 can not decode the tones. In this case, we must act on the R9 trimmer.
However, if it was set to halfway the card should work first time round.
Once inside the key, trying to press a key from 1 to 8, eg "1". If everything works well, we need to hear in the earpiece a continuous note. Pressing a second time on the same key, we hear a note modulated.
Let us remember the fact (if only the key has been configured for relay operation mode bi-stable) as the continuous note indicates that the relay was closed while the memo modulated is generated when the relay opens.
If the key has been configured in pulse mode, the note generated is still continuing.
To reprogram the access code we need to press "0" then "#" key and responds with the note program.
At this point, we can send the required seven tones. The first is the number of rings for the hook (from 1 to 9), the five following up the access code and the latter serves to choose if you want to inhibit reprogramming remote (send your 1) or not (send your 0). The codes sent are stored permanently in the key DTMF (the data will remain even if power is cut), which sends forth an endnote programming before releasing the line.
With programming complete, we can connect many devices to control. Remember that if the protection mode is activated, it will not be possible to remotely modify or access code or the number of rings and the sequence "0" followed by "#" will be ignored.
To change the code of a protected key, you must repeat the whole process of initialization after reset EEPROM using the switch S1. The installation procedure
and connection is valid, even when used by radio. Beforehand, it is necessary to connect the LF output of the receiver to the IN BF map. Recall that
radio position, the card needs only six tones programming: the five-digit code and your protection. The key also has information "power failure". In fact, after typing the password, the confirmation note is continuous if no break has occurred, and if it varies a break, however brief, has occurred. Obviously, when we returned for the first time in the key note is always generated modulated.

0 comments:

Post a Comment