MisterBotBreak
Published

How to Communicate Using 433MHz Modules

This project will show you how to communicate using 433MHz modules.

BeginnerProtip12 minutes1,137
How to Communicate Using 433MHz Modules

Things used in this project

Hardware components

Arduino UNO & Genuino UNO
Arduino UNO & Genuino UNO
×2
433MHz modules ( transmitter + receiver )
×1
Rotary potentiometer (generic)
Rotary potentiometer (generic)
×1
Jumper wires (generic)
Jumper wires (generic)
×1
SG90 Micro-servo motor
SG90 Micro-servo motor
×1

Software apps and online services

Arduino IDE
Arduino IDE

Story

Read more

Code

Transmitter ( potentiometer value )

Arduino
#include <VirtualWire.h>

void setup() {
  vw_setup(2000);
}
 
void loop() {
  int transmit = analogRead(A0);
  vw_send((byte *) &transmit, sizeof(transmit)); 
  vw_wait_tx(); 
}

Receiver ( potentiometer value )

Arduino
#include <VirtualWire.h>

void setup() {
  Serial.begin(9600);
  vw_setup(2000);
  vw_rx_start(); 
  Serial.println("Value : ");
}

void loop() {
  int transmit;
  byte wireless = sizeof(int);
  vw_wait_rx();
  if (vw_get_message((byte *) &transmit, &wireless)) {
    Serial.println(transmit); 
  }
}

Transmitter ( potentiometer + servo )

Arduino
#include <VirtualWire.h>

void setup() {
  vw_setup(2000);
}
 
void loop() {
  int transmit = analogRead(A0);
  vw_send((byte *) &transmit, sizeof(transmit)); 
  vw_wait_tx(); 
}

Receiver ( potentiometer + servo )

Arduino
#include <VirtualWire.h>
#include <Servo.h>

Servo servo;

void setup() {
  servo.attach(3);
  Serial.begin(9600);
  vw_setup(2000);
  vw_rx_start(); 
  Serial.println("Value : ");
}

void loop() {
  int transmit;
  byte wireless = sizeof(int);
  vw_wait_rx();
  if (vw_get_message((byte *) &transmit, &wireless)) {
    Serial.println(transmit); 
    int valueservo = map(transmit,0,1024,0,180);
    servo.write(valueservo);
  }
}

Credits

MisterBotBreak

MisterBotBreak

37 projects • 66 followers
I love electronic and I make explanatory project on how to control sensors.

Comments