Friday, July 3, 2020

433MHz Transmitter and Receiver Interfacing with Arduino Uno By Engr.Habib Ur Rehman



433MHz Transmitter and Receiver Interfacing
                       with Arduino Uno
                By Engr.Habib Ur Rehman 


Components/Equipment Required:

            Following Components/Equipment are required to perform task.

1.    Arduino Uno

2.    433MHz Transmitter and Receiver

3.    Breadboard

4.    Jumper Wires

433Mhz Transmitter

Circuit Diagram:

Arduino Program:

#include <RH_ASK.h>

#include <SPI.h> 

RH_ASK rf_driver;

void setup()

{

    if (rf_driver.init())

     {

         Serial.begin(9600);

         Serial.println("init Sucesssful");

     }

     else if (!rf_driver.init())

     {

         Serial.println("init Fail");

     }

}

void loop()

{

    const char *msg = " Pak Innovative Electronics & Embedded Systems (PIEES)";

    rf_driver.send((uint8_t *)msg+1, strlen(msg));

    rf_driver.waitPacketSent();

    delay(1000);

}

Note:

            Radio Head Library folder should be added in Arduino library folder “C:\Program Files\Arduino\libraries”

433Mhz Reciever

Circuit Diagram:

Arduino Program:

#include <RH_ASK.h>

#include <SPI.h>

RH_ASK rf_driver;

void setup()

{

    if (rf_driver.init())

     {

         Serial.begin(9600);

         Serial.println("init Sucesssful");

     }

     else if (!rf_driver.init())

     {

         Serial.println("init Fail");

     }

}

void loop()

{

    uint8_t buf[54];

    uint8_t buflen = sizeof(buf);

    if (rf_driver.recv(buf, &buflen))

    {

      Serial.print("Message Received:");

      Serial.println((char*)buf);        

    }

}

Note:

            Radio Head Library folder should be added in Arduino library folder “C:\Program Files\Arduino\libraries”

 

 


No comments:

Post a Comment