Week 09 — Input Devices

For this assignment, I integrated input devices into my Smart PMB board developed for the Portable Ground Control Station. The system monitors battery voltage and temperature using an ESP32-S3.

Hero Shot

Input Devices

I used a voltage divider for battery monitoring and a DHT11 temperature sensor. The voltage divider allows the ESP32 ADC to safely measure the battery voltage, while the DHT11 provides temperature data.

Sensor Setup

Testing

The sensors were connected to the Smart PMB board and tested using the ESP32. Values were read through the Serial Monitor and verified during operation.

Testing

Arduino Code


#include 

#define DHTPIN 4
#define DHTTYPE DHT11
#define VOLTAGE_PIN 34

DHT dht(DHTPIN, DHTTYPE);

float R1 = 30000.0;
float R2 = 7500.0;

void setup() {
  Serial.begin(115200);
  dht.begin();
}

void loop() {
  int adcValue = analogRead(VOLTAGE_PIN);

  float adcVoltage = adcValue * (3.3 / 4095.0);
  float batteryVoltage = adcVoltage * ((R1 + R2) / R2);

  float temperature = dht.readTemperature();

  Serial.print("Battery Voltage: ");
  Serial.print(batteryVoltage);
  Serial.println(" V");

  Serial.print("Temperature: ");
  Serial.print(temperature);
  Serial.println(" C");

  delay(2000);
}

Result

The Smart PMB successfully reads battery voltage and temperature, providing useful monitoring information for the Portable Ground Control Station. These measurements can later be displayed on the OLED screen and used to monitor system status during operation.

Final Setup