Cirkit Designer LogoCirkit DesignerYour all-in-one circuit design IDE Launch Cirkit Designer App

ESP32 and RFM95 LoRa Transmitter with Inductor-Based Antenna

View and Edit Project In Cirkit DesignerImage of ESP32 and RFM95 LoRa Transmitter with Inductor-Based Antenna

Circuit Documentation

Summary

This document provides a detailed overview of a circuit that integrates an ESP32 microcontroller with an RFM95 LoRa module and an inductor. The ESP32 is programmed to initialize the LoRa module and send a simple message periodically.

Component List

ESP32

RFM95

Inductor

Wiring Details

ESP32

RFM95

Inductor

Code Documentation

/*
 * LoRa Transmitter
 * This Arduino sketch configures an ESP32 to communicate with an RFM95 LoRa
 * module. The ESP32 will initialize the LoRa module and send a simple message.
 */

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

// Pin definitions
#define LORA_SS 14
#define LORA_RST 27
#define LORA_DIO0 13

void setup() {
  // Initialize serial communication
  Serial.begin(9600);
  while (!Serial);
  Serial.println("LoRa Transmitter");

  // Setup LoRa transceiver module
  LoRa.setPins(LORA_SS, LORA_RST, LORA_DIO0);

  if (!LoRa.begin(915E6)) { // Initialize LoRa at 915 MHz
    Serial.println("Starting LoRa failed!");
    while (1);
  }
  Serial.println("LoRa Initializing OK!");
}

void loop() {
  Serial.println("Sending packet...");
  // Send packet
  LoRa.beginPacket();
  LoRa.print("Hello, world!");
  LoRa.endPacket();

  delay(5000); // Wait for 5 seconds before sending next packet
}

This code initializes the LoRa module connected to the ESP32 and sends a "Hello, world!" message every 5 seconds. The pin definitions in the code match the wiring details provided above.