Need help with LoRa Sx1278 Project

Hi! I have a project in which an Arduino Nano board works as an electronic clock to say so, and after a set time it moves a servo to a desired angle. Sometimes I want to move the servo before the time has passed, this will need to be done from a distance like ~3km in air. The only thing that needs to be changed is something like "mode = 1;". I decided to buy 2 Lora Sx1278 modules from Aliexpress.Now the questions are: 1-Do I need 2 Arduino Nano boards? One will be the transmitter, and the other one the receiver (with the clock thing). 2-What is the wiring that needs to be done between the Nanos and the Sx1278s? I found multiple variants and I don't know which to follow. 3-Do I need logic level shifters from 5v to 3.3v? 4-Is the standard antenna that comes with the modules enough for 3km? 5-Can I power the Sx1278s from Nano's 3.3v? Or do I need a dedicated voltage regulator? What is the required power(mA)? 6-Which library to use?

Words often brings confusion. Please draw a logic block diagram showing what You're thinking about.

Show what You found.

Yes for 5 volt signals directed at 3.3 volt logic. The opposite way, no.

The immediate answer is No. Transmitters need more current.

The datasheets tells that.

Search for an Arduino Sx1278s library.

1 Like

Basically one Arduino is the receiver and the other the transmitter.

there are post which discuss the problems of connecting a SX1278 to a UNO or Nano , e.g. see sx1278-on-nano-tx-and-nano-rx
the classic Nano uses 5V logic the SX1278 3.3V it is not a good idea to directly connect the devices - use a level shifter

you could save yourself trouble by moving to a board which incorporates a microcontroller and a LoRa module, e.g. ttgo-lora32 , Adafruit Feather 32u4 LoRa, TTGO-Beam, Hiltec LoRa 32, The Things UNO, Adafruit RP2040 with RFM95, etc
this saves the problems of level shifters, jumper wires which give poor connections and intermittent faults, etc, e.g. see river level monitoring

make sure your LoRa module uses the correct frequency - see LoRa frequencies-by-country

Those alternatives you proposed are too expensive for the first stage of my project

Well, the wires will be soldered, because in flight jumper wires will not stay in their place.

Would this module have logic shifters incorporated?
https://a.aliexpress.com/_EyufwD7

No.

From a fair bit of experience with LoRa I would avoid using 5V logic level Arduinos.

A 3.3V Logic Pro Mini is fairly low cost.

Whether the SX1278 would work at 3km 'in air' rather depends on the location and environment of the 'in air', you might know, but the forum does not.

Hills and fields like 3-4km away from urban enviroments.

Yes, but for the "receiver" board I will not have enough pins on the Pro board, I need like 5 analog pins, 2 digital pins with pwm for servos, and like digital pins, will it be enough? The programming is also hard without an usb port.
Aren't there any Sx1278 modules with built in Logic level shifters?

looking on EBAY the cost of a ESP32 is not much more than a classic Nano and would have the advantage of using 3.3V logic and sufficient IO and ADCs for your application

Adafruit do one, about $20.

A Nano has 2 more analogue pins than a Pro Mini.

A Pro Mini is easy to program with a low cost USB to serial adapter.

Perhaps list all your requirements ?

If there hills in the way, then no chance.

There will be a series of hills but I will also be on one, so I will maintain VLOS

following on from suggestion by @srnet when I tested a RA-02 with a 3.3V Pro Mini I used the connections

// RA-02 SS   to Pro Mini  D10
// RA-02 RST  to Pro Mini  D9
// RA-02 DIO0 to Pro Mini  D3  requires interrupt pin!!!!
// RA-02 MOSI to Pro Mini  D11
// RA-02 MIS0 to Pro Mini  D12
// RA-02 SCK  to Pro Mini  D13
// setpins() is therefore
// ***** note DIO0 requires a pin which enables interrupts, e.g. pro mini D3  *********
// setPins(int ss = LORA_DEFAULT_SS_PIN, int reset = LORA_DEFAULT_RESET_PIN, int dio0 = LORA_DEFAULT_DIO0_PIN);
//   LoRa.setPins(10, 9, 3);   // 10 for UNO and Pro Mini, 53 for Mega

used the arduino-LoRa library for peer to peer communications between a number of LoRa devices

Note that by default you dont need DIO0. It is needed if you are using LoRa.onReceive(onReceive);.

If your using a fast Arduino, such as ESP32 the continuous fast activity on the SPI bus can loose you a few dB in sensitivity whereas reading the DIO0 pin does not.

And its rare that you need NRESET.

What do you mean by interrupting pin? Is it enough just to connect the DIO0 to the D3?

So for a Pro Mini let's say, I would need only:

RA-02 SS to Pro Mini D10
RA-02 MOSI to Pro Mini D11
RA-02 MIS0 to Pro Mini D12
RA-02 SCK to Pro Mini D13

Right? And another question, I saw 3.3v and 5v Pro Mini I should buy the 3.3v one right? Is this a good one? https://www.aliexpress.com/item/1005006208910800.html?spm=a2g0o.cart.0.0.7f9638dalfMHRK&mp=1

the SX1278 uses DIO0 to indicate packet received - the process the packet your program can either

  1. use interrupts to to invoke a callback routine to process the data - in this case DIO0 must be connected to a pin which can use interrupts, e.g. pin D3 on a pro mini
  2. poll the pin which DIO0 is connected too or call available() which indicates data received

yes, call available() to check for data received

to match the SX1278 3.3V logic get a pro mini 3.3V