• Worldwide Shipping

  • 24/7 Customer Support

  • FAQ
  • Worldwide Shipping

  • 24/7 Customer Support

  • FAQ

HUM: 433MHz transmitter

You are a beginner with Croduino. Or electronics? A specific module caught your eye, but you do not know how to use it? Do not worry, HUM is here for you! How to Use Module (HUM) is a blog tutorials series by e-radionica where you will find all you need in order to begin working with your favorite module. Tutorials include technical characteristics, work principles, instructions on how to connect the module with Croduino and the basic code. Everything else is left to your imagination.

INTRODUCTION

In today's tutorial, we will find out more about an interesting module for radio communication which transmits at 433 MHz and uses ASK (Amplitude Shift Keying) modulation, i.e. the amplitude modulation. Below, you can find out how it functions and how to use it in one of your projects.

 

• Frequency: 433MHz
• Modulation: ASK
• Receiver output: HIGH - 1/2 od VCC, LOW - 0.7V
• Transmitter voltage: 3V - 12V (higher voltage = greater range)
• Range: Max. 40m indoors, 100m outdoors (for better range, use the antenna (solder it to the ANT place on the board), but also for higher voltage on the transmitter)

HOW DOES IT WORK

These modules are very popular among hobbyists and makers, primarily because of their price, which is very affordable, and simplicity of use. They are mainly used for short-range communication, which depends on the transmitter voltage, the antenna, and the RF noise at 433 MHz frequency in your area. A great thing about these transmitters is that while transmitting a logical "0", the transmitter does not consume extra power (due to ASK modulation), and thus the overall power consumption is reduced, which is great for battery-powered projects.

ASK

In telecommunications, modulations are divided into analog and digital. The goal of analog modulations is to transmit an analog signal through an analog communication channel, while the goal of digital modulations is to transmit a string of digital bits through an analog channel. One of these digital modulations is the ASK modulation used by the observed device. ASK (Amplitude-shift keying) is a type of amplitude modulation that changes the amplitude of a transmitting signal depending on the bit it wants to transmit. So, for example, for logical "1", ASK will have a certain amount of amplitude that is greater than zero and for logical "0", the amplitude will be equal to zero.

 

Designing the antenna

The modules themselves will work well enough, but for shorter distances (several meters). In order to get better reception, i.e. greater range, it is recommended to solder the antenna to both the transmitter and the receiver. In most cases, designing the antenna and the interface circuit is a very complex and detailed process. However, the simplicity of these modules also ensures the simplicity of designing the required antenna. All we need to look out for is the length of the antenna itself.
It is best to use a "single fiber" wire rather than one consisting of multiple smaller wires and since it is easier to explain in English, we'll call it the solid wire.                                                        So, we will use a monopole antenna for which we need to determine how long that wire (the antenna) will be ... it is not enough to just solder any wire and expect it to work, the signal wavelength should be determined first, then we can use half or a quarter of that wavelength to reduce the dimensions of the antenna. We determine the wavelength using the following formula:

where: λ - stands for wavelength, c - the speed of light and f - frequency.
For our antenna that uses 433 MHz frequency, we get a wavelength of 0.69236 m. It would be a rather long antenna, so it is more practical to use only a quarter of the wavelength (if you do not understand why, look at how the antennas work in more detail, but this is for those who want to know more), that is, we need a wire that is 17.31 cm long.

HOW TO CONNECT IT

If you have made your antennas, solder them to the locations shown in the image. If you just want to try out how it works and you have not made antennas, skip this part.

Connect the transmitter (left) and the receiver (right) to Croduino as shown, as well as the potentiometer located on the side of the transmitter.

ARDUINO CODE

To make the programming of our Croduino easier, we will use a ready-made library for these radio modules. Download the "RadioHead" library from the link. After downloading the library, open your Arduino IDE ... in the toolbar, click on "Sketch" > "Include Library" > "Add .ZIP Library ..." > Here you should find the folder where you saved the library, select "RadioHead- 1.89.zip" and click "OK ". Once we have successfully installed the library, it's time to program.

In the following example, we will control the built-in LED on the Croduino's pin 13 (the side where the receiver is located) by turning the potentiometer on the side of the transmitter. Upload the code, for the transmitter and for the receiver separately.

Transmitter

#include "RH_ASK.h"
#include "SPI.h"
// pin 12 for data
RH_ASK driver; // creating the RH_ASK object
uint8_t buff[2]; // buffer
uint8_t bufflen = sizeof(buff); // buffer size in bytes
uint16_t value; // the value to which we save the adc readings
void setup() {
Serial.begin(9600);
if (!driver.init()) { // initialization
Serial.println("init failed");
}
}
void loop() {
value = analogRead(0); // reading the potentiometer values
buff[0] = value; // saving the first 8 bits of the adc value to the first byte of the buffer
buff[1] = (value >> 8); // saving the 9th and 10th bit of the adc value to the second byte of the buffer
driver.send(buff, &bufflen); // sending data from the buffer
driver.waitPacketSent(); // wait until it is sent
delay(200);
}

Receiver

#include "RH_ASK.h"
#include "SPI.h"
// pin 11 for data
RH_ASK driver; // creating the RH_ASK object
uint8_t buff[2]; // buffer
uint8_t bufflen = sizeof(buff); // buffer size in bytes
uint16_t value; // the variable in which the adc value will be reconstructed
void setup() {
Serial.begin(9600); // start serial communication
if (!driver.init()) { // if the receiver is not successfully initialized
Serial.println("init failed");
}
pinMode(13, OUTPUT); // LED as an output
}
void loop() {
if (driver.recv(buff, &bufflen) ) { // saving the received values to the buffer
value = buff[0]; // saving the first 8 bits to the value "value"
value |= (buff[1] < 512) {
digitalWrite(13, HIGH);
}
// otherwise, turn the LED off
else {
digitalWrite(13, LOW);
}
}
Leave a Reply