A 2-Channel Receiver that can save your old Motorola TX

By on May 18, 2017
Pin It

 

A 433,92 MHz Receiver that can be paired with a maximum of 10 Motorola TX each with relay outputs that can be set both in monostable or bistable mode.

 

Although we have had high security encoding for several years, based for instance on rolling-codes, a lot of remote controls and especially those installed long time ago in houses and other places for opening gates, are based on fixed and relatively simple encoding like the MM53200 of former National Semiconductor and the Motorola MC14502x; the latter had two new elements at the time of its introduction, that were the high (for the times) number of combinations allowed (19,683) and the three-state encoding (each encoding input of the encoder and of the decoder would allow three logic levels and required special three-state dip-switches).

As it happened for the MM53200, the Motorola encoder has also almost disappeared from the market, giving a hard time to those who had installed a remote control and had to look for a hand transmitter that could replace a broken or old controller. This is why we thought we could help by designing and proposing, in this post, a receiver for Motorola encoded radio controllers, which can be used both for replacing broken controllers or controllers that cannot be found on the market, and to incorporate in only one circuit the receiver unit, the decoding and a memory that allows the receiver to respond not only to a transmitter, but to more than one; this is useful in case more people who have different transmitters must access a single entrance, without sharing the code, so without knowing each other’s codes. It is also practical because it allows, for instance, to access the entrance even if one’s transmitters is lost, thanks to a spare previously coupled radio controller.

Another reason for proposing our receiver is that it can learn the code directly from a transmission outputted by the circuit’s TX, which allows limiting encumbrance of the receiver because you don’t need the 12 poles dip-switches requested by the manual setting, and to couple the receiver to the transmitter quickly and without any errors.

 

 

Circuit diagram

Now that we have established this, let’s take a look at the circuit diagram of the receiver, which is based on a PIC16F688 microcontroller and a hybrid radio receiver module tuned on 433,92 MHz; the U2 module contains the radio part of the circuit and it is a specific receiver labeled AC-RX2 and produced by Aurel, complete with an amplifier for the signal coming from the antenna (which provides a sensitivity of -106 dB), a stage of super regenerative harmony tuned on 433,92 MHz calibrated by the factory and equipped with an RF filter (the antenna filter is used to increase selectivity, which is low in super regenerative, and to demodulate amplitude). The AC-RX2 is also equipped with a comparator that squares the digital signal (at TTL-level) coming out of 14-pin and a LF amplifier for the signal coming out of the AM demodulator.

As for the microcontroller, it is an 8-bit microcontroller with a flash program memory and the firmware on it, right after being powered on and after finishing the Power On Reset (phase signal by a sequence of 5 flashes of the green LED that will indicate a correct boot) it initializes the I/O’s setting RB0 and RA6 as outputs, which will be used to control, respectively, the NPN T2 transistor driving the control relay of the channel 1 load and T1, which drives OUT2’s relay.

 

 

Each relay is excited by the saturation state of the respective transistor, which is in turn polarized following the microcontroller line drive in it when this line goes to logical high (R1 limits base current of T1 in order to avoid damages to the base-emitter junction and R2 does the same with T2). In parallel to the coil of each relay there is a production diode (D3 for RL1 and D2 for RL2), which function is to short-circuit the inverted extra tension generated by the coil when the transistor, in interdiction, interrupts the current flow during its saturation phase; if it wasn’t for the diode, voltage would close on the base-collector junction of the BJT and would damage it after a limited number of commutations by the transistor.

Still during initialization, the microcontroller sets RA4 line as input for acquiring data coming from AC-RX2, RB4 and RB5 as inputs (with internal pull-up activated by firmware) to read the state of the dip-switches (these lines have also an internal pull-up) and RB6, RB7 for reading the state of P1 keys (in order to launch the code learning paired with channel 1) and P2 (pressing this key launches code learning for channel 2); these last I/O lines have their internal pull-up to.

Continuing with initialization, the microcontroller sets RB1, RB2, RB3 as dedicated outputs, respectively, for controlling the LD3 signal LED (green, indicating the passages of the self-learning procedure and normal functioning), LD1, which indicates the activity of channel 1, and LD2 that does the same for channel 2.

DS1 dip-switches are used to set the functioning mode we desire for each channel; to be precise, dip1 (the one read by the microcontroller’s RB4) allows to set OUT1 while dip2 (the one read by RB5) sets the activity for output OUT2. A closed dip activates the bistable functioning (that is, for each valid code received, the corresponding relay inverts its state), while an open dip means monostable functioning (for each valid code received, the corresponding relay is excited then goes down again after releasing the key of the transmitter).

R4 and R5 trimmers you see in the circuit diagram will be used in future developments and are available for whoever wants to modify the firmware in order to, for instance, implement a delay in the release of the relay in monostable mode; this can be done by activating a timer and loading, as period, the equivalent of what the A/D converter contained in PIC16F688 reads from the scanned trimmer pins.

 

 

The two red LEDs of the circuit follows the state of outputs during functioning; specifically, LD1 lights on when OUT1 relay is excited and LD2 lights on when OUT2 relay is excited.

The circuit is completed by the power unit, which starts from points + PWR and – PWR (the power terminal block) , crosses D1 diode (which protects from damages caused by inversion of polarity) and reaches the 3-terminal integrated regulator U1, which input is filtered by C1 and C2, reducing a possible power voltage flickering (C2) and RF disturbances and impulsive disturbances catch by the power wiring (C1).  C3 and C4 do the same job for the regulators output.

 

Functioning

Now we can explain how the receiver works: when powering the circuit, and firmware, once completed the I/O initialization, makes the LD2 flash five times, in order to indicate a correct boot and normal functioning, that is receiver for radio control (corresponding to the execution of the command provided remotely); then the Main goes in loop to verify if there is a level variation on 12-pin and 13-pin (key state variation). A dedicated routine periodically checks the state of 2-pin, that is the arrival of data from the AC-RX2; when we press one of the keys on the transmitter, the RF signal irradiated by it reaches the receiving antenna of the AC-RX2 module, which demodulates the data component and sends it to the 13-pin to make it available for the microcontroller, which reads it from its RA5 line. The micro decodes the code corresponding to the pressed key on the remote (although the firmware also provides a routine to automatically learn the base code of the same without setting dip-switches) and operates this way; the microcontroller picks inputs at TTL level, puts them in the RAM and analyzes them via a dedicated firmware routine that first and foremost tells the signal compatible with the Motorola encoding format apart from the many signals found in the ether, therefore, in case of a positive, it checks if the code is one of those memorized during the self-learning phase, in case of a negative, it eliminates data from the RAM and prepares for a new analysis.

You will see later how to pair the transmitter and the circuit, making use of self-learning; for the moment, just know that the firmware expects a maximum of 10 codes to be learned, even from different transmitters. In fact, each code is fully memorized, that is all its three-state 9 bits are saved into nine EEPROM bytes by the microcontroller; we are using nine bytes because it’s the most immediate solution, given that each address line (encoding) of Motorola MC145026 encoder allows for three logical conditions (1, 0 and open), it is not possible to turn them into binary bits and directly save them in a binary memory.

Now, let’s see what happens when the received signal contains one of the known codes which are saved in the PIC’s EEPROM, in this case, we can apply the dedicated relay handling routine, which determines different actions based on the functioning mode, whether monostable or bistable; we remind you that mode setting depends on the dip-switches which are read by the firmware when it has to control the outputs. Therefore, if the received signal contains one of the codes in the EEPROM, the firmware starts the handling routine of the correspondent relay output, which is different depending on the respective dip-switch being open or closed. Please note that functioning mode of outputs can also be modified during functioning, in fact, we don’t need to turn off the circuit and then on again, thanks to the fact that the dip-switch of DS1 is read right when one of the relays must be activated.

We remind you that in bistable mode, the relay changes its condition anytime the microcontroller recognizes a valid code, while in monostable mode, the relay goes to logical high when it receives a valid code and goes back to standby when the key corresponding to the code is released, that is once the activating signal goes off: in short, the relays follows the key. If transmission ends but at the same time a new transmission is received by another radio controller that has been paired with the receiver (i.e., the code belongs to one of the 10 learned codes) within the timeout frame allowed by the firmware, the microcontroller considers the transmission as if it was never interrupted. If the code from another TX comes when the relay is active because it is receiving the transmission from another valid transmitter, the conditions is no longer valid because the second transmitter interferes with the signal from the first one and the radio receiver will demodulate the overlapping of the two data streams; as a result, the microcontroller will think that activation signal is over and will cause a relay to go low.

 

 

Learning procedure

Let’s now take a look at how to pair transmitters and circuits: first things first, we need to press and hold the key corresponding the channel we wish to save in memory (P1 for channel OUT1 and P2 for channel OUT2). The red LED for the output (LD1 for OUT1 and LD2 for OUT2) will light on to signal self-learning mode. After that, we need to press the radio controller key we wish to learn and wait for the LED to blink, this indicates that the operation was successful.

If the LED light remains fixed, it means that code memory is full or the received code is not valid.

As for code erasing, please note that our receiver can only erase memory relative to a single output channel, but not a single code of a radio controller. In order to erase the memory of one channel we need to power the circuit by pressing and holding the key relative to the channel we want to erase; P1 for channel 1 (OUT1) or P2 for channel 2 (OUT2); then we have to release the key when the green LED (LD3) stays on for 2 seconds in order to indicate a successful elimination of the memory bank relative to the chosen channel. The green LED will flash 5 times when exiting your erasure procedure and the receiver will go back to normal functioning.

All the signals provided by the circuit LED both during normal functioning that during learning and cancellation procedure are listed in Table 1.

Table1

 

To power the receiver we need 12÷14 Vcc and an 80 mA direct current.

As for usage, remember that outputs must commute a current of 3 A each, in circuits powered with a maximum of 125 Vca and 160 Vcc; this means that if you have to commute loads connected in functioning circuits with the 230 Vca power grid you will have to use servo-relays fit for that voltage, driving the coil by switching the relays on our board. If you use 12 V servo-relays, connect one terminal of the coil of the servo-relay to the ground and the other one to the NC contact of the receiver output that you are going to use for the control, then connect the No to the + terminal of PWR terminal block. This way, when the relay is activated it applies voltage on the servo-relay. In order to prevent premature wear of the contacts, it is recommended to parallel-connect the servo-relay coil to a 1N4007 diode in anti-parallel: the diode will then have the anode connected to ground and the cathode on the positive terminal, therefore on the NO output.

 

From openstore

Two-channel receiver at 433.92 MHz Motorola decoding

TX 1 CHANNEL 433 MHz

TX 2 MOTOROLA CHANNELS

Trasmettitore 433 MHz 4 canali codifica 5026

About Boris Landoni

Boris Landoni is the technical manager of Open-Electronics.org. Skilled in the GSM field, embraces the Open Source philosophy and its projects are available to the community.

One Comment

Leave a Reply

Your email address will not be published. Required fields are marked *