Encoder/Decoder examples

I am already using the basic 433MHz transmitter receiver pair.

I would like to use the encoder/decoder version.

Does anyone know of any sample code?

I think this Rx simply changes logic level on the output pins when the corresponding Tx is pressed.

The pins 10 to 13 are probably the 4 outputs. Note they only stay changed while button is held so your software needs to lock it on if required.


Actually my main objective is to have the receiver only accept messages from the transmitters for which it has learned the id code, like with a burglar alarm system.

With burglar alarms, there are corresponding outputs by the receiver - I don't need that, my application is pure data logging i.e. if a signal is received from an known/authorised transmitter, the transmitter id code is recorded at the receiver end.

The learning function is already built in, I just need to interface it with some Arduino code - if it can be done :)

Hi, As Weedpharma has pointed out, the tx/rx you have are just that. A simple transmitter that you can key on and off, and a receiver that has an output that will go High and Low in response.

They are not intelligent units, they have no ID. They have no programming.

Tom.... :)

aisc: I would like to use the encoder/decoder version.

Does anyone know of any sample code?

Typically such things like the encoder/decoder version works like that:

When powering the sender, the sender selects a 16 bit "Sender ID" randomly as an unsigned int value for itself as "sender ID".

After the sender is powered, you will have to make the receiver 'learn' the ID of the sender that is associated to this receiver. You manually press the "learn" button at the receiver and then send codes from the sender, so its ID will be learnt. After that, the receiver will only react on signals with that sender ID. If your sender loses power and is powered on again, the sender will get a newly created random sender ID again and you will have to repeat the code learning.

So the encoder/decoder version does not need any "Arduino coding" to work, it will need "learning the code".

The basic transmitter/receiver pairs need Arduino coding if you want to have a sender ID, so that a receiver only reacts on signals of the associated sender. You would have to define a "sending protocol", lets say you use a protocol with 8 bits of payload to switch 8 channel on/off digitally. Then you actually would: - Send out 32 bits: 16 bits "sender ID" and 8 bits "payload" and 8 bits "CRC checksum". - Receive 32 bits: The 8 payload bits are only handled if the 16 bit "sender ID" and the "CRC checksum" are correct.

So the basic receiver/transmitter pair require that you invent and code a sending and receiving protocol.

And the encoder/decoder version has the protocol built-in, but requires to "learn" the sender ID manually.