TTGO LoRa32 Paxcounter for The Things Network - image 1
Build Guideintermediate

TTGO LoRa32 Paxcounter for The Things Network

A people-counting node on the TTGO LoRa32 V2.1 that scans for nearby WiFi and Bluetooth devices, uploads counts via LoRaWAN to TTN, and supports relay control via TTN downlinks.

Boards:ESP32
Firmware:PaxcounterLoRaWAN stackArduino
Use Cases:LoRa & WANIoT PrototypingData Logging

Overview

This project adapts the popular Paxcounter concept for the TTGO LoRa32 V2.1 (T3 LoRa32 V1.6.1), connecting it to The Things Network via LoRaWAN. It counts unique WiFi probe requests and Bluetooth advertisements to estimate foot traffic — useful for occupancy sensing in retail, public spaces, or events — and transmits the counts over LoRa to TTN every configurable interval.

Extras

The sketch adds support for a BME280 temperature, humidity, and pressure sensor connected over I2C, making it a combined environmental and people-counting node. A relay output on GPIO 14 can be toggled remotely by sending TTN downlink messages, which can be orchestrated via Node-RED for automation workflows. Payload formatters (decoder, converter, validator, encoder) are included for the TTN Console.

Setup

Target the 'TTGO LoRa32-OLED V1' board in Arduino IDE. Configure your TTN OTAA or ABP credentials in credentials.h, set your LoRaWAN region in the arduino-lmic library config, then upload. The OLED display shows current counts and connection status in real-time.

Resources