Microcontroller, Wireless modules

Tutorial of ESP32 LoRa SX1278 0.96 Inch Blue OLED Display BT Wi-Fi Module for Arduino

The tutorial for the ESP32 LoRa SX1278 0.96 Inch Blue OLED Display BT Wi-Fi Module for Arduino provides a step-by-step guide on setting up and using this module for wireless communication projects. It covers the basics of connecting the module to an Arduino board, configuring the LoRa settings, and displaying data on the built-in OLED screen. Additionally, the tutorial includes code examples for sending and receiving data via LoRa, making it ideal for IoT projects that require long-range communication.

S.N.Components NameQuantityPurchase Link
1Heltec Wi-Fi LoRa 321RoboticsDnA.in
2
12x12x7.3mm Tact Switch – (Pack of 10)
1
RoboticsDnA.in
310k ohm resistor1
RoboticsDnA.in
4Relay module1RoboticsDnA.in
5Breadboard1
RoboticsDnA.in

It is a development board that integrates a SoC ESP32-D0WDQ6.

It has a W25Q32FV Serial Flash Memory (SPI / QPI) chip with approximately 32 megabits (4 megabytes) of storage.

A SX1278 LoRa chip is controlled by ESP32.

The USB-Serial interface uses a CP2102 from Silicon Labs.

In addition to an MCP73831 / 2, it comes with a Lithium Ion (Li-Ion) or Lithium Polymer (Li-Po) battery charge controller.

And it features a regulator AP2112-3.3 to provide 3.3V and a minimum of 600mA.

The board has two crystals, one from 26MHz to the ESP32, and another from 32MHz to the SX1278.

It has a 0.96″ OLED display, also controlled by the ESP32.

Wiring Diagram of the Heltec WiFi LoRa 32

This same wiring diagram serves both the Heltec chip and the TTGO.

Pinout of Heltec WiFi LoRa 32 Card :

I point out that if you take the traditional ESP32, unlike this image, it will not have the display and the SX1278, which is the Semtech chip.

TTGO X Heltec :

Circuit :

In this circuit, we will detect the push of a button through the GPIO34 (pin 34 of the board), and we will drive the relays of the module through the GPIO22 and 23 (pins 22 and 23), respectively.

Plate Installation :

To install the board, we can follow the instructions of the Heltec itself in its GIT.

https://github.com/Heltec-Aaron-Lee/WiFi_Kit_series/blob/master/InstallGuide/windows.md

Source Code :

Statements

When you’re referring to the ESP32 pin, what matters is the GPIO. In this step, therefore, we point out that the pin that is connected to the button, as well as the ones that are connected in the relay module. We also have the variable to store the state of the second relay.

Setup ()

The setup () function must be run once before the loop. We set the pins of the buttons as input, relays as output, and we open the serial port, setting the data rate to 9600 bps.

Loop ()

As for the loop () function, it executes after setup and is repeated continuously. Check if the button was pressed and, if so, we will print this status on the screen. We then turn on relay 1, invert the state of variable relay2_Active, and then we change the state of relay 2. We wait for 1 second and turn off relay 1.

Doing the Upload of Code :

With the IDE open, open the file with the source code by double-clicking the .ino file or through the File menu.

With Heltec connected to USB, select the menu Tools => Card: “Heltec_WIFI_LoRa_32”

Still in the Tools menu, select the COM port on which the Heltec is connected.

Click the UPLOAD button…

… And wait for the conclusion:

Verifying Execution

After recording, we check the execution, click the button to open the Serial Monitor, and then we set the baud rate to 9600.

Press the button, in addition to activating the relays. The following message should appear on the Serial Monitor.

Introduction of LO-RA shild Zip file

Leave a Reply

Your email address will not be published. Required fields are marked *