Skip to content

Hardware Setup

A WeSense node is an ESP32-based environmental sensor that reports readings every 5 minutes over WiFi or LoRaWAN. No cloud account needed — your data goes directly to the WeSense network. This page covers choosing your board, sensors, and wiring everything together.

What You Need

1. An ESP32 Board

Any of these supported boards will work. The firmware auto-detects your board type at startup.

BoardLoRaBest ForWhere to BuyApprox Cost
ESP32 DevKit / WROOM-32NoSimplest build, WiFi onlyAliExpress, Amazon~$5-10
ESP32-C3 GenericNoCompact, budget-friendlyAliExpress, Amazon~$4-8
ESP32-C6 Beetle / GenericNoWiFi 6, compactAliExpress, Amazon~$6-10
ESP32-S3 GenericNoMore processing powerAliExpress, Amazon~$8-15
T-Beam v1.x (Lilygo)Yes (SX1276)LoRaWAN + GPS + built-in 18650 battery holder + solarLilygo~$40-65
T-Beam T3 S3 v1.2 (Lilygo)Yes (SX1262)LoRaWAN + GPS + LiPo battery socket + solarLilygo~$35-55

About the T-Beam LoRa boards

Both T-Beam models include solar charge controllers and GPS, and can run fully off-grid with a small solar panel.

The T-Beam v1.x has a built-in 18650 battery holder — convenient but makes the board larger and limits you to one battery form factor. It tends to be more expensive.

The T-Beam T3 S3 has a LiPo battery socket instead — more compact, and you can connect any LiPo battery you like. It uses the newer SX1262 LoRa radio which, despite the lower model number, has better range and lower power consumption than the SX1276 in the v1.x. If buying new, the T3 S3 is the better choice.

2. Sensors

Choose from the Recommended Sensors list. At minimum, you need a temperature/humidity sensor. Here are some example builds:

Basic (temp/humidity only) — ~$15 total:

  • ESP32-C3 + SHT41

Standard (temp/humidity + CO2 + pressure) — ~$50 total:

  • ESP32 DevKit + SHT45 + SCD40 + MS5611

Full environmental — ~$120 total:

  • ESP32 DevKit + SHT45 + SCD30 + SPS30 + MS5611 + TSL2591

LoRaWAN outdoor — ~$100 total:

  • T-Beam T3 S3 + SHT45 + SPS30 (solar/battery powered, no WiFi needed)

3. A USB Cable and Computer

For flashing the firmware. Most ESP32 boards use USB-C or Micro-USB.

Wiring

I2C Sensors (most sensors)

Most sensors use I2C — four wires, same for every sensor. Where possible, choose I2C versions of sensors as they're simpler to wire and you can connect many on the same bus.

ESP32 Board    →    Sensor
───────────         ───────
SDA            →    SDA
SCL            →    SCL
3.3V           →    VCC
GND            →    GND

Multiple I2C sensors share the same bus — daisy chain them all to the same SDA/SCL pins. The firmware detects which sensors are present automatically.

I2C pin assignments by board:

BoardSDASCL
ESP32 DevKit / WROOM-32GPIO 21GPIO 22
T-Beam v1.xGPIO 21GPIO 22
T-Beam T3 S3 v1.2GPIO 17GPIO 18
ESP32-S3 GenericGPIO 8GPIO 9
ESP32-C3 GenericGPIO 4GPIO 5
ESP32-C6 Beetle / GenericGPIO 19GPIO 20

For detailed per-board wiring diagrams, pin layouts, and board-specific quirks, see Board Configurations.

UART Sensors (PMS5003, C8 CO2)

UART sensors connect to the board's UART port. The number of UART sensors you can connect is limited by the number of available UART ports on your board — typically one port for sensors (the other is used for USB/debug). The firmware auto-detects which sensor is present.

ESP32 Board    →    UART Sensor
───────────         ───────────
RX             →    TX
TX             →    RX
5V/VIN         →    VCC (requires 5V, not 3.3V)
GND            →    GND

UART pin assignments by board:

BoardRXTXNotes
ESP32 DevKit / WROOM-32GPIO 16GPIO 17UART2
T-Beam v1.xGPIO 16GPIO 17UART2
T-Beam T3 S3 v1.2GPIO 16GPIO 15UART2
ESP32-S3 GenericGPIO 44GPIO 43UART2
ESP32-C3 GenericGPIO 20GPIO 21UART1
ESP32-C6 Beetle / GenericGPIO 17GPIO 16UART1

UART sensors need 5V

PMS5003 and C8 CO2 sensors require 5V power. Connect VCC to the board's VIN or 5V pin, not 3.3V. Note that not all board designs break out a 5V pin — check your specific board's pinout before buying. Whether a board has a 5V output depends on the board manufacturer's design, not the ESP32 chip variant.

Flash the Firmware

See Firmware Setup for the complete guide — Arduino IDE installation, board selection, partition scheme, USB CDC, library installation, and flashing.

The short version:

  1. Install Arduino IDE with ESP32 board support
  2. Select your board, set Partition Scheme → Minimal SPIFFS, enable USB CDC On Boot (C3/C6/S3 boards)
  3. Install the required libraries (see Firmware Setup for the full list)
  4. Edit your configuration (see below)
  5. Click Upload

A web-based flasher with pre-built binaries (no Arduino IDE required) is on the roadmap — the challenge is handling device-specific configuration without a compile step.

Configure

At minimum, you need to set two things:

In credentials.h — your WiFi credentials:

cpp
#define WIFI_SSID "YourWiFiNetwork"
#define WIFI_PASSWORD "YourWiFiPassword"

In wesense-sensor-firmware.ino — your location:

cpp
const bool INCLUDE_LOCATION_IN_MQTT = true;
const float FIXED_LATITUDE = -36.8485;
const float FIXED_LONGITUDE = 174.7633;

Location is required — without it, the network can't determine which region your data belongs to and the data won't be ingested. You don't need to provide your exact address; neighbourhood-level accuracy is sufficient. You can enter coordinates slightly offset from your actual position if you prefer.

T-Beam boards with GPS determine location automatically.

Everything else has sensible defaults — the firmware connects to mqtt.wesense.earth with TLS encryption automatically.

See Firmware Configuration for a complete walkthrough of every setting in both files.

Verify It's Working

  1. Open the Serial Monitor in Arduino IDE (115200 baud)
  2. You should see:
    • WiFi connection confirmation
    • MQTT connection to mqtt.wesense.earth
    • Sensor detection messages (listing which sensors were found)
    • Sensor readings being published every 5 minutes
  3. Check the live map — your sensor should appear within a few minutes

Troubleshooting

Sensor Not Detected

  • Check wiring — SDA/SCL for I2C, TX/RX for UART
  • Verify power supply voltage — 3.3V for I2C sensors, 5V for UART sensors
  • The firmware logs which sensors it finds at startup — check the serial monitor

WiFi Won't Connect

  • Verify SSID and password are correct (case-sensitive)
  • Ensure your network is 2.4GHz — ESP32 doesn't support 5GHz WiFi

MQTT Connection Failed

  • If using default settings, check your internet connection
  • If using your own broker, verify the IP/hostname, port, and credentials

"Sketch Too Big" Error

  • Change partition scheme: Tools → Partition Scheme → Minimal SPIFFS (1.9MB APP with OTA/190KB SPIFFS)

Readings Seem Wrong

  • Allow warmup time — CO2 sensors need up to 7 days for full ASC calibration, other sensors are immediate
  • Check calibration status in the serial monitor output

What's Next?

All WeSense data is free and open, forever.