RXB1 module (RX3400 based) - Page 1
Forum section: electronics / projects

author: gnif
author_rank: Unknown
timestamp: January 02, 2014, 10:36:43 am
content: I decided to play with a RX/TX module pair I bought a few years ago and ran into an odd issue.The RX module I have which uses aHiMARK RX3400 Low Power ASK Receiver ICis configured to operate on 434MHz. From what I can tell the design follows the reference design on page 7 of the datasheet except for one thing that caused me a few hours of hair pulling.I was finding that my data was coming through completely scrambled, at any baud rate, etc. But if I touched the top of the RX module, I found that I would get 99% of the data through fine. By using a wire I managed to identify the part that I was touching that fixed the issue, a 2.2K resistor connected between pins 1 & 3 that did not exist on the reference design. I removed the resistor and it seems to have fixed the issue.I have several questions:Why would they have put this resistor there, when it is clearly not in the reference design, and seems to make the module completely useless?Will the removal of this affect the range of the module?There is also a 10K resistor in series with the data output to the header on the module which also does not exist on the reference design, why would this be here?Did touching the resistor add capacitance or was my body acting as an antenna?

author: gnif
author_rank: Unknown
timestamp: January 03, 2014, 12:29:01 am
content: Wow, I am a little surprised that nobody has any input on this.Anyway, some info I found and things I implemented to apply it. ASK encoding needs a high amount of bit toggles to sync with the receiver, which is not good if you are just using RS232 to communicate as, for example, if you send a whole heap of null bytes you will loose sync with the receiver and then you will loose data. The only way I could think of resolving this and guaranteeing enough toggles per byte was to send 3 bytes per byte.Sending Side:Code:/* send some data to sync with the receiver, this will be ignored by the receiving side due to the invalid checksum */chSequentialStreamWrite(&SD1, (const uint8_t *)"\x33\xCC\x33\xCC", 4);for(i = 0; i < length; ++i){/* Interleave bits 4, 5, 6 & 7 with their inverse */b1 = (data & 0x80) >> 0 | (~data & 0x80) >> 1 |(data & 0x40) >> 1 | (~data & 0x40) >> 2 |(data & 0x20) >> 2 | (~data & 0x20) >> 3 |(data & 0x10) >> 3 | (~data & 0x10) >> 4;/* Interleave bits 0, 1, 2 & 3 with their inverse */b2 = (data & 0x08) << 4 | (~data & 0x08) << 3 |(data & 0x04) << 3 | (~data & 0x04) << 2 |(data & 0x02) << 2 | (~data & 0x02) << 1 |(data & 0x01) << 1 | (~data & 0x01) << 0;/* checksum of the two bytes */checksum = b1 ^ b2;chSequentialStreamPut(&SD1, b1);chSequentialStreamPut(&SD1, b2);chSequentialStreamPut(&SD1, checksum);}Receiving Side:Code:char in1 = sdGet(&SD1);char in2 = sdGet(&SD1);char cs = sdGet(&SD1);while(1){/* check the checksum matches */if ((in1 ^ in2) == cs)return((in1 & 0x80) << 0) |((in1 & 0x20) << 1) |((in1 & 0x08) << 2) |((in1 & 0x02) << 3) |((in2 & 0x80) >> 4) |((in2 & 0x20) >> 3) |((in2 & 0x08) >> 2) |((in2 & 0x02) >> 1);/* shift along one byte */in1 = in2;in2 = cs;cs = sdGet(&SD1);}/* should never get here */return 0x0;The checksum is needed to ensure that each packet of two bytes is valid and not some random RF interference, otherwise we risk getting one good byte, and one bad, at which point we get out of sync with the sending end.If anyone has any ideas that would implement this in a more efficient manner (less wastage) then please let me know... I am fairly new to this kind of thing and trying to learn.My final goal is to implement some soil moisture sensors for the garden, solar powered, so has to be low power consumption, that reports back the current moisture level to a central receiver that both logs the data, and can auto water the garden where it is needed most. I will be using home made Gypsum sensors.