Lora module E19-433M30S How to setup at full power 1W(30dBm)

Hello,

We encountered difficulty trying to transmit and receive a message from 5 km apart. We bought two transceiver modules from Sparkfun (LoRa 1W Breakout, 433M30S) with a matched antenna at 50 ohms impedance. The codes for transmitter and receiver can be found at the end of the document. When the power command (lora.setOutputPower(30)) was set at 30 dbm (1W), the Arduino library didn’t accept it and didn’t work. Moreover, when set at 20 dBm, the transmission worked but with a weak signal (high RSSI). Both receiver and transmitter codes can be seen at the end for your kind attention.
Kindly could you indicate the way forward or otherwise so we could be able to transmit at full power at 1W?

We also followed the FAQ found on the user manual but with no avail, as seen below.


• The communication distance will be affected when obstacle exists.

When tested, no obstacles were here.

• Data lose rate will be affected by temperature, humidity and co-channel interference.

No abnormal temperature and humidity, and no co-channel interference.

• The ground will absorb and reflect wireless radio wave, so the performance will be poor when testing near ground.

The receiver and transmitter were placed 1.5 meters above the ground on a stand when testing.

• Sea water has great ability in absorbing wireless radio wave, so performance will be poor when testing near the sea.

The setup was tested at the countryside.

• The signal will be affected when the antenna is near metal object or put in a metal case.
The setup was tested with no near metal objects nor placed in metal case at the line of sight.

• Power register was set incorrectly, air data rate is set as too high (the higher the air data rate, the shorter the distance).
Power register was set 30dbm and the outcome was the Arduino library didn’t accept it, and also when the register was at 20dbm the signal was too weak. Moreover, the air data rate was selected at minimum.

• The power supply low voltage under room temperature is lower than 2.5V, the lower the voltage, the lower the
transmitting power.

The power supply was correctly given 5.0V at 1A.

• Due to antenna quality or poor matching between antenna and module.

The antenna is perfectly matched at 50ohms for both module and antenna.


LoRa 1W Breakout - 433M30S for both transmitter and Receiver

Transmitter code

#include <RadioLib.h>

// SX1276 has the following connections: NSS, DIO0, DIO1, RST, MOSI, MISO, SCK
SX1276 lora = new Module(10, 2, 9, 3); // NSS, DIO0, RESET, DIO1

int txPower = 30; //

void setup() {
Serial.begin(9600);

// Initialize LoRa communication at the desired frequency (e.g., 433 MHz or 915 MHz)
Serial.print(F("Initializing LoRa… "));
int state = lora.begin(433.0);
if (state == RADIOLIB_ERR_NONE) {
Serial.println(F(“success!”));
} else {
Serial.print(F("failed, code "));
Serial.println(state);
while (true);
}

// Set output power
lora.setOutputPower(txPower);

Serial.print(F(“Transmit power set to: “));
Serial.print(txPower);
Serial.println(F(” dBm”));
}

void loop() {
// Send packet every second
String message = “LoRa Test Packet”;
Serial.print(F("Sending packet: "));
Serial.println(message);

int state = lora.transmit(message);

// Check for transmit success
if (state == RADIOLIB_ERR_NONE) {
Serial.println(F(“success!”));
} else {
Serial.print(F("failed, code "));
Serial.println(state);
}

// Wait a second before sending another packet
delay(1000);

Receiver Code

#include <RadioLib.h>
#include <math.h>

// SX1276 module configuration
SX1276 lora = new Module(10, 2, 9, 3); // NSS, DIO0, RESET, DIO1

// Propagation parameters
float A = -71; // RSSI at 1 meter (calibrated value)
float n = 2.0; // Path loss exponent (adjust based on environment)

void setup() {
Serial.begin(9600);

// Initialize LoRa communication at the desired frequency (433 MHz for this example)
Serial.print(F("Initializing LoRa… "));
int state = lora.begin(433.0);
if (state == RADIOLIB_ERR_NONE) {
Serial.println(F(“success!”));
} else {
Serial.print(F("failed, code "));
Serial.println(state);
while (true);
}

Serial.println(F(“LoRa Receiver Ready”));
}

void loop() {
// Receive LoRa packet
String str;
int state = lora.receive(str);

// Check if a packet was received
if (state == RADIOLIB_ERR_NONE) {
// Packet received successfully
Serial.print(F("Received packet: "));
Serial.println(str);

// Get RSSI
int rssi = lora.getRSSI();
Serial.print(F("RSSI: "));
Serial.println(rssi);

// Calculate and display estimated distance
float distance = calculateDistance(rssi, A, n);
Serial.print(F("Estimated distance: "));
Serial.print(distance);
Serial.println(F(" meters"));

} else if (state == RADIOLIB_ERR_RX_TIMEOUT) {
// Timeout error, no packet received
//Serial.println(F(“Receive timeout”));
} else {
// Some other error occurred
Serial.print(F("Receive failed, code "));
Serial.println(state);
}

// Wait a moment before checking for another packet
delay(1000);
}

// Function to calculate distance based on RSSI
float calculateDistance(int rssi, float A, float n) {
// RSSI distance formula: d = 10^((A - RSSI) / (10 * n))
float distance = pow(10, (A - rssi) / (10 * n));
return distance;
}

Thank you very much in advance for your kind help

Saviour

What antennae are you using? It make a BIG difference in-field (our testing used a 5.8dBi one)

Also ensure when transmitting above 20dBm the duty cycle remains under 1% (*hardware limited)

Better antennas would help a lot. The rubber duck antennas it looks like you’re using are not very good at long range. Look for something with 6db or higher gain.

Many thanks for your reply,

Apart from changing the antenna, is there any software adjustment to do in the RadioLib.h library as shown below. Also found that this module has an external Power Amplifier, is there any gain adjustment found in the library should I could do?

[RadioLib/examples/SX127x/SX127x_Settings/SX127x_Settings.ino at master · jgromes/RadioLib · GitHub]

/*
RadioLib SX127x Settings Example

This example shows how to change all the properties of LoRa transmission.
RadioLib currently supports the following settings:

  • pins (SPI slave select, digital IO 0, digital IO 1)
  • carrier frequency
  • bandwidth
  • spreading factor
  • coding rate
  • sync word
  • output power during transmission

Other modules from SX127x/RFM9x family can also be used.

For default module settings, see the wiki page
Default configuration · jgromes/RadioLib Wiki · GitHub

For full API reference, see the GitHub Pages
RadioLib: RadioLib Documentation
*/

// include the library
#include <RadioLib.h>

// SX1278 has the following connections:
// NSS pin: 10
// DIO0 pin: 2
// RESET pin: 9
// DIO1 pin: 3
SX1278 radio1 = new Module(10, 2, 9, 3);

// SX1272 has different connections:
// NSS pin: 9
// DIO0 pin: 4
// RESET pin: 5
// DIO1 pin: 6
SX1272 radio2 = new Module(9, 4, 5, 6);

// or detect the pinout automatically using RadioBoards
// GitHub - radiolib-org/RadioBoards: Crowd-sourced database of radio module pinouts
/*
#define RADIO_BOARD_AUTO
#include <RadioBoards.h>
Radio radio3 = new RadioModule();
*/

void setup() {
Serial.begin(9600);

// initialize SX1278 with default settings
Serial.print(F("[SX1278] Initializing … "));
int state = radio1.begin();
if (state == RADIOLIB_ERR_NONE) {
Serial.println(F(“success!”));
} else {
Serial.print(F("failed, code "));
Serial.println(state);
while (true) { delay(10); }
}

// initialize the second LoRa instance with
// non-default settings
// this LoRa link will have high data rate,
// but lower range
// NOTE: when using spreading factor 6, the total packet
// length has to be known in advance!
// you have to pass the number of expected bytes
// to the receive() method
Serial.print(F("[SX1272] Initializing … "));
// carrier frequency: 915.0 MHz
// bandwidth: 500.0 kHz
// spreading factor: 6
// coding rate: 5
// sync word: 0x34
// output power: 2 dBm
// preamble length: 20 symbols
// amplifier gain: 1 (maximum gain)
state = radio2.begin(915.0, 500.0, 6, 5, 0x34, 2, 20, 1);
if (state == RADIOLIB_ERR_NONE) {
Serial.println(F(“success!”));
} else {
Serial.print(F("failed, code "));
Serial.println(state);
while (true) { delay(10); }
}

// you can also change the settings at runtime
// and check if the configuration was changed successfully

// set carrier frequency to 433.5 MHz
if (radio1.setFrequency(433.5) == RADIOLIB_ERR_INVALID_FREQUENCY) {
Serial.println(F(“Selected frequency is invalid for this module!”));
while (true) { delay(10); }
}

// set bandwidth to 250 kHz
if (radio1.setBandwidth(250.0) == RADIOLIB_ERR_INVALID_BANDWIDTH) {
Serial.println(F(“Selected bandwidth is invalid for this module!”));
while (true) { delay(10); }
}

// set spreading factor to 10
if (radio1.setSpreadingFactor(10) == RADIOLIB_ERR_INVALID_SPREADING_FACTOR) {
Serial.println(F(“Selected spreading factor is invalid for this module!”));
while (true) { delay(10); }
}

// set coding rate to 6
if (radio1.setCodingRate(6) == RADIOLIB_ERR_INVALID_CODING_RATE) {
Serial.println(F(“Selected coding rate is invalid for this module!”));
while (true) { delay(10); }
}

// set LoRa sync word to 0x14
// NOTE: value 0x34 is reserved for LoRaWAN networks and should not be used
if (radio1.setSyncWord(0x14) != RADIOLIB_ERR_NONE) {
Serial.println(F(“Unable to set sync word!”));
while (true) { delay(10); }
}

// set output power to 10 dBm (accepted range is -3 - 17 dBm)
// NOTE: 20 dBm value allows high power operation, but transmission
// duty cycle MUST NOT exceed 1%
if (radio1.setOutputPower(10) == RADIOLIB_ERR_INVALID_OUTPUT_POWER) {
Serial.println(F(“Selected output power is invalid for this module!”));
while (true) { delay(10); }
}

// set over current protection limit to 80 mA (accepted range is 45 - 240 mA)
// NOTE: set value to 0 to disable overcurrent protection
if (radio1.setCurrentLimit(80) == RADIOLIB_ERR_INVALID_CURRENT_LIMIT) {
Serial.println(F(“Selected current limit is invalid for this module!”));
while (true) { delay(10); }
}

// set LoRa preamble length to 15 symbols (accepted range is 6 - 65535)
if (radio1.setPreambleLength(15) == RADIOLIB_ERR_INVALID_PREAMBLE_LENGTH) {
Serial.println(F(“Selected preamble length is invalid for this module!”));
while (true) { delay(10); }
}

// set amplifier gain to 1 (accepted range is 1 - 6, where 1 is maximum gain)
// NOTE: set value to 0 to enable automatic gain control
// leave at 0 unless you know what you’re doing
if (radio1.setGain(1) == RADIOLIB_ERR_INVALID_GAIN) {
Serial.println(F(“Selected gain is invalid for this module!”));
while (true) { delay(10); }
}

Serial.println(F(“All settings successfully changed!”));
}

void loop() {
// nothing here
}

Again thank you for your time

Saviour

It’s remarkable you are able to get anything at all at 5 km range and 1.5 meters elevation, unless it’s over a desert or frozen lake, or similarly visual point to point stations.

2 Likes

Hello Brow, TS-Russel and Yellow Dog,

I didn’t be as clear as should be, sorry.

The transmission only lasts max at 250 m apart at 20 dBm, and when tried to increase it at 30 dBm, the Arduino library(RadioLib.h) returns an error. The module was supplied 5V at 1A which was suffcient as requested from the datasheet of the E19-433M30S. Also found that this module has an external Power Amplifier ¶ which I think is a little difficult to setup using the RadioLib.h library. As mentioned on the previous message, could you advise me on how to setup the initial setting of the module?as per this link belowhttps://github.com/jgromes/RadioLib/blob/master/examples/SX127x/SX127x_Settings/SX127x_Settings.ino

Thank you

Saviour

Kind reminder please

Not really…Firstly, SparkX products are experimental designs that may/not have full-functionality @ production time
Second - this https://cdn.sparkfun.com/assets/e/0/f/c/0/SX127x_Transmit.zip is the example on the product page for power transmission settings (but be sure to change to 433)…we don’t offer custom code advice for RadioHead’s libraries :-/

All of the advice I have is included in the example’s notes

Thank you for your help,

This code I already tried it found on the link given.

It’s a little bit sad that this module can’t be operated at full power. Why you advertised that it works at 1W output, but in reality it doesn’t. I spent 130 dollars to buy them for my school project and spent much time searching and did many practical experiments on how to make it work at long distance.

Regards

Saviour

Then you are doing something wrong.

The current range record for LoRa radio modules is over 800 km with clear line of sight, at low power (25 mW). You have to be on a mountain top or in a balloon to get clear line of sight at this range, but transmit power is NOT the issue.

Here is a ground based experiment reporting 60 km range, using an Adafruit Feather LoRa module (I believe that is 10 mW TX power). https://forums.adafruit.com/viewtopic.php?t=208394

NOTE: LoRa radios require careful selection of bandwidth, spreading factor, data rate and several other parameters to obtain maximum range. There is plenty of material on line discussing the choices and their consequences.

And that is certain to be the 1.5 meter height.

OP, even a modest doubling will get above some trees and terrain. You can sometimes also get issues with signal multipath at low angles that are less likely at elevation. It wouldn’t be the first antenna held up with a broomstick, temporarily, for five years.

Thank you for your reply,

I have in possession other modules (10 mW power, DRFZ1278F) with less power and transmit a longer distance (tested 1 km range) than the Sparkfun module (250 m distance range). When tested with the 10 mW module (DRFZ1278F), the signal strength (RSSI) was about 22 dBm at one meter distance; on the other side, when tested with the Sparkfun module, the RSSI at one meter was about 60 dBm. I think the Sparkfun module is working at less power. The strange thing is that both are setup at 20 dBm power on the library (RadioLib.h) on my Arduino that gave me different range; the Arduino code is found at the beginning of my post (for both transmitter and receiver). I think that the Sparkfun module is not working at full power (1W) and might think at the startup setting of the Sparkfun module (E19-433M30S) are wrong, which could be found on this link: https://github.com/jgromes/RadioLib/blob/master/examples/SX127x/SX127x_Settings/SX127x_Settings.ino

Other note that the Sparkfun module is operated by 5V 1A supply as suggested in the user manual of the E19-433M30S. Thus, no supply issue.

Kindly could you commence to provide a code snippet or otherwise for the startup of the Sparkfun module?

Thank you very much and all the best

Saviour

In your full power tests, did you strictly obey the 1% transmit duty cycle restriction at all times? If not, the PA is probably fried.

Thank you very much I appreciate your reply

As for safety, I gradually increased from 10 dBm to 20 dBm at 1 dBm with the same RSSI output measured from the receiver at one meter distance (70 dBm RSSI).

I tried both the modules at 20 dBm; the cheaper works every time I try it, and Sparkfun modules work but are weaker. If in the case PA amplifier is not burnt, kindly indicate the configuration at the statrup code snippet to make it run at 30 dBm as a last resort.

Saviour

It is not even clear that RadioLib fully supports that radio module, nor does it seem that Sparkfun will, either. I think you are wasting your time with it.

I checked and the Feather SX-127x modules are in fact 100 mW maximum transmit power. Multiple published tests have verified that they communicate effectively at dozens of km, clear line of sight, using the RadioHead library.

An advantage of using RadioHead is that it is very simple to implement repeaters and networks that easily handle situations where clear line of sight cannot be directly achieved, endpoint to endpoint.