433 MHz LilyGO T-Beam

TTN version: TTNv3 / TTSS
Board: LilyGO T-Beam v1.2
Activation: OTAA
Device Class: Class A
Last updated: April 29, 2026

This page was created as part of a bachelor’s thesis by Armin Gembal at VSB – Technical University of Ostrava, with the topic Design and Assembling of the Communication Node of the LoraWAN technology Operating at 433 MHz Band.

This project describes the assembly of a battery-powered alarm device operating on a LoRaWAN network in the 433 MHz frequency band. The key feature of the node is its Deep Sleep operation mode. The device wakes up only when one of the three connected sensors detects an event. After waking up, the ESP32 sends a single-byte packet to TTN (The Things Network). TTSS (The Things Stack Sandbox) then forwards the message via Webhook to GAS (Google Apps Script). The script decodes the payload and immediately sends a text notification to a Telegram chat.

Prepare

  • LilyGO T-Beam v1.2 (with SX1268 chip for 433 MHz)
  • Motion sensor PIR HC-SR505
  • Vibration sensor SW1801P
  • Sound sensor KY-037
  • Li-Ion battery in 18650 format (recommended 3500 mAh)
  • 9x Wires
  • Breadboard
  • Box (3D model)
  • Lid (3D model)
  • PC + Micro-USB cable

When using the 3500 mAh battery, the device lasts 12 days on a single charge.

LilyGO T-Beam v1.2

The LilyGO T-Beam v1.2 module is a comprehensive development platform that combines a ESP32 microcontroller, a LoRa SX1268 433 MHz radio module, a u-blox NEO-6M GPS module, and an AXP2101 power management circuit on a single board. Serial communication with a computer is handled by a CH9102F USB-to-UART converter. Unlike simple peripheral LoRa modules, it does not require an external microcontroller. All computing power, radio communication, power management, and GPS are integrated directly on the board.

The board features an ESP32 chip running at 240 MHz with 4 MB Flash and 8 MB PSRAM, integrated Wi-Fi and Bluetooth 4.2. The radio section is handled by a Semtech SX1268 chip with a maximum transmit power of 10 mW (+10 dBm). Power management is provided by the AXP2101 chip, which allows software-controlled disconnection of voltage rails and powers the board from an 18650 Li-Ion battery or via micro-USB.

Detection sensors

Motion sensor PIR HC-SR505 (GPIO 14) – a passive infrared sensor that detects motion based on changes in infrared radiation in the surrounding environment.

Vibration sensor SW1801P (GPIO 25) – a mechanical sensor sensitive to shocks and vibrations. When a vibration is detected, the digital output switches to logical HIGH. Suitable for detecting impact or movement of an object it is attached to.

Sound sensor KY-037 (GPIO 13) – a microphone with a comparator. The digital output switches to HIGH when the configured volume threshold is exceeded. Sensitivity can be adjusted using the trimmer directly on the module.

Assembly

Connect everything according to the schematics below:

The 18650 Li-Ion battery is connected to the integrated holder on the back of the LilyGO T-Beam board.

The HC-SR505 PIR motion sensor is connected using three wires. The VCC power pin is connected to the 3V3 pin on the LilyGO T-Beam board. The GND pin is connected to the GND pin on the LilyGO T-Beam board. The data pin OUT is connected to pin 14 on the LilyGO T-Beam board.

The SW1801P vibration sensor is connected using three wires. The VCC power pin is connected to the 3V3 pin on the LilyGO T-Beam board. The GND pin is connected to the GND pin on the LilyGO T-Beam board. The data pin DO is connected to pin 25 on the LilyGO T-Beam board.

The KY-037 sound sensor is connected using three wires. The VCC power pin is connected to the 3V3 pin on the LilyGO T-Beam board. The GND pin is connected to the GND pin on the LilyGO T-Beam board. The data pin DO is connected to pin 13 on the LilyGO T-Beam board.

Put everything in a small box.

Arduino IDE setup

  1. Run Arduino IDE.
  2. In the Arduino IDE Tools → Board → Boards Manager search esp32 by Espressif Systems and install it.
  3. In the Arduino IDE Tools → Manage Libraries search MCCI LoRaWAN LMIC Library by Matthijs Kooijman and Thomas Telkamp and install it.
  4. In the Arduino IDE Tools → Manage Libraries search XPowersLib by Lewis He and install it.

Modifying LMIC library configuration

The default LMIC library configuration assumes use of the 915 MHz band. To operate in Europe on the 433 MHz band, the following modifications are required:

  1. In the installed library, go to the folder MCCI_LoRaWAN_LMIC_library → src → lmic and place the modified lorabase_eu868.h file there, replacing the existing file with the same name. This file has been specially modified for broadcasting in the 433 MHz frequency band.
  2. Open the configuration file MCCI_LoRaWAN_LMIC_library → project_config → lmic_project_config.h. Comment out the line #define CFG_us915 1 and uncomment #define CFG_eu868 1. This will make the library work with the modified file for the 433 MHz frequency band when used.

Registration LilyGO T-Beam into TTSS

  1. Log in on The Things Network. If you don’t have account, create one.
  2. Click on your username and choose Console.
  3. Select a network cluster Europe 1.

Add application

  1. Go to applications.
  2. Click on button + Add application.
  3. Write something into Application ID.
  4. Click on button Create application.

Add end device

  1. In your application click on button + Register end device.
  2. Input Method – Choose Enter end device specifics manually.
  3. Frequency plan – Europe 433 MHz (ITU region 1)
  4. LoRaWAN version – LoRaWAN Specification 1.0.3
  5. Click on Show advanced activation, LoRaWAN class and cluster settings
  6. Activation mode – Over the air activation (OTAA)
  7. Additional LoRaWAN class capabilities – None (class A only)
  8. Select – Use network’s default MAC settings
  9. JoinEUI – 0000000000000000
  10. Click on Confirm.
  11. DevEUI – Generate
  12. AppSKey – Generate
  13. End device ID – here you can name your device
  14. After registration – View registered end device
  15. Click on button Register end device

Uploading firmware to the board

  1. Copy and paste this program to your Arduino IDE.
  2. In program find // 2. LORAWAN KEYS FOR OTAA CONNECTION and replace DEVEUI and APPKEY with your keys in TTSS
  3. Connect the LilyGO T-Beam using micro USB cable to your computer.
  4. In Arduino IDE Tools → Board → esp32 → ESP32 Dev Module and select the correct COM port.
  5. In Arduino IDE click on Upload button to upload program to your LilyGO T-Beam.
  6. In Arduino IDE click on Serial Monitor with speed 115200 baud.
  7. Now in Serial Monitor you can see information from the board. (The board should print information about the wake-up reason, the network join process, and the sleep process.)

In your TTSS console in Live data you should see incoming messages in real time:

Telegram integration via Google Apps Script

For the device to be truly useful as an alarm, it needs to send notifications to the user. To achieve this, we use a combination of the Telegram Bot APIGAS (Google Apps Script), and the Webhook feature in TTSS.

Create Telegram bot

  1. Download the Telegram app on your mobile device.
  2. After logging in, search for the user @BotFather and open a chat with them.
  3. Send the command /start to begin communication with BotFather.
  4. Send the command /newbot.
  5. Enter a display name for your bot (any text).
  6. Enter a username for your bot (must be unique and end with the word “bot”).
  7. After successful creation, BotFather will send you the generated TELEGRAM_TOKEN. Save this token — it serves as the password for accessing your bot’s API.
  8. Open a chat with the newly created bot and send the message /start to activate the chat.
  9. In a web browser, open the URL https://api.telegram.org/bot00000000000/getUpdates (replace the zeros with your TELEGRAM_TOKEN).
  10. In the displayed JSON output, find the “chat” and save the value of “id” (this is your CHAT_ID).

Create GAS

  1. Log in at script.google.com using your Google account.
  2. Click on New project.
  3. Copy and paste this program to your GAS.
  4. In the code, update the TELEGRAM_TOKEN and CHAT_ID variables with your Telegram configuration.
  5. Click Save project to Drive.
  6. Then click Deploy → New deployment → select type Web app → set Who has access to Anyone → click Deploy.
  7. After deployment save displayed Web app URL.

Webhook configuration in TTSS

    1. In your TTSS console, go to the Webhooks tab.
    2. Click Add webhook and select the type Custom webhook.
    3. Enter any name in the Webhook ID field.
    4. Select JSON as the Webhook format.
    5. Paste the URL of your GAS web app into the Base URL field.
    6. Enable Uplink message.
    7. Click Add webhook to save.

Telegram output

After successfully setting up the entire pipeline, triggering any sensor should cause a notification to appear in your Telegram chat with your bot.