This Arduino code will run on the Heltec ESP32 LoRA V3 (915 MHz) aboard the PHAT-3 mainboard. It will save data from PCB-mounted sensors to a micro SD card, as well as transmitting it over LoRA.
Sensor purchase requests:
<Arduino.h>
<Wire.h>
<SPI.h>
<SD.h>
- SCL - schematic pin 11 - GPIO 41
- SDA - schematic pin 12 - GPIO 42
Temperature and humidity sensor
- Purchase link
- AHT 21 Documentation
- On I2C bus
- 7-bit I2C Address: 0x38
Temperature and pressure sensor
- Purchase link
- BMP180 Documentation
- On I2C bus
- 7-bit I2C address: 0x77
Accelerometer
- Purchase link
- GY-521 Documentation
- On I2C bus
- 7-bit I2C address: 0x68 (because AD0 pin is disconnected)
GPS
- Purchase link
- GT-U7 Documentation
- Specification page
- UART GPS
- ESP -> GT-U7 - schematic pin 1 (U2TXD) - GPIO 7
- GT-U7 -> ESP - schematic pin 2 (U2RXD) - GPIO 6
CO2, temperature, humidity
- Purchase link
- SCD41 Documentation
- On I2C bus
- 7-bit I2C address: 0x62
Camera
- Documentation
- ESP -> UCAM - schematic pin 9 (U1TXD) - GPIO 39
- UCAM -> ESP - schematic pin 10 (U1RXD) - GPIO 40
- Purchase link
- SPI SD Card Reader
- MISO (sub -> main) - schematic pin 29 - GPIO 34
- CLK (clock) - schematic pin 30 - GPIO 33
- MOSI (main -> sub) - schematic pin 31 - GPIO 47
- CS (chip select) - schematic pin 32 - GPIO 48