Site icon Renzo Mischianti

WeMos D1 (esp8266): HardwareSerial shield for Ebyte E32 E22 E220 LoRa devices

Spread the love

EByte LoRa E32 TTL 100 Wemos D1 shield PCB main page.

I created a library for the EByte LoRa device and also a shield. However, when I used it in another project I had the problem of the reduced number of pins since 2 were used by the SoftwareSerial. To solve these problems I switched to HardwareSerial. The amps could be insufficient so I add a voltage regulator to power the EByte e32 in one and in the other shield directly from the 5v.

sx1278 sx1276 wireless lora uart module serial 3000m arduino 433 rf

SoftwareSerial shield

So this shield is quite different from one shown on “LoRa E32 device for Arduino, esp32 or esp8266: WOR (wake on radio) microcontroller and new WeMos D1 mini shield” the previous schema is this

LoRa E32-TTL-100 and Wemos D1 fully connected shield old version

And the result is

WeMos D1 mini shield photo UP with description

WeMos LoRa shield with SoftwareSerial PCBWay

HardwareSerial shield with 3.3v voltage regulator

The new shield is similar to the previous one, but has more functionality, but has the 3.3v limit for powering the LoRa device, thereby limiting its power.

EByte LoRa E32 Wemos D1 shield to hardwareserial

As you can see now, there is a voltage regulator to power the e32 device, and RX, TX is connected to TX and RX of microcontroller, a pin is free to connect Serial to USB to debug on Serial1.

So the PCB schema become so

EByte LoRa E32 Wemos D1 shield PCB to hardware serial

More complex and with more pins and buttons, now AUX, M0, and M1 are selectable, and you have two options for every e32 input.

Here is the milled prototype.

EByte LoRa E32 Wemos D1 shield PCB milled.

And here are all the options

EByte LoRa E32 Wemos D1 shield PCB up description

Here the BOM

ObjectDesc
2Electrolytic Capacitorcapacitance 10µF
2Generic female header – 8 pins2.54mm ♀
1Generic female header – 7 pins2.54mm ♀
7Generic male header – 2 pins2.54mm ♂
3Generic male header – 3 pins2.54mm ♂
1DIP SWITCHpackage dipswitch-03; channels 1
1Lora E32voltage 3-5V; type Basic
34.7kΩ Resistor
210kΩ Resistor
1LD1117V33package 78xxl; voltage regulator 3.3V; chip LD1117VXX
1WeMos D1 MiniCPU ESP-8266EX

You can find WeMos D1 on WeMos D1 mini - NodeMCU V2 V2.1 V3 - esp01 - esp01 programmer

You can find EBYTE e32 devices on AliExpress (433MHz 5Km) - AliExpress (433MHz 8Km) - AliExpress (433MHz 16Km) - AliExpress (868MHz 915MHz 5.5Km) - AliExpress (868MHz 915MHz 8Km)

You can find 3.3v voltage regulator on AliExpress SMD (AMS1117) - AliExpress 3.3v (LM1117) - AliExpress 5v (7805) - AliExpress 9v (7809)AliExpress 12v (7812) - AliExpress 3.3v TO-92 (78L33)

You can find dip switch on AliExpress

Soldering video

Get the PCB.


WeMos LoRa shield with 3.3v voltage regulator PCBWay

HardwareSerial shield 5v version

After a while, I understand that to have a good range, I need to power the LoRa device with 5v, and I redò the shield like the photo.

EByte LoRa Exx Wemos D1 shield PCB up with 5v 3v3 switch

The soldering steps are the same, but I remove the voltage regulator and add a 3.3V switch to the 5V USB power supply.

Ebyte LoRa Exx WemosD1 shield hw 5v PCB

Here is the list of parts.

ObjectDesc
2Generic female header – 8 pins2.54mm ♀
1Generic female header – 7 pins2.54mm ♀
7Generic male header – 2 pins2.54mm ♂
3Generic male header – 3 pins2.54mm ♂
1DIP SWITCHpackage dipswitch-03; channels 1
1Lora E32voltage 3-5V; type Basic
34.7kΩ Resistor
210kΩ Resistor
1WeMos D1 MiniCPU ESP-8266EX

You can find WeMos D1 on WeMos D1 mini - NodeMCU V2 V2.1 V3 - esp01 - esp01 programmer

You can find EBYTE e32 devices on AliExpress (433MHz 5Km) - AliExpress (433MHz 8Km) - AliExpress (433MHz 16Km) - AliExpress (868MHz 915MHz 5.5Km) - AliExpress (868MHz 915MHz 8Km) You can find dip switch on AliExpress

And here is the final result.

EByte LoRa Exx Wemos D1 shield PCB 3v3 5v switch

Get the PCB.


WeMos LoRa shield with 3.3v and 5v switch PCBWay

Example

An example of a configuration of the shield is

LoRa_E32 e32ttl(&Serial, D3, D0, D8);

But remember, AUX with a change jumper can take D3 or D6 pins, M0 can be D0 or D5, M1 can be D8 or D7.

Here is a simple sketch to retrieve the device’s configuration; refer to the full tutorial of the library for more detail on “LoRa e32 devices“.

/*
 * LoRa E32-TTL-100
 * Get configuration.
 * https://mischianti.org
 *
 */
#include "Arduino.h"
#include "LoRa_E32.h"

LoRa_E32 e32ttl(&Serial, D3, D0, D8);

void printParameters(struct Configuration configuration);
void printModuleInformation(struct ModuleInformation moduleInformation);

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

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

	ResponseStructContainer c;
	c = e32ttl100.getConfiguration();
	// It's important get configuration pointer before all other operation
	Configuration configuration = *(Configuration*) c.data;
	Serial.println(c.status.getResponseDescription());
	Serial.println(c.status.code);

	printParameters(configuration);

	ResponseStructContainer cMi;
	cMi = e32ttl100.getModuleInformation();
	// It's important get information pointer before all other operation
	ModuleInformation mi = *(ModuleInformation*)cMi.data;

	Serial.println(cMi.status.getResponseDescription());
	Serial.println(cMi.status.code);

	printModuleInformation(mi);
}

void loop() {

}
void printParameters(struct Configuration configuration) {
	Serial.println("----------------------------------------");

	Serial.print(F("HEAD BIN: "));  Serial.print(configuration.HEAD, BIN);Serial.print(" ");Serial.print(configuration.HEAD, DEC);Serial.print(" ");Serial.println(configuration.HEAD, HEX);
	Serial.println(F(" "));
	Serial.print(F("AddH BIN: "));  Serial.println(configuration.ADDH, BIN);
	Serial.print(F("AddL BIN: "));  Serial.println(configuration.ADDL, BIN);
	Serial.print(F("Chan BIN: "));  Serial.print(configuration.CHAN, DEC); Serial.print(" -> "); Serial.println(configuration.getChannelDescription());
	Serial.println(F(" "));
	Serial.print(F("SpeedParityBit BIN    : "));  Serial.print(configuration.SPED.uartParity, BIN);Serial.print(" -> "); Serial.println(configuration.SPED.getUARTParityDescription());
	Serial.print(F("SpeedUARTDataRate BIN : "));  Serial.print(configuration.SPED.uartBaudRate, BIN);Serial.print(" -> "); Serial.println(configuration.SPED.getUARTBaudRate());
	Serial.print(F("SpeedAirDataRate BIN  : "));  Serial.print(configuration.SPED.airDataRate, BIN);Serial.print(" -> "); Serial.println(configuration.SPED.getAirDataRate());

	Serial.print(F("OptionTrans BIN       : "));  Serial.print(configuration.OPTION.fixedTransmission, BIN);Serial.print(" -> "); Serial.println(configuration.OPTION.getFixedTransmissionDescription());
	Serial.print(F("OptionPullup BIN      : "));  Serial.print(configuration.OPTION.ioDriveMode, BIN);Serial.print(" -> "); Serial.println(configuration.OPTION.getIODroveModeDescription());
	Serial.print(F("OptionWakeup BIN      : "));  Serial.print(configuration.OPTION.wirelessWakeupTime, BIN);Serial.print(" -> "); Serial.println(configuration.OPTION.getWirelessWakeUPTimeDescription());
	Serial.print(F("OptionFEC BIN         : "));  Serial.print(configuration.OPTION.fec, BIN);Serial.print(" -> "); Serial.println(configuration.OPTION.getFECDescription());
	Serial.print(F("OptionPower BIN       : "));  Serial.print(configuration.OPTION.transmissionPower, BIN);Serial.print(" -> "); Serial.println(configuration.OPTION.getTransmissionPowerDescription());

	Serial.println("----------------------------------------");

}
void printModuleInformation(struct ModuleInformation moduleInformation) {
	Serial.println("----------------------------------------");
	Serial.print(F("HEAD BIN: "));  Serial.print(moduleInformation.HEAD, BIN);Serial.print(" ");Serial.print(moduleInformation.HEAD, DEC);Serial.print(" ");Serial.println(moduleInformation.HEAD, HEX);

	Serial.print(F("Model no.: "));  Serial.println(moduleInformation.model, HEX);
	Serial.print(F("Version  : "));  Serial.println(moduleInformation.version, HEX);
	Serial.print(F("Features : "));  Serial.println(moduleInformation.features, HEX);
	Serial.println("----------------------------------------");
}

Thanks

  1. WeMos D1 (esp8266): i2c shield to manage encoder, multiple buttons, and LEDs
  2. WeMos D1 (esp8266): relay shield
  3. WeMos D1 (esp8266): Ebyte LoRa shield (e32, e22 and e220)

Spread the love
Exit mobile version