Connecting the EByte E70 to Arduino SAMD (Nano 33, MKR...) devices and a simple sketch example (original) (raw)

Arduino SAMD (Nano 33, MKR...) and EByte RF E70 CC1310

Arduino SAMD (Nano 33, MKR…) and EByte RF E70 CC1310

Welcome back to our series on connecting the EByte E70 to various devices! In this article, we’ll walk you through a simple sketch example that will help you establish a connection between the EByte E70 and your Arduino SAMD devices. So, let’s dive right in!

Understanding the EByte E70

The EByte E70 is a high-performance long-range transceiver module, renowned for its extensive communication range and low power consumption. Designed for wireless communication over large distances, it operates in the sub-GHz frequency bands, making it ideal for IoT applications that require reliable and efficient communication across wide areas.

Prerequisites

Before we begin, make sure you have the following:

Here the Arduino variants Amazon Arduino MKR WiFi 1010

Here the E70 variants E70 433/915 T S/S2 - E70 433/915 MT S

Setting up the Hardware

Pinout E70 xxxT14S2

I will use an E70 S2 version for my test because It’s a comfortable form factor with an onboard SMA antenna.

EByte E70 400/433/868/900/915 T14S2 pinout

EByte E70 400/433/868/900/915 T14S2 pinout

3D printed socket for breadboard

I created a simple socket with my 3D printer to quickly prototype (and manage) the E70 S2; here is the 3D model and the result on a breadboard.

EByte E70 xxxT14S2 socket 3d printed for breadboard

EByte E70 xxxT14S2 socket 3d printed for breadboard

It’s very simple and uses the same technique as other sockets I already created.

After printing, you must add writing inside the hole.

E70 socket

Insert it into the innermost holes and push it out about 3mm

esp12 socket breadboard adapter step 1

esp12 socket breadboard adapter step 1

Bend the wire to the external of the adapter.

esp12 socket breadboard adapter step 2

esp12 socket breadboard adapter step 2

Cut the external part of the wire, and extract,

esp12 socket breadboard adapter step 3

esp12 socket breadboard adapter step 3

then reinsert in the internal and external holes.

esp12 socket breadboard adapter step 4

esp12 socket breadboard adapter step 4

Now check if you need to cut more of the wire of the internal hole and bend It.

esp12 socket breadboard adapter step 5

esp12 socket breadboard adapter step 5

Repeat for all pins. The result It’s very satisfying.

Arduino Nano 33 IoT and EByte E70 433T14S2 breadboard with socket adapter

Arduino Nano 33 IoT and EByte E70 433T14S2 breadboard with socket adapter

Wiring

Arduino Nano 33 IoT

The Arduino Nano 33 It’s a very versatile microcontroller with interesting capabilities.

Arduino NANO 33 IoT pinouts low resolution

Arduino NANO 33 IoT pinouts low resolution

Wiring.

Arduino Nano 33 IoT EByte RF E70 433T14S2 wiring

Arduino Nano 33 IoT EByte RF E70 433T14S2 wiring

E70 Arduino Nano 33 IoT
M0 4
M1 5
M2 6
TX RX1
RX TX1
AUX 2
VCC 3.3v
GND GND

Constructor

RF_E70 e70ttl(&Serial1, 2, 4, 5, 6);

Arduino MKR WiFi

The Arduino MKR WiFi It’s the big brother of Nano 33.

Arduino MKR WiFi 1010 pinouts low resolution

Arduino MKR WiFi 1010 pinouts low resolution

Wiring.

Arduino MKR WiFi 1010 and EByte RF E70 wiring

Arduino MKR WiFi 1010 and EByte RF E70 wiring

E70 Arduino Nano 33 IoT
M0 2
M1 3
M2 4
TX RX1
RX TX1
AUX 0
VCC 3.3v
GND GND

Constructor

RF_E70 e70ttl(&Serial1, 0, 2, 3, 4)

Configuring the Arduino IDE

I have written some articles about that, and you can find them here.

  1. Arduino SAMD NINA: pinout, specs and Arduino IDE configuration
  2. Arduino SAMD NINA: WiFiNINA, firmware update, and RGB led
  3. Arduino SAMD (NANO 33 and MKR): SPI flash memory FAT FS
  4. i2c Arduino SAMD MKR: additional interface SERCOM, network and address scanner
  5. Arduino MKR SAMD: FAT filesystem on external SPI flash memory
  6. Connecting the EByte E70 to Arduino SAMD (Nano 33, MKR…) devices and a simple sketch example

With the Arduino IDE configured, we can now proceed to the sketch example.

Library installation

You can find the library on GitHub.

But for simplicity, I added it to the Arduino Library manager.

Arduino IDE installation of EByte LoRa E70 from the library manager.

Arduino IDE installation of EByte E70 from the library manager.

Writing the Sketch

The library offers a lot of examples, and you must only uncomment the correct constructor.

/*

#include "Arduino.h" #include "RF_E70.h"

// ---------- esp8266 pins -------------- //RF_E70 e70ttl(RX, TX, AUX, M0, M1, M2); // Arduino RX <-- e70 TX, Arduino TX --> e70 RX //RF_E70 e70ttl(D3, D4, D5, D7, D6, D7); // Arduino RX <-- e70 TX, Arduino TX --> e70 RX AUX M0 M1 //RF_E70 e70ttl(D2, D3); // Config without connect AUX and M0 M1

//#include <SoftwareSerial.h> //SoftwareSerial mySerial(D2, D3); // Arduino RX <-- e70 TX, Arduino TX --> e70 RX //RF_E70 e70ttl(&mySerial, D5, D6, D7, D8); // AUX M0 M1 // -------------------------------------

// ---------- Arduino pins -------------- //RF_E70 e70ttl(4, 5, 3, 8, 7, 6); // Arduino RX <-- e70 TX, Arduino TX --> e70 RX AUX M0 M1 //RFF_E70 e70ttl(4, 5); // Config without connect AUX and M0 M1

//#include <SoftwareSerial.h> //SoftwareSerial mySerial(4, 5); // Arduino RX <-- e70 TX, Arduino TX --> e70 RX //RF_E70 e70ttl(&mySerial, 3, 8, 7, 6); // AUX M0 M1 // -------------------------------------

// ------------- Arduino Nano 33 IoT ------------- RF_E70 e70ttl(&Serial1, 2, 4, 5, 6); // RX AUX M0 M1 // -------------------------------------------------

// ------------- Arduino MKR WiFi 1010 ------------- // RF_E70 e70ttl(&Serial1, 0, 2, 3, 4); // RX AUX M0 M1 // -------------------------------------------------

// ---------- esp32c3 pins -------------- // RF_E70 e70ttl(&Serial1, 1, 2, 3, 4,); // RX AUX M0 M1

//RF_E70 e70ttl(4, 5, &Serial1, 6, 1, 2, 3, UART_BPS_RATE_9600); // esp32 RX <-- e70 TX, esp32 TX --> e70 RX AUX M0 M1 // -------------------------------------

// ---------- esp32 pins -------------- // RF_E70 e70ttl(&Serial2, 15, 19, 21, 22); // RX AUX M0 M1

//RF_E70 e70ttl(&Serial2, 22, 4, 18, 21, 19, UART_BPS_RATE_9600); // esp32 RX <-- e70 TX, esp32 TX --> e70 RX AUX M0 M1 // -------------------------------------

// ---------- Raspberry PI Pico pins -------------- // RF_E70 e70ttl(&Serial2, 2, 10, 11, 12); // RX AUX M0 M1 // -------------------------------------

// ---------------- STM32 -------------------- // HardwareSerial Serial2(USART2); // PA3 (RX) PA2 (TX) // RF_E70 e70ttl(&Serial2, PA0, PB0, PB1, PB10); // RX AUX M0 M1 // -------------------------------------------------

void setup() { Serial.begin(9600); #if defined(ARDUINO_ARCH_STM32) || defined(STM32F1) || defined(STM32F4) Serial.dtr(false); #endif

delay(500);

// Startup all pins and UART e70ttl.begin();

// e70ttl.setMode(MODE_CONTINUOUS_1);

// If you have ever change configuration you must restore It

Serial.println("Hi, I'm going to send message!"); // Send message ResponseStatus rs = e70ttl.sendMessage("Hello, world?"); // Check If there is some problem of succesfully send Serial.println(rs.getResponseDescription()); }

void loop() { // If something available if (e70ttl.available()>1) { // read the String message ResponseContainer rc = e70ttl.receiveMessage(); // Is something goes wrong print error if (rc.status.code!=1){ Serial.println(rc.status.getResponseDescription()); }else{ // Print the data received Serial.println(rc.status.getResponseDescription()); Serial.println(rc.data); } } if (Serial.available()) { String input = Serial.readString(); e70ttl.sendMessage(input); } }

Uploading the Sketch

Before uploading the sketch to your device, make sure you have selected the correct board and port in the Arduino IDE. Then, click on the “Upload” button to compile and upload the sketch.

Once the upload is complete, open the Serial Monitor by going to “Tools” > “Serial Monitor” or by pressing “Ctrl+Shift+M”. Set the baud rate to 9600, and you should see the received data from the EByte E70 module being displayed in the Serial Monitor.

Thanks

Congratulations! You have successfully connected the EByte E70 to your Arduino device with a simple sketch example.