--> Project V - 38. Arduino Interface with Wireless 433 Mhz Module | basic arduino tutorial

Friday, August 18, 2017

Project V - 38. Arduino Interface with Wireless 433 Mhz Module

| Friday, August 18, 2017
Arduino Interface with Wireless 433 Mhz Module



Serial port communication using Wireless Module HC-12 is a new generation multipannel wireless data transmission module. The wireless working frequency band is 433.4 - 473.0 MHz, some channels can be set, with a multiple of 400 KHz, and a total of 100 channels. The maximum transmission power of the module is 100mW (20dBm), the reception sensitivity is -117dBm at 5,000bps baud rate in the air, and communication distance of 1,000m in open space. Transmitter Module and Receiver Module are required to work.


Hardware Requirement
  • Arduino Uno Board
  • RF Module 433 Mhz
  • Power supply +5 Volt
  • Jumper

RF 433 Mhz Module | Source

Block Diagram


Schematic




Arduino - Transmiter Wiring




Arduino - Receiver Wiring


Source Code/Sketch --> Receiver

#include <VirtualWire.h>
String inString="";
void setup(){
Serial.begin(9600);
Serial.println("Interfacing Arduino dg Wireless 433MHz");
vw_set_ptt_inverted(true); // Required for DR3100
vw_set_rx_pin(12);
vw_setup(4000); // Bits per sec
vw_rx_start(); // Start the receiver PLL running
}
void loop(){
uint8_t buf[VW_MAX_MESSAGE_LEN]; //data RF
uint8_t buflen = VW_MAX_MESSAGE_LEN; //panjang data
if (vw_get_message(buf, &buflen)){ // Non-blocking
inString="";
for(char i; i<buflen; i++){
inString += char(buf[i]);
}
Serial.println(inString);
}
}

Source Code/Sketch --> Transmiter


#include <VirtualWire.h>
char *controller;
void setup() {
Serial.begin(9600);
pinMode(13,OUTPUT);
vw_set_ptt_inverted(true); //
vw_set_tx_pin(12);
vw_setup(4000);// speed of data transfer Kbps
}
void loop(){
controller="Hello World 2K17";
vw_send((uint8_t *)controller, strlen(controller));
vw_wait_tx(); // Wait until the whole message is gone
digitalWrite(13,1);
delay(100);
digitalWrite(13,0);
delay(1000);
}

How it Works

1. Connect the Arduino with Peripherals needed.
2. Plug in the Power Source on the device.

3. Add some library if needed
4. Compile and upload the script program above to your arduino.
5. Wireless data sent in the form of writing "Hello World 2K17". 
6. Open the monitor serial on the Arduino sketch program connected to the Reciver com. The result 
   is as follows.





Video for Project V - 38. Arduino Interface with Wireless 433 Mhz Module





Required file


Related Posts

No comments:

Post a Comment