├── README.md ├── rf_emitter.ino └── rf_receiver.ino /README.md: -------------------------------------------------------------------------------- 1 | # RF-Security-Exploration-Arduino-FlipperZero 2 | This Arduino sketch uses RCSwitch library and Flipper Zero to receive and process RF signals. The code listens for a 12-bit CAME protocol fixed code, and turns on an LED when detected. A beginner-friendly foundation for legal exploration of RF security and ethical hacking. 3 | 4 | Link of the video: https://youtu.be/uOiL11WfuUk 5 | -------------------------------------------------------------------------------- /rf_emitter.ino: -------------------------------------------------------------------------------- 1 | #include // Include the RC-Switch library for handling RF communication 2 | 3 | // Set up the RF transmitter 4 | const int TRANSMITTER_PIN = 12; // The transmitter is connected to pin 12 5 | RCSwitch mySwitch = RCSwitch(); // Create a new RCSwitch object 6 | 7 | // Set the CAME protocol fixed code 8 | unsigned long CAME_CODE = 0b001011001010; // 12-bit code 9 | 10 | const int button = 2; // Button is connected to pin 2 11 | void setup() { 12 | pinMode(button, INPUT); // Set the button pin as an input 13 | Serial.begin(9600); // Initialize serial communication at 9600 baud rate 14 | mySwitch.enableTransmit(TRANSMITTER_PIN); // Enable the transmitter on pin 12 15 | mySwitch.setProtocol(1); // Protocol 1 is the default 16 | mySwitch.setPulseLength(320); // Adjust the pulse length if needed 17 | } 18 | 19 | void loop() { 20 | if (digitalRead(button) == 1) { // Check if the button is pressed 21 | mySwitch.send(CAME_CODE, 12); // Send the 12-bit CAME code 22 | Serial.print("Sent code: "); 23 | Serial.println(CAME_CODE, DEC); // Print the sent code to the serial monitor in decimal format 24 | delay(1000); // Wait for 1 second (1000 milliseconds) 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /rf_receiver.ino: -------------------------------------------------------------------------------- 1 | #include // Include the RC-Switch library for handling RF communication 2 | 3 | // Set up the RF receiver 4 | const int RECEIVER_PIN = 2; // Use interrupt 0 (pin 2 on most Arduino boards) 5 | RCSwitch mySwitch = RCSwitch(); // Create a new RCSwitch object 6 | 7 | // Set up the LED 8 | const int LED_PIN = 12; // The LED is connected to pin 12 9 | 10 | // Set the CAME protocol fixed code 11 | unsigned long CAME_CODE = 0b001011001010; // 12-bit code 12 | 13 | void setup() { 14 | pinMode(LED_PIN, OUTPUT); // Set the LED pin as an output 15 | digitalWrite(LED_PIN, LOW); // Turn the LED off initially 16 | 17 | Serial.begin(9600); // Initialize serial communication at 9600 baud rate 18 | mySwitch.enableReceive(0); // Enable the receiver on interrupt 0, which corresponds to pin #2 19 | } 20 | 21 | void loop() { 22 | if (mySwitch.available()) { // Check if there is a signal available from the receiver 23 | unsigned long receivedValue = mySwitch.getReceivedValue(); // Get the received value 24 | int receivedBitLength = mySwitch.getReceivedBitlength(); // Get the received bit length 25 | 26 | // Check if the received value matches the predefined CAME code and the bit length is 12 27 | if (receivedValue == CAME_CODE && receivedBitLength == 12) { 28 | digitalWrite(LED_PIN, HIGH); // Turn the LED on 29 | Serial.println(receivedValue); // Print receivedValue to the serial monitor 30 | delay(2000); // Wait for 2 seconds (2000 milliseconds) 31 | digitalWrite(LED_PIN, LOW); // Turn the LED off 32 | } else { 33 | digitalWrite(LED_PIN, LOW); // If the received value doesn't match, turn the LED off 34 | } 35 | mySwitch.resetAvailable(); // Reset the availability status of the received signal 36 | } 37 | } 38 | --------------------------------------------------------------------------------