ESP32 Hardware Connection Guide

Solar Soil IoT

Complete step-by-step electronics wiring, pin assignments, and power regulation design

This document details the hardware configurations for the two nodes comprising the **Solar Soil IoT System**: the battery-powered field **Main Sensor Node** (which collects metrics and transmits them via LoRa) and the wall-powered **Gateway Node** (which translates incoming LoRa packets into MQTT events over Wi-Fi).

๐Ÿ“ฆ 1. Parts Inventory (from Project BOM)

The following tables represent the components allocated from the project hardware manifest for both nodes.

Node A: Main Sensor Node Components

Component Purpose Priority Reichelt Part No.
ESP32-C6 DevKit N8 Main RISC-V microcontroller with sleep support Essential esp32-c6 n8
SX1276 LoRa Module (868 MHz) Wireless transceiver SPI breakout (RFM95W compatible) Essential -
LoRa Antenna 868MHz (SMA) Provides high-efficiency RF transmission path Essential ora_868_mhz_antenna_sma_plug
Capacitive Soil Moisture v1.2 Analog soil moisture sensor (corrosion resistant) Essential sensor_bodenfeuchte_-223620
DHT22 Sensor Breakout Reads ambient air temperature and humidity Essential dht22
INA219 Power Monitor I2C High-side bus voltage and current sensing Optional ina219
Solar Panel 6V 2W Charges batteries during sunlit hours Essential -
4x AA NiMH Batteries (GP ReCyko) 4.8V rechargeable battery pack Essential recyko_nimh-akku_aa_mignon_2100_mah
4x AA Battery Holder Series battery carriage box Essential holder AA
LM2596 Buck Converter Regulates fluctuating battery pack voltage to 5.0V Essential 2596-buvk-convtr
Schottky Diode 1N5819 Blocks reverse flow from battery into solar panel Essential in5819
Passive Kit 4.7kฮฉ, 10kฮฉ resistors; 100nF, 10ยตF capacitors Essential -

Node B: Gateway Node Components

Component Qty Purpose Priority Reichelt Part No.
ESP32-C6 DevKit N8 1 Gateway logic supervisor and Wi-Fi station connection Essential esp32-c6 n8
LoRa Module 868MHz 1 Listens for sensor node telemetry frames (RFM95W/SPI) Essential -
LoRa Antenna 868MHz SMA 1 Ensures wide-area receive signal coverage Essential ora_868_mhz_antenna_sma_plug
OLED Display 0.96" SSD1306 1 Displays local network status, Wi-Fi IP, and metrics Optional oled_display_0_96_128x64_pixels_
USB 5V/2A Adapter 1 Steady 230V AC grid to 5V DC converter Essential -
USB-C Cable (1m) 1 Provides power and programming connection to ESP32 Essential -

โšก 2. Power System Wiring (Main Node)

The Main Node is solar-recharged and battery-buffered. Precision regulation is required to step down charging currents safely and protect the ESP32 input rails.

โš ๏ธ Protection Diode Placement

You MUST install the 1N5819 Schottky Diode in series between the Solar Panel (+) and the Battery pack. Without this diode, the battery pack will discharge back into the solar panel cells overnight, causing cell degradation and rapid battery drainage.
[ SOLAR PANEL ]
  (+) โ”€โ”€โ”€โ”€โ”€โ”€โ–บ [ 1N5819 DIODE (Anode) ] โ”€โ”€ [ (Cathode) ] โ”€โ”€โ”
  (-) โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ”
                                                         โ”‚  โ”‚
                                                         โ–ผ  โ–ผ
                                                 [ BATTERY PACK (4.8V) ]
                                                         โ”‚  โ”‚
                                 โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜  โ”‚
                                 โ”‚   โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                 โ–ผ   โ–ผ
                        [ LM2596 BUCK CONVERTER ]
                          IN(+) โ”€โ”€โ”€ IN(-)
                          OUT(+) โ”€โ”€ OUT(-)
                            โ”‚         โ”‚
                            โ–ผ         โ–ผ
                      [ BREADBOARD POWER RAILS ]
                            (+) โ”€โ”€โ”€โ”€โ”€โ”€ (-)
                            (5V)     (GND)
  

Step-by-step Power Assembly Flow:

  1. Connect the **Solar Panel Positive (+)** wire to the Anode (non-striped side) of the **1N5819 Schottky Diode**.
  2. Connect the Cathode (striped side) of the diode to the **Battery Holder Positive (+)** lead.
  3. Connect the **Solar Panel Negative (-)** wire directly to the **Battery Holder Negative (-)** lead.
  4. Route the battery pack lines to the **LM2596 Buck Converter Input** (Battery + to `IN+`, Battery - to `IN-`).
  5. Use a multimeter to measure the buck converter output. Use a small screwdriver to turn the copper potentiometer screw on the blue LM2596 board until the output voltage reads exactly 5.0V.
  6. Connect the adjusted LM2596 outputs to the breadboard power rails (`OUT+` to Red rail, `OUT-` to Black rail).

๐Ÿ’ก INA219 Monitor Integration (Optional)

To enable high-side current and voltage sensing, run the Battery Holder (+) line through the INA219 shunt pin headers:
Battery Holder (+) โ”€โ”€โ–บ INA219 VIN(+) โ”€โ”€โ–บ INA219 VIN(-) โ”€โ”€โ–บ LM2596 IN(+).

๐ŸŒฑ 3. Main Sensor Node Connection Map

The following mapping connects the sensors and the SX1276 LoRa transceiver module to the **ESP32-C6** developer board on the breadboard.

ESP32-C6 Pin Component Pin Signal Name / Description
5V (or VIN) LM2596 OUT(+) Main 5.0V Power Input (Regulated)
GND LM2596 OUT(-) Common Ground Reference
3.3V Sensors & LoRa VCC Power distribution rail for low-power modules
GPIO 5 LoRa SCK SPI Clock
GPIO 19 LoRa MISO SPI Master In Slave Out
GPIO 27 LoRa MOSI SPI Master Out Slave In
GPIO 18 LoRa SS / NSS SPI Slave Select (Chip Select)
GPIO 14 LoRa RST SPI Reset Line
GPIO 26 LoRa DIO0 LoRa Interrupt Request Pin (detects packet transmissions)
GPIO 4 DHT22 DATA Single-bus Digital Temperature/Humidity Data Stream
GPIO 36 Soil moisture AOUT ADC Analog Input (Soil Moisture Permittivity Voltages)
GPIO 21 INA219 SDA I2C Serial Data
GPIO 22 INA219 SCL I2C Serial Clock

๐Ÿ“ก 4. Gateway Node Connection Map

The Gateway Node relies on external USB supply. It utilizes a similar SPI interface for the LoRa module, and connects an optional 0.96" SSD1306 OLED screen over I2C to show diagnostic sync states.

ESP32-C6 Pin Component Pin Signal Name / Description
USB 5V USB-C Port Main 5.0V power input from wall adapter
3.3V LoRa & OLED VCC Powers the receiver module and I2C display panel
GND LoRa & OLED GND Common Ground Reference
GPIO 5 LoRa SCK SPI Clock
GPIO 19 LoRa MISO SPI Master In Slave Out
GPIO 27 LoRa MOSI SPI Master Out Slave In
GPIO 18 LoRa SS / NSS SPI Slave Select / CS
GPIO 14 LoRa RST SPI Reset Line
GPIO 26 LoRa DIO0 LoRa Packet Rx Notification Line
GPIO 4 OLED SDA I2C Data line for SSD1306 Display
GPIO 15 OLED SCL I2C Clock line for SSD1306 Display
GPIO 16 OLED RST OLED Screen Hardware Reset Pin

๐Ÿ›ก๏ธ 5. Noise and Safety Passives Placement

To prevent sensor reading jitter and ensure RF stability during LoRa transmission bursts, the passive components in the hardware kit must be connected as follows:

  1. Power Rail Smoothing (10ยตF Capacitor):
    Connect the 10ยตF Electrolytic Capacitor directly across the buck converter outputs (`OUT+` to `OUT-`) on the breadboard power rails. Pay attention to polarity (the gray stripe indicates the negative leg).
  2. High-Frequency Decoupling (100nF Capacitor):
    Connect the 100nF Ceramic Capacitor as close as possible to the LoRa module's VCC and GND pins. This suppresses high-frequency drops caused by RF transmitter pulses.
  3. DHT22 Pull-Up Resistor (4.7kฮฉ):
    Connect the 4.7kฮฉ resistor between the DHT22 VCC (3.3V) pin and the DHT22 DATA pin. This keeps the single-wire data line high by default to prevent communication dropouts.

๐Ÿšซ Deep Sleep Voltage Restrictions

During deep sleep, the ESP32-C6 power draw is in micro-amps. Ensure that your LM2596 quiescent current does not drain the battery: if you find excessive draw, bypass the LM2596 LED power light by scraping its tiny PCB tracer to maximize battery longevity in the field.

๐Ÿ”Œ 6. Quick Breadboard Wiring Visualizer

Use these visual connection maps to complete your breadboard hookups quickly and reliably. Wires are color-coded to standard prototyping conventions.

Main Sensor Node (Node A) Quick Diagram

+---------------------------------------------+ | BREADBOARD POWER RAILS | | [RED RAIL (+)] โ—„โ”€โ”€โ”€ LM2596 OUT(+) 5V | | [BLK RAIL (-)] โ—„โ”€โ”€โ”€ LM2596 OUT(-) GND | +---------------------------------------------+ โ–ฒ โ–ฒ โ”‚ โ”‚ (Passive Smoothing: 10ยตF Cap [+-] across Rails) โ”‚ โ”‚ +โ”€โ”€โ”ดโ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€+ | ESP32-C6 DEV KIT | | | | (L) Pins (R) Pins | | [ RST ] [ 3.3V ] โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ–บ [To Sensors/LoRa VCC] | [ 3.3V ] [ GND ] โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ–บ [To GND Rail] | [GPIO 36] โ—„โ”€โ”€ Soil (AOUT) [ 5VIN ] โ—„โ”€โ”€โ”€โ”ผโ”€โ”€โ–บ [From RED Rail +5V] | [GPIO 0] [GPIO 22] โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ–บ INA219 SCL | [GPIO 1] [GPIO 21] โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ–บ INA219 SDA | [GPIO 4] โ—„โ”€โ”€ DHT22 DATA [GPIO 20] | | [GPIO 5] โ”€โ”€โ”€โ–บ LoRa SCK [GPIO 19] โ—„โ”€โ”€โ”€โ”ผโ”€โ”€โ–บ LoRa MISO | [GPIO 18] โ”€โ”€โ”€โ–บ LoRa CS/NSS [GPIO 27] โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ–บ LoRa MOSI | [GPIO 14] โ”€โ”€โ”€โ–บ LoRa RST [GPIO 26] โ—„โ”€โ”€โ”€โ”ผโ”€โ”€โ–บ LoRa DIO0 +---------------------------------------------+
LoRa SX1276 Pin ESP32-C6 Pin DHT22 Pin ESP32-C6 Pin Soil Moisture Pin ESP32-C6 Pin
VCC (3.3V) 3.3V 1. VCC (3.3V) 3.3V VCC (3.3V) 3.3V
GND GND 2. DATA GPIO 4 GND GND
SCK GPIO 5 3. NC - AOUT GPIO 36
MISO GPIO 19 4. GND GND INA219 Bus Connections
MOSI GPIO 27 DHT22 Pull-Up:
Connect a 4.7kฮฉ resistor between VCC (3.3V) and DATA (GPIO 4) pins.
SDA GPIO 21
CS / NSS GPIO 18 SCL GPIO 22
RST GPIO 14 VIN(+) Battery Holder (+)
DIO0 GPIO 26 LoRa Decoupling:
100nF Cap across VCC and GND.
VIN(-) LM2596 IN(+)

Gateway Node (Node B) Quick Diagram

+---------------------------------------------+ | GATEWAY BREADBOARD POWER | | [VCC RAIL (+)] โ—„โ”€โ”€โ”€ ESP32 3.3V OUT | | [GND RAIL (-)] โ—„โ”€โ”€โ”€ ESP32 GND OUT | +---------------------------------------------+ โ–ฒ โ–ฒ โ”‚ โ”‚ +โ”€โ”€โ”ดโ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€+ | ESP32-C6 GATEWAY | | | | (L) Pins (R) Pins | | [ RST ] [ 3.3V ] โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ–บ [VCC RAIL (+)] | [ 3.3V ] [ GND ] โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ–บ [GND RAIL (-)] | [GPIO 36] [ 5VIN ] โ—„โ”€โ”€โ”€โ”ผโ”€โ”€โ–บ [5V USB Power Input] | [GPIO 4] โ”€โ”€โ”€โ–บ OLED SDA [GPIO 22] | | [GPIO 5] โ”€โ”€โ”€โ–บ LoRa SCK [GPIO 21] | | [GPIO 18] โ”€โ”€โ”€โ–บ LoRa CS/NSS [GPIO 19] โ—„โ”€โ”€โ”€โ”ผโ”€โ”€โ–บ LoRa MISO | [GPIO 14] โ”€โ”€โ”€โ–บ LoRa RST [GPIO 27] โ”€โ”€โ”€โ”€โ”ผโ”€โ”€โ–บ LoRa MOSI | [GPIO 15] โ”€โ”€โ”€โ–บ OLED SCL [GPIO 26] โ—„โ”€โ”€โ”€โ”ผโ”€โ”€โ–บ LoRa DIO0 | [GPIO 16] โ”€โ”€โ”€โ–บ OLED RST [GPIO 20] | +---------------------------------------------+
LoRa RX Pin ESP32-C6 Pin SSD1306 OLED Pin ESP32-C6 Pin Required Action
VCC 3.3V VCC 3.3V Continuous Power:
Ensure the Gateway board remains powered via a USB-C cable hooked to the 5V/2A mains wall plug adapter.
GND GND GND GND
SCK GPIO 5 SDA GPIO 4
MISO GPIO 19 SCL GPIO 15
MOSI GPIO 27 RST GPIO 16 OLED Setup: Uses software-driven I2C connection paths on pins 4 & 15.
CS / NSS GPIO 18 -
RST GPIO 14 - LoRa Decoupling:
Connect a 100nF decoupling capacitor across VCC and GND.
DIO0 GPIO 26 -