Hackster is hosting Hackster Holidays, Ep. 5: Livestream & Giveaway Drawing. Watch previous episodes or stream live on Friday!Stream Hackster Holidays, Ep. 5 on Friday!
sagar saini
Published © GPL3+

Battery-less Self Powered Radio Transmitter

A wireless transmitter without battery, works on EV1527 encoding scheme. Radio transmission with fully secure wireless channel.

IntermediateFull instructions provided2 hours125
Battery-less Self Powered Radio Transmitter

Things used in this project

Hardware components

DFRobot Self powered switch DF robot radio transmitter
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Schematics

Transmitter Circuit Diagram

Code

Pairing code for receiver

Arduino
#define Button_D2 2 //Arduino


void setup() {
    Serial.begin(115200);
    pinMode(Button_D2, INPUT);
}
void loop() {
    if (digitalRead(Button_D2)) {
        Serial.println("PressedD2");
        delay(1000);
    }
}

Main Receiver code

Arduino
#define Button_D2 2//Arduino
#define Button_D3 3//Arduino
#define Button_D4 4//Arduino
#define Button_D5 5//Arduino

void setup() {
  Serial.begin(115200);
  pinMode(Button_D2, INPUT);
  pinMode(Button_D3, INPUT);
  pinMode(Button_D4, INPUT);
  pinMode(Button_D5, INPUT);
  pinMode(6, OUTPUT);
  pinMode(7, OUTPUT);
  pinMode(8, OUTPUT);
  pinMode(9, OUTPUT);
}
void loop() {
  if (((digitalRead(Button_D5)==0) && (digitalRead(Button_D4)==0) && (digitalRead(Button_D3)==0)&& (digitalRead(Button_D2)==0))) {
    Serial.println("State:0");
    digitalWrite(6, LOW);
    digitalWrite(7, LOW);
    digitalWrite(8, LOW);
    digitalWrite(9, LOW);
    delay(500);
  }
    if (((digitalRead(Button_D5)==0) && (digitalRead(Button_D4)==0) && (digitalRead(Button_D3)==0)&& (digitalRead(Button_D2)==1))) {
    Serial.println("State:1");
    digitalWrite(6, HIGH);
    digitalWrite(7, LOW);
    digitalWrite(8, LOW);
    digitalWrite(9, LOW);
    delay(500);
  }
    if (((digitalRead(Button_D5)==0) && (digitalRead(Button_D4)==0) && (digitalRead(Button_D3)==1)&& (digitalRead(Button_D2)==0))) {
    Serial.println("State:2");
    digitalWrite(6, LOW);
    digitalWrite(7, HIGH);
    digitalWrite(8, LOW);
    digitalWrite(9, LOW);
    delay(500);
  }
     if (((digitalRead(Button_D5)==0) && (digitalRead(Button_D4)==1) && (digitalRead(Button_D3)==0)&& (digitalRead(Button_D2)==0))) {
    Serial.println("State:4");
    digitalWrite(6, LOW);
    digitalWrite(7, LOW);
    digitalWrite(8, HIGH);
    digitalWrite(9, LOW);
    delay(500);
  }
    if (((digitalRead(Button_D5)==1) && (digitalRead(Button_D4)==0) && (digitalRead(Button_D3)==0)&& (digitalRead(Button_D2)==0))) {
    Serial.println("State:8");
    digitalWrite(6, LOW);
    digitalWrite(7, LOW);
    digitalWrite(8, LOW);
    digitalWrite(9, HIGH);
    delay(500);
  }
    if (((digitalRead(Button_D5)==0) && (digitalRead(Button_D4)==0) && (digitalRead(Button_D3)==1)&& (digitalRead(Button_D2)==1))) {
    Serial.println("State:3");
    digitalWrite(6, HIGH);
    digitalWrite(7, HIGH);
    digitalWrite(8, LOW);
    digitalWrite(9, LOW);
    delay(500);
  }
     if (((digitalRead(Button_D5)==0) && (digitalRead(Button_D4)==1) && (digitalRead(Button_D3)==0)&& (digitalRead(Button_D2)==1))) {
    Serial.println("State:5");
    digitalWrite(6, HIGH);
    digitalWrite(7, LOW);
    digitalWrite(8, HIGH);
    digitalWrite(9, LOW);
    delay(500);
     }
    if (((digitalRead(Button_D5)==0) && (digitalRead(Button_D4)==1) && (digitalRead(Button_D3)==1)&& (digitalRead(Button_D2)==0))) {
    Serial.println("State:6");
    digitalWrite(6, LOW);
    digitalWrite(7, HIGH);
    digitalWrite(8, HIGH);
    digitalWrite(9, LOW);
    delay(500);
     }
    if (((digitalRead(Button_D5)==0) && (digitalRead(Button_D4)==1) && (digitalRead(Button_D3)==1)&& (digitalRead(Button_D2)==1))) {
    Serial.println("State:7");
    digitalWrite(6, HIGH);
    digitalWrite(7, HIGH);
    digitalWrite(8, HIGH);
    digitalWrite(9, LOW);
    delay(500);
     }
    if (((digitalRead(Button_D5)==1) && (digitalRead(Button_D4)==0) && (digitalRead(Button_D3)==0)&& (digitalRead(Button_D2)==1))) {
    Serial.println("State:9");
    digitalWrite(6, HIGH);
    digitalWrite(7, LOW);
    digitalWrite(8, LOW);
    digitalWrite(9, HIGH);
    delay(500);
     }
    if (((digitalRead(Button_D5)==1) && (digitalRead(Button_D4)==0) && (digitalRead(Button_D3)==1)&& (digitalRead(Button_D2)==0))) {
    Serial.println("State:10");
    digitalWrite(6, LOW);
    digitalWrite(7, HIGH);
    digitalWrite(8, LOW);
    digitalWrite(9, HIGH);
    delay(500);
     }
    if (((digitalRead(Button_D5)==1) && (digitalRead(Button_D4)==0) && (digitalRead(Button_D3)==1)&& (digitalRead(Button_D2)==1))) {
    Serial.println("State:11");
    digitalWrite(6, HIGH);
    digitalWrite(7, HIGH);
    digitalWrite(8, LOW);
    digitalWrite(9, HIGH);
    delay(500);
     }
    if (((digitalRead(Button_D5)==1) && (digitalRead(Button_D4)==1) && (digitalRead(Button_D3)==0)&& (digitalRead(Button_D2)==0))) {
    Serial.println("State:12");
    digitalWrite(6, LOW);
    digitalWrite(7, LOW);
    digitalWrite(8, HIGH);
    digitalWrite(9, HIGH);
    delay(500);
     }

     if (((digitalRead(Button_D5)==1) && (digitalRead(Button_D4)==1) && (digitalRead(Button_D3)==0)&& (digitalRead(Button_D2)==1))) {
    Serial.println("State:13");
    digitalWrite(6, HIGH);
    digitalWrite(7, LOW);
    digitalWrite(8, HIGH);
    digitalWrite(9, HIGH);
    delay(500);
     }
     if (((digitalRead(Button_D5)==1) && (digitalRead(Button_D4)==1) && (digitalRead(Button_D3)==1)&& (digitalRead(Button_D2)==0))) {
    Serial.println("State:14");
    digitalWrite(6, LOW);
    digitalWrite(7, HIGH);
    digitalWrite(8, HIGH);
    digitalWrite(9, HIGH);
    delay(500);
     }
    if (((digitalRead(Button_D5)==1) && (digitalRead(Button_D4)==1) && (digitalRead(Button_D3)==1)&& (digitalRead(Button_D2)==1))) {
    Serial.println("State:15");
    digitalWrite(6, HIGH);
    digitalWrite(7, HIGH);
    digitalWrite(8, HIGH);
    digitalWrite(9, HIGH);
    delay(500);
     }
   
  delay(100);
}

Credits

sagar saini

sagar saini

81 projects • 85 followers
I am Sagar Saini an electronic hardware enthusiast

Comments