6
\$\begingroup\$

I want to use Tx & Rx Modules of 433 MHz standard modules you find everywhere.

I just want Tx module powered up and Rx module should respond (probably key press) on Tx module. I don't have any encoded data to send (by using HT12D, HT12E encoder/decoders).

433 MHz standard Tx/Rx Modules

Any simple solution with few components to use these modules without encoder/decoder support will be sufficient.


\$\endgroup\$
7
  • 2
    \$\begingroup\$ You can implement your own with your microcontroller. Find out what the encoders/decoders do, and duplicate it within the microcontroller. \$\endgroup\$
    – efox29
    May 31, 2015 at 3:39
  • 3
    \$\begingroup\$ Why is there even a 433 millihertz tag? \$\endgroup\$
    – user16324
    May 31, 2015 at 11:08
  • 1
    \$\begingroup\$ @BrianDrummond because there's no capitalization in tags? \$\endgroup\$
    – W5VO
    Jun 3, 2015 at 0:26
  • \$\begingroup\$ Yes. Someone who created the tag forgot to capitalize it properly. \$\endgroup\$
    – Heena Shah
    Jun 4, 2015 at 5:55
  • \$\begingroup\$ Why no encoder/decoder? How does it make sense for any product to run amok when there are radio disturbances in the open 433 band? \$\endgroup\$
    – Lundin
    Nov 1, 2016 at 10:00

2 Answers 2

14
\$\begingroup\$

I have implemented with these modules being interfaced via microcontrollers on each end.

The transmit end is simply connected to an output port pin that gets modulated in a software interrupt service routine running at 1 KHz. The modulation is encoded as Manchester format yielding a data bit rate of 500bps. My application sends 6 or 8 bytes of information about once each minute or so.

The data output pin of the receiver module connects to two separate input interrupt request pins that are configured to generate interrupts on the positive signal edges on one pin and on the negative signal edges on the other pin. These interrupts operate a state machine and use a timer to measure the received pulse widths and tolerance the measurements over about a 10-30% range to determine pulses arriving at 1x, 2x, or 3x widths high and low. The interrupt state machine monitors the present pulse width through the next one and is able to determine decoded bits of the Manchester data stream. The stream includes a lead-in sequence followed by a sync pattern (that is where the 3x pulse widths come in) as they are not legal normal Manchester encoding which should always be seen as 1x and 2x pulse widths.

The scheme is very reliable and when using 11 to 12V on the transmitter and 6.8 inch straight wire antennas on each end I am able to pickup the transmissions at a distance of 200 to 300 feet.

So in direct answer to your question...no encoder chips required...all done in software of the microcontrollers. But be aware that to get reliable transmissions that you need to use some type or encoding system that allows for wide tolerance decoding of the received signal. If you try to do what some folks do and just connect the transmit and receive pins of the module pair to the TxD and RxD pins of a microcontroller UART do expect to get crappy performance.

Edit: Here are some snippets of design documentation I created for the Manchester encoder described above:

Here is the modulation diagram. In my application the "T" time unit is 1 millisecond. Note that I've found it necessary to increase the leadin 0's stream to 20T or 30T of 0's use to the capture delay of certain receivers. (There is quite a variation of characteristics of available 433MHz receiver modules).

enter image description here

enter image description here

Here is a scope shot of the start of a typical transmission sequence:

enter image description here

The receiver state machine that decodes the modulation stream has a number of states that deal with detecting sync high (3T), sync low (3T), Fake 0 Filler, Actual Data decoding and so forth. The heart of the data decoding is based upon a sequence of four possible current state cases and next state possibilities. (Note that as each bit is logged there is a total bit counter that keeps track of when the end of the message is detected).

enter image description here

enter image description here

As I described before the receive decoder measures the width of each received pulse width and determines its nominal 1T or 2T width by comparing the measured value against an acceptable range. The wider you can make the acceptable pulse range the more robust the decoder algorithm can be in dealing with distortions of the received modulation waveform. You still want to keep a cap on how wide you make the tolerance so that the decoder is actually picking up the intended pulses and not some random output from the receiver. The code to check for the pulse widths in a particular state looks like below. The state machine is called from the interrupt context that occurs at each falling and rising edge of the input waveform.

enter image description here

I've used a spreadsheet to compute the pulse range values and exported that as a set of defines that equate the widths based upon counts in the MCU timer used to measure the widths. Here is a sample of the calculations for one target receiver I produced.

enter image description here

RF transmissions using 433MHz are typically line of site for detection by the receiver. In one of my applications where the path between the transmitting MCU and one or more of the receiving MCUs was obstructed by large metal / concrete building structure I built a repeater module that receives the RF packets and re-transmits it 2 seconds later. Whilst I could have built the repeater using another MCU I had actually decided to build it around a low cost FPGA development board purchased on eBay. It was an interesting exercise done with schematic design at the top level and a number of Verilog modules to perform the Manchester decode and encode state machines. The following snippet shows how close the Verilog state machine code looks as compared to the same decoder state shown above in C code.

enter image description here

In the case of the Verilog sample the measured pulse width was performed in another module and the comparision results sent as signals to the state machine decoder module.

\$\endgroup\$
3
  • \$\begingroup\$ On your scope traces why does the receive input (CH4) start toggling before the transmitter starts keying (CH1)? \$\endgroup\$
    – Andy aka
    Jun 2, 2015 at 13:37
  • \$\begingroup\$ @Andyaka - The scope triggered on the XMIT channel 1. The stuff you see on the receiver output is the random noise picked up by the receiver. If I recall correctly the receiver acts strange staying low and bursting high with noise or staying high for long periods and bursting low with noise. The scope probe clipped to the xmit antenna is not seeing everything because it is just a 200MHz scope. \$\endgroup\$ Jun 2, 2015 at 17:57
  • \$\begingroup\$ @MichaelKaras It's no problem, just looked odd as if the triggering on the scope were all wrong - just a coincidence that the receiver "sprang into action" at that slightly eary point but as you said (and I said in my answer) the rx output can be full of noise/crap etc.. \$\endgroup\$
    – Andy aka
    Jun 2, 2015 at 18:12
6
\$\begingroup\$

I'm sorry to inform you this but encoding/decoding is required even if your input is a simple key switch.

These are very basic radio modules (cost about £2 a pair) and they do not have a sophisticated on-board protocol for transmitting/receiving data (or simple key-switch commands).

In the absense of a transmit signal, the radio receiver is sat there doing its best to find a signal and the output it produces is usually just noise. If the transmitter were "activated" continuously the receiver would, after a short period of a few milli seconds produce a stable "1" on its output then after tens or maybe hundereds of milli seconds this would likely return to noise (despite the transmitter still being keyed).

The receiver (in a lot of these devices) relies on changes in data to keep its AGC circuit set the the right level to accurately demodulate the incoming transmission. It needs an AGC (automatic gain control) because the signal strength received from the transmitter can vary in carrier amplitude so much and, if the AGC gain were too high you'd get logical 1 data sequences correctly demodulated whilst logical 0 parts of the data would be very noisy.

You just cannot treat these type of cheap modules as equivalent to RS232 ports.

Think again about using the encoders and decoders OR do what @MichaelKaras suggests and use a microcontroller at both ends.

\$\endgroup\$
4
  • \$\begingroup\$ Still can not upvote you or give another tick for good answer (lack of points in my acct). If the receiver produces output 1 as you said for any 433 MHz signal, I can trigger another circuit with that. I just want to use receiver as '433 MHz signal received' without bothering about who is sending that and what is the data. \$\endgroup\$
    – Heena Shah
    Jun 4, 2015 at 5:53
  • \$\begingroup\$ In the absense of a signal the rx output will be up and down as noise - how do you know you are not receiving a valid but weak transmission. It will look like noise to a simple measurement device. \$\endgroup\$
    – Andy aka
    Jun 4, 2015 at 7:20
  • \$\begingroup\$ I mean, if Tx is powered on, data pin gets a simple trigger, will it be recognized at Rx in anyway at all or it will just await only encoded transmission ? \$\endgroup\$
    – Heena Shah
    Jun 4, 2015 at 15:13
  • \$\begingroup\$ It relies on a modulated transmission to set it's gain usually. This means any reasonable modulation within broad limits. It does not mean keying a transmitter permanently on. Hey these are really cheap devices, why not try it and see for yourself. \$\endgroup\$
    – Andy aka
    Jun 4, 2015 at 16:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.