Using a 315MHz RF Remote with an Arduino

//Using a 315MHz RF Remote with an Arduino

How to use a 315MHz RF Remote with an Arduino


We already did a tutorial on how to use an IR remote control, today we will learn how to use an RF remote.

Since the RF signals can go through walls, this kind of remote can be useful when your project is in another room.

The remote has 4 buttons which corresponds to 4 pins on the receiver.  The RF module uses the SC2272-M4, which is the momentary version, so the pin will stay HIGH as long as we hold down the button.

We will use a 4bits 7 segment LED display to show which button was pressed instead of the serial monitor.


Both the Display and the RF receiver need 5V and Ground.

We are connecting the 5V – GND of the Arduino to the breadboard power rails so we can connect both modules.

The RF receiver has 4 pins for each buttons, and one DT (trigger) pin that will activate if any buttons is pressed.

The Display uses the I2C bus, so it only needs 2 pins.


We are using the TM1637 library to drive the 7 segment display.

Instead of IF statements to detect which button is pressed, we will use WHILE loops in our code instead.

This way our code will pause and wait for us to press a button, instead of looping and having to refresh the 7 segment display over and over again.

The first WHILE loop will check all the receiver pins, if ALL of them are LOW, the code will stay in the loop, if any button is pressed, then that pin will become HIGH making the condition false and the code will exit the loop.

The other WHILE loops check which pin is HIGH and execute the code inside.

As always, you can have a look at the tutorial video for more information.

#include "TM1637Display.h"  //  Library for 7 segment Display

//0~9,A,b,C,d,E,F  // Available for display

#define CLK 3  // Pins for display     
#define DIO 4
TM1637Display tm1637(CLK,DIO);

void setup(){
  tm1637.init();  // Reset Display 
  delay(1500);  // Delay to let system boot 

void loop(){

  while (digitalRead(9) == LOW && digitalRead(10) == LOW && digitalRead(11) == LOW && digitalRead(12) == LOW) {
    tm1637.display(3,0);  // Loops until button is pressed
  tm1637.clearDisplay();  // Clear display
  while (digitalRead(9) == HIGH) {  // Button 1 pressed
  while (digitalRead(10) == HIGH) {  // Button 2 pressed
  while (digitalRead(11) == HIGH) {  // Button 3 pressed
  while (digitalRead(12) == HIGH) {  // Button 4 pressed


Copy and paste the above code in the Arduino IDE to program your Arduino.

Used Libraries:

Download the TM1637 created by avishorp here:

Once downloaded, just extract the content of the zip files inside your “arduino/libraries” folder.

By | 2018-02-23T17:27:13-05:00 January 30th, 2015|Tutorials|


  1. Maiquel June 9, 2020 at 5:13 pm - Reply

    Olá! Não encontrei esse módulo RF no fritzing. Onde enctrou essa peça?

  2. Spencer July 20, 2018 at 6:09 pm - Reply

    I would love to know this answer as well, Please.

  3. Sohail Khawaja March 7, 2018 at 2:51 pm - Reply

    I hv a similar M series momentary kit. How can I use the Arduino Uni to turn this project into a latching unit?
    In other words I want to press button 1 and the relay switches on even after I stop holding the button. Upon pressing the button 1 again, I want the relay to switch off. Please explain if this is possible.

Leave A Comment