ESP32 Lora sx1278 power problem

Hi, I have a xiao esp32 connected with a lora module (sx1278) and a gps module (L80), but I have a power problem. When I power the esp32 this one doesn't run the code if the sx1278 is powered by the 3.3v pin. But if connect the module with a different power supply, the code runs without problems.

I think the problem is when the sx1278 starts to consume so much power and the esp32 crash, I'm not sure, but It's what I think. The idea is use the power supply of the esp32 so idk if I need to add something, or what is causing the problem, any help is appreciated.

Difficult to answer, since you have not said what code it is that does not run, or what you mean by doesn't run the code.

If you want help, post the code you are using and explain what happens when it runs.

Have Seeed said how much current their XIAO module can supply from the 3.3V pin ?

I'm testing with the basic lora example, powering with the xiao sometimes work but the 90% of the time will not work, but if I power the module with a different supply it works without problem.

This is the only information that I found, I'm not sure if lora consume more power on start, or just the board can't power it.

#include <SPI.h>
#include <LoRa.h>

int counter = 0;

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

  Serial.println("LoRa Sender");

  if (!LoRa.begin(433E6)) {
    Serial.println("Starting LoRa failed!");
    while (1);
  }
}

void loop() {
  Serial.print("Sending packet: ");
  Serial.println(counter);

  // send packet
  LoRa.beginPacket();
  LoRa.print("hello ");
  LoRa.print(counter);
  LoRa.endPacket();

  counter++;

  delay(5000);
}

Power everything with a 3.3V supply capable of at least 1 Ampere, and it should work well.

If I do that it works, but the idea is to use the esp32 module because it has a battery charger chip, but if I can't get it to work I would be using an external power supply

As you have already discovered, that idea does not work. Provide a more-than-adequate power supply, and the circuit will work.

Yeah, but it's strange that sometimes it starts without problems, I will try to add a battery to the xiao and see if the output ampere increase.

Not at all. The maximum current draw will take place when you try to transmit some data using the radio, and that is most likely when the power fails.

That's the strange part the problem only occurs when the module starts, if there is no problem on the start, it will transmit data without problems

Hi, @doster100

What ESP32 controller do you have?
Please post link to spec/data.
Some of that type of assembly have a 3V3 output from a separate on PCB SMPS unit.

Thanks.. Tom.. :smiley: :+1: :coffee: :australia:

It's an esp32-c3 I'm not sure if it's the charge chip, but adding a battery to the xiao esp32 connection it solves the problem. I think this is because when it's connected to the usb is in charge mode and doesn't give the max power in the pins, but using a battery now output more power.
Thanks for all the helps, I really appreciate it.

Edit: The problem is solved, but when you are charging the battery the problem returns, and you have to manually restart the esp32, so I'm probably going to add a charging module and leave it as a power supply.

But still you have not said what 'the problem' you see is.

There is an issue with the XIAO EXP32C3 and a LoRa device, not power related, but once solved I have had TX and RX working without an issue.

Hi,
Can you please post some images of your controller board?

Thanks.. Tom.. :smiley: :+1: :coffee: :australia:

This is the board, inside the shell has a esp32-c3 and a charge battery controller.


This is the connection in the back.

Hi @doster100
I believe this is not a power supply issue but an issue with connecting ESP32-C3 with SX1278.
It seems that SX1278 pulls down the MISO pin on startup. The MISO / D9 pin is used to put the ESP32C3 into BOOT mode, which is why the ESP32C3 gets stuck!
I solved this issue by adding a pullup resistor on NSS (NSS = high deactivates the SX1278 module).

Hi @vchahun, I am not sure if it is a power supply problem or if it is the pin but I think it is not the MISO pin because when I added the battery to the esp32 the problem was solved, I have also tried the same configuration with an RFM95W which has the same connection pins as the sx1278 and no problems. Another thing I did was to add a delay to the configuration to wait for the lora module to start.

There is an issue with the XIAO ESP32 C3, you do need a pullup on the LoRa devices NSS pin or the board will not start.

I was testing a board I had designed, primarily for the SAND21 XIAO, with the ESP32 C3, in the notes I made at the time I added;

## LoRa setup

Install a LoRa device with these pin connections;

DIO0 D1
NRESET D2
NSS D3
SCK D8
MISO D9
MOSI D10

12/11/22 Wont boot with LoRa device connected
Pullup on SCK, still wont start
Pullup on NSS, board starts

I'll keep that in mind for the next time I use lora with the xiao esp32, but for now I've given up, as I can't get a decent range.

The microcontroller has no effect on the 'range' you get from LoRa.

LoRa has a range of settings, and distance wise if you change the configurations from the defaults, that most people use, the range\distance increases by about a factor of 10.

If LoRa does not go far enough for you, there is nothing out there, thats legal, that gets anywhere close to the range the LoRa provides.

Hi, @doster100

What are you using as an antenna?

Can you please post am image of how you have mounted your project to test its range?

Thanks.. Tom... :smiley: :+1: :coffee: :australia: