ARDUINO Sample Code DIY RF Wireless Remote Control with Arduino PT2262 Encoder

 

 
We provide ARDUINO sample code , please contact after your order at Ebay message . 
arduino core fragment(complete code through ebay message  Request):
  
//Author: cantone-electonics
//Arduino 1.0
//Arduino uno R3
//Making a wireless remote control with arduino
const int data_out = 2;//encoder DOUT
 //LED pin,When receiving the key from the serial port, LED flash
const int ledPin =  13;    //LED pin
// OSC Resistance is 3.3M
const int Osc_4xCycle = 359; //4 oscillating time periods
const int Osc_12xCycle = 1078;//12 oscillating time periods
unsigned long Temporary[3];//Temporary storage unit
  
...
 
//send:8 Address Bits, 4 Data Bits, Sync bit
void send_data()
 
void setup() {
  // initialize the LED pin as an output:
  pinMode(ledPin, OUTPUT); 
   // initialize the encoder DOUT pin as an output
  pinMode(data_out, OUTPUT);
 
  Serial.begin(9600);
}
void loop()
{
  ...
  
  while(1)
  {
    //get key from pc serial port
    while (Serial.available() > 0) 
    {
        keydata = Serial.read();
        receive_flag = 1;
        delay(2);
    }
   
    if(receive_flag == 1)//if get key,send key
    {
     
    receive_flag = 0;
   
    if((keydata == 'a') || (keydata == 'A'))//trigger A channel relay.
    {
      Temporary[2] = 0xC0;// 0xC0 is A button key
      digitalWrite(ledPin, HIGH);//Turn on led
      send_data();//send code word
       Serial.println(".....trigger A channel relay.....");
    }
    else if((keydata == 'b') || (keydata == 'B'))//trigger B channel relay.
    {
      Temporary[2] = 0x30;// 0x30 is B button key
      digitalWrite(ledPin, HIGH);//Turn on led
      send_data();//send code word
      Serial.println(".....trigger B channel relay.....");
    }
     else if((keydata == 'c') || (keydata == 'C'))//trigger C channel relay.
     {
      Temporary[2] = 0x0C;// 0x0C is C button key
      digitalWrite(ledPin, HIGH);//Turn on led
      send_data();//send code word
      Serial.println(".....trigger C channel relay.....");
     
     }
     else if((keydata == 'd') || (keydata == 'D'))//trigger D channel relay.
     {
      Temporary[2] = 0x03;// 0x03 is D button key
      digitalWrite(ledPin, HIGH);//Turn on led
      send_data();//send code word
      Serial.println(".....trigger D channel relay.....");
     }
    
    ...
  
  }
}
 
Qty:1 PCS 4channel receiver module
       1 PCS 433M Wireless transmitter module(Does not include Arduino UNO);

 

Wireless transmitter module connected with  Arduino uno(replace PT2262 Remote Keyfob
 
USE: 
 
 
 
 
Software control: 
How to use:send "a" trigger A channel .
 

Decoder schematic:

 

 

4 channels Receiver Modules ;
 
 
 
 

 

 

:
 
 
 

Model No.

CJ005

Operating voltage

5.0VDC ±0.5V

 Working priceple

 Super Heterodyne receiver with decoder , learning type . decoding PT2262, PT2260, PT2240, EV1527 and other learning codeto chip or compatible chips, can learn and store 20 pcs different coded remote control. Intelligently distinguish shock resistance between fixed code and learning code , such as PT2262 and EV1527.

Static current

≤7 mA (DC 5V)

Operating frequency

433MHz

modulation Mode

ASK/OOK

Receiving sensitivity

over -102 dBm (50 Ω)

Speed

< 5 K bps (at 315 MHz, -95 dBm)

Operating temp.

-10 °C ~ +60 °C
Max rate 1 KHZ
Antenns length
20 cm (315 MHz), 18 cm (433.92 MHz)

Dimension

30*13mm

Output signal

TTL level , Momentary, Latch, Toggle ,user can set it  by welding, Latch is defult.

Band width

2MHz(315MHz, Sensitivity go down 3dBm test )
 

Output

A.singnal Non-locking (Momentary)----connect 1  and 2 ;

B.singnal Self-locking (Toggle) ---- connect 2 and 3 ;

C.singnal Inter-locking (Latch) ---- disconnect all  ;

 
 
Inter-locking (Latch): 4-way relay each other to switch, when relay A  is working and locked  ,  relay B C D corresponding to switch off; when B is working and locked , corresponding relay A C D swith off ; Only 1 relay is on among 4 relays A B C D;
 
Non-locking  type (Momentary): Press A and hold it , then A is on.Same as Relay B C D ;
 
Self-lock type (Toggle): 4 chanels opens and closes independently, 4 chanels can work together ,they don’t affect each other . press A button, A relay of work and locked, press again then  disconnected; Same as B C D .
 
User guide :
1: Learing ID : Press learning button , LED is on and beginning to learn ;after learning , LED will flash for a while .Then LED will keep being on to learn the next remote. If perss the learned remoter controller , auto-quit learning within 10 seconds;
2: Delete ID : Keep pressing learning button for 5 seconds , LED will be on and enter deleting . LED off means finishing deleting;
3: Antenna with a soft wire or other hard metals (such as whip antenna), try to straighten. Do not go near metal objects;
4: Power supply voltage requires stable and low ripple factor, multi-level filtering (such as adding beads, inductors, capacitors, etc.);
 
 
Output mode : 

A.singnal Non-locking (Momentary)----connect 1  and 2 ;

B.singnal Self-locking (Toggle) ---- connect 2 and 3 ;

C.singnal Inter-locking (Latch) ---- disconnect all  ;

 
 

Momentary------------Press the Transmitter button A, the receiver relay A is ON, release button A; the receiver relay A is OFF, the same as B/C/D ,Every channel is Independent ;

Toggle---------------Press transmitter button A for 1 time , the receiver relay A is ON, press button A again, the receiver relay A is OFF, the same as B/C/D. Every channel is Independent ; 

 

Latched------------------

Press transmitter button A, the receiver relay A is ON, the relay B/C/D is OFF.

Press transmitter button B, the receiver relay B is ON, the relay A/C/D is OFF.

Press transmitter button C, the receiver relay C is ON, the relay A/B/D is OFF

Press transmitter button D, the receiver relay D is ON, the relay A/B/C is OFF.

 

It also mean .Latched only can keep 1 Channel ON .and it will often have 1Channel is ON.

 
 
 
 
 
 
 

 

 

 

 
 
Application on Atmega8 AVR microcontrollers :

 

Item Description :


Technical Data :
 
 
     Operating frequency (MHz): 433.92MHz
     Transmit power: more than 10mW;
         Operating Voltage (V):  DC 3-12V ;
          Low transmit of the static power consumption is current consumption : 10 mA ( No transmit No current consumption);