Decoding analysis and simulation of 315MHZ and 433Mhz wireless remote control signals

Source: Internet
Author: User

Summary

While learning about the radio, I learned that Arduino was a good choice for my next Raspberry Pi as a skill not yet mature technology. So spent 200 yuan to buy 3 pieces of Arduino Development Board (2*NANO&1*UNO) and other sensors, but also see the 315M Super-regeneration module, because play radio know 315M is the car remote control, anti-theft gate, road and bridge system, such as the most commonly used signal frequency, So I did not hesitate to order. And then we have the results of today. Freebuf also have a lot of such articles, about 315,433 decoding I have mastered a lot of methods (in fact, the use of SDR is a good choice), on the rolling code I also have a certain research and crack, the detailed steps of this article, the idea is clear, hope to everyone useful. Familiar with Arduino and 315 modules can go directly to the third step.

keywords:315M Hyper-regeneration module, Arduino.

Introduction: 315MHz remote control using a wide range of learning and in-depth understanding of its principles and practical operation, in the enjoyment of unlimited fun at the same time, can learn to prevent their own car stolen, and can develop a more secure remote lock equipment, in the process of doing this project I deeply realized that 315M remote control system is a serious problem, The main performance in 315 remote control system decoding simple, simple launch conditions, easy to copy. Here are some of the shallow knowledge I have learned in this study, which is described in detail here.

Here is the rationale for this Learning framework:

Block Diagram Description: The receiving end receives the signal, by the Arduino MCU decodes, and transmits the decoding information through the Bluetooth to the handset, in the mobile phone Bluetooth serial monitor display (decoding process); mobile phone to send 24 remote control code to a single-chip microcomputer, the microcontroller will be 24-bit remote control code sent through the transmitter, Used for remote control analog receiver through the receiving end of the PT2272 chip decoding in the LED signal to get feedback, analog receive driven by SCM Direct power supply, the transmitter signal can also directly have other remote receiver receive to achieve other purposes.

First, the basic knowledge Introduction:

1, Arduino Introduction:

Arduino is a convenient, flexible, and easy-to-start open source electronic prototyping platform that includes hardware (various models of Arduino boards) and software (Arduino IDE). Developed by a European development team as early as the winter of 2005. Its members include Massimo Banzi,david Cuartielles,tom Igoe,gianluca martino,david Mellis and Nicholas Zambetti.

It is built on the open source simple I/O interface version and has a processing/wiring development environment that uses Java-like and C languages. It consists of two main parts: the hardware part is the Arduino circuit board which can be used to make the circuit connection, the other is the Arduino IDE, the program development environment in your computer. As soon as you write program code in the IDE and upload the program to the Arduino board, the program tells the Arduino board what to do.

Arduino is able to perceive the environment through a variety of sensors, and to control the lighting, motors and other devices to feedback and influence the environment. The microcontroller on the board can be programmed in the Arduino programming language, compiled into a binary file, and burned into a microcontroller. The Arduino programming is implemented using the Arduino programming language (based on wiring) and the Arduino development environment (based on processing). Arduino-based projects can include only Arduino, and some other software that runs on the PC, such as Flash, processing, MaxMSP. (Excerpt from Baidu Encyclopedia)

Second, Hardware introduction:

1. Arduino Development Board

Arduino is the most open source hardware in the IT industry, technology homes, students love the single-chip Development Board, its programming language using C language, and not as complex as the programming language of C51 microcontroller, so for the single-chip microcomputer is undoubtedly the best choice for beginners, this topic for simplifying the experimental process, shorten the development time, So choose the simple but powerful Arduino single-chip Development Board, Arduino Development Board has a lot of hardware platforms, the common Arduino has the following two kinds:

(1) Arduino UNO (the Arduino board used in this article) (2) Arduino NANO

2, 315M module, divided into the sending side (right) and the receiving end (left).

3. Remote control and receiver for analog

Transmitter Module PT2262

Receiver Module PT2272

4. Serial Bluetooth module

The serial port Bluetooth module connects directly with the Bluetooth device and transmits to the MCU by receiving the ASCII code in the form of the serial data, the SCM will make the fixed feedback after the data processing, the model HC-06 Bluetooth serial module's default name is "HC-06", the default connection password is "0000", Mobile phone using Bluetooth debugging assistant and other apps can be directly connected and direct communication with the mobile phone, Arduino MCU can be directly with the computer serial communication, but in order to demonstrate operation at any time, the use of direct mobile phone communication to make the operation more convenient, HC-06 the real picture as follows:

Third, decoding and simulation

1, connect the real Picture:

Physical diagram Description: The upper-left corner is the Bluetooth module HC-06 for mobile phone connection control, the left is a 315 receiving decoder board and equipped with remote control, decoder board powered by Arduino, connected to 5 LED lights for the reception of the demo, the middle is the 315M super-regenerative module transmitter and receiver, On the right is the Arduino UNO Development Board.

2, 315M ultra-regenerative module transmission and receiving end connection schematic diagram

3. Simulation Test Effect Description:

The serial port sends the A,B,C,D control to send the single time 24 bit remote control binary code, realizes the LED number a,b,c,d flicker;

The serial port sends the A,B,C,D control to continuously send 24 remote control binary code, realizes the LED number a,b,c,d the solid.

The serial port sends except the above arbitrary command realizes the LED's close.

Iv. decoding verification and source code

1. Decoding Verification

When you press the remote a key

Mobile phone serial monitor to get the remote code for

"010101010101010100001100"

Professional decoder display remote code such as, the actual 24-bit code (I began to think the last one for the decoder design problem caused by the extra bit, no last one can also replay, but later learning I found a lot of decoding methods have retained the last one, the actual signal waveform does not have the last high-level appearance, So 25th place should be "0", for this question I still have doubts, hope everybody help explain)

Logic Analyzer Analysis Results

According to the above three sets of data comparison, verify the MCU decoding without any problems.

2. The Arduino source code is as follows:

/*This work uses a routine that contains the Rcswitch library file for decoding and encoding the signal sent*/#include<RCSwitch.h>Rcswitch myswitch=Rcswitch ();voidSetup () {Serial.begin (9600);//Serial Print command help informationSerial.print ("Help:a-flash the lamp a\n b-flash the lamp b\n c-flash the lamp c\n D-flash the lamp d\n"); Serial.print ("A-open the lamp a\n b-open the lamp b\n c-open the lamp c\n D-open the lamp d\n\n"); Myswitch.enablereceive (1); Myswitch.enabletransmit (Ten);}2voidLoop () {if(Myswitch.available ()) {output (Myswitch.getreceivedvalue (), Myswitch.getreceivedbitlength (),   Myswitch.getreceiveddelay (), Myswitch.getreceivedrawdata (), Myswitch.getreceivedprotocol ());    Myswitch.resetavailable (); }  /*same switch as above,but using binary code*/  if(Serial.available () >0)//If the serial port has data entry,{Delay (Ten);//Delay 50 You can send multiple commands at once   CharM=serial.read ();//each time you read a character, it's ASCII.   if(m=='A') {Serial.print ("Thecommand is a\n"); Myswitch.send ("010101010101010100001100");//Remote Control-ASerial.print ("OK!!! The LED A has been done\n"); }       if(m=='a') {Serial.print ("The command is a\n"); Serial.print ("OK!!! Theled A has hlod on\n");  while(Serial.available () <=0) {myswitch.send ("010101010101010100001100");//remote Control-a press the      }    }  if(m=='B') {Serial.print ("Thecommand is b\n"); Myswitch.send ("010101010101010111000000");//Remote Control-BSerial.print ("OK!!! The LED B has been done\n"); }     if(m=='b') {Serial.print ("The command is b\n"); Serial.print ("OK!!! The LED B has hlod on\n");  while(Serial.available () <=0) {myswitch.send ("010101010101010111000000");//Remote Control-B Press No      }    }  if(m=='C') {Serial.print ("Thecommand is c\n"); Myswitch.send ("010101010101010100000011");//Remote Control-CSerial.print ("OK!!! The LED C has been done\n"); }         if(m=='C') {Serial.print ("The command is c\n"); Serial.print ("OK!!! Theled C has hlod on\n");  while(Serial.available () <=0) {myswitch.send ("010101010101010100000011");//Remote Control-C press the      }    }  if(m=='D') {Serial.print ("Thecommand is d\n"); Myswitch.send ("010101010101010100110000");//Remote Control-DSerial.print ("OK!!! The LED D has been done\n"); }         if(m=='D') {Serial.print ("The command is d\n"); Serial.print ("OK!!! Theled D has hlod on\n");  while(Serial.available () <=0) {myswitch.send ("010101010101010100110000");//Remote Control-D Press no      }    }  }}

The vehicle remote Code decoder is conveniently used in the whole process to verify the correctness of the experiment decoding.

Reference documents:

[1] Steven F.barrett. The Arduino Advanced Development Authority Guide. 2, mechanical industry Press: Pan Xinlei, 2014

[2] Network information

Decoding analysis and simulation of 315MHZ and 433Mhz wireless remote control signals

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.