diff --git a/phosphor-power-supply/power_supply.cpp b/phosphor-power-supply/power_supply.cpp
index 226d03b..0e2c259 100644
--- a/phosphor-power-supply/power_supply.cpp
+++ b/phosphor-power-supply/power_supply.cpp
@@ -551,4 +551,44 @@
     }
 }
 
+void PowerSupply::getInputVoltage(double& actualInputVoltage,
+                                  int& inputVoltage) const
+{
+    using namespace phosphor::pmbus;
+
+    actualInputVoltage = in_input::VIN_VOLTAGE_0;
+    inputVoltage = in_input::VIN_VOLTAGE_0;
+
+    if (present)
+    {
+        try
+        {
+            // Read input voltage in millivolts
+            auto inputVoltageStr = pmbusIntf->readString(READ_VIN, Type::Hwmon);
+
+            // Convert to volts
+            actualInputVoltage = std::stod(inputVoltageStr) / 1000;
+
+            // Calculate the voltage based on voltage thresholds
+            if (actualInputVoltage < in_input::VIN_VOLTAGE_MIN)
+            {
+                inputVoltage = in_input::VIN_VOLTAGE_0;
+            }
+            else if (actualInputVoltage < in_input::VIN_VOLTAGE_110_THRESHOLD)
+            {
+                inputVoltage = in_input::VIN_VOLTAGE_110;
+            }
+            else
+            {
+                inputVoltage = in_input::VIN_VOLTAGE_220;
+            }
+        }
+        catch (const std::exception& e)
+        {
+            log<level::ERR>(
+                fmt::format("READ_VIN read error: {}", e.what()).c_str());
+        }
+    }
+}
+
 } // namespace phosphor::power::psu
diff --git a/phosphor-power-supply/power_supply.hpp b/phosphor-power-supply/power_supply.hpp
index 6291deb..86eb926 100644
--- a/phosphor-power-supply/power_supply.hpp
+++ b/phosphor-power-supply/power_supply.hpp
@@ -235,6 +235,15 @@
         return readFail >= LOG_LIMIT;
     }
 
+    /**
+     * @brief Reads the pmbus input voltage and returns that actual voltage
+     *        reading and the calculated input voltage based on thresholds.
+     * @param[out] actualInputVoltage - The actual voltage reading, in Volts.
+     * @param[out] inputVoltage - A rounded up/down value of the actual input
+     *             voltage based on thresholds, in Volts.
+     */
+    void getInputVoltage(double& actualInputVoltage, int& inputVoltage) const;
+
   private:
     /** @brief systemd bus member */
     sdbusplus::bus::bus& bus;
diff --git a/phosphor-power-supply/psu_manager.cpp b/phosphor-power-supply/psu_manager.cpp
index 08b103d..704020e 100644
--- a/phosphor-power-supply/psu_manager.cpp
+++ b/phosphor-power-supply/psu_manager.cpp
@@ -495,7 +495,10 @@
                       [](const auto& psu) { return psu->isPresent(); });
 
     // Validate the supported configurations. A system may support more than one
-    // power supply model configuration.
+    // power supply model configuration. Since all configurations need to be
+    // checked, the additional data would contain only the information of the
+    // last configuration that did not match.
+    std::map<std::string, std::string> tmpAdditionalData;
     for (const auto& config : supportedConfigs)
     {
         if (config.first != model)
@@ -504,14 +507,54 @@
         }
         if (presentCount != config.second.powerSupplyCount)
         {
-            additionalData["EXPECTED_COUNT"] =
+            tmpAdditionalData.clear();
+            tmpAdditionalData["EXPECTED_COUNT"] =
                 std::to_string(config.second.powerSupplyCount);
-            additionalData["ACTUAL_COUNT"] = std::to_string(presentCount);
+            tmpAdditionalData["ACTUAL_COUNT"] = std::to_string(presentCount);
             continue;
         }
+
+        bool voltageValidated = true;
+        for (const auto& psu : psus)
+        {
+            if (!psu->isPresent())
+            {
+                // Only present PSUs report a valid input voltage
+                continue;
+            }
+
+            double actualInputVoltage;
+            int inputVoltage;
+            psu->getInputVoltage(actualInputVoltage, inputVoltage);
+
+            if (std::find(config.second.inputVoltage.begin(),
+                          config.second.inputVoltage.end(),
+                          inputVoltage) == config.second.inputVoltage.end())
+            {
+                tmpAdditionalData.clear();
+                tmpAdditionalData["ACTUAL_VOLTAGE"] =
+                    std::to_string(actualInputVoltage);
+                for (const auto& voltage : config.second.inputVoltage)
+                {
+                    tmpAdditionalData["EXPECTED_VOLTAGE"] +=
+                        std::to_string(voltage) + " ";
+                }
+                tmpAdditionalData["CALLOUT_INVENTORY_PATH"] =
+                    psu->getInventoryPath();
+
+                voltageValidated = false;
+                break;
+            }
+        }
+        if (!voltageValidated)
+        {
+            continue;
+        }
+
         return true;
     }
 
+    additionalData.insert(tmpAdditionalData.begin(), tmpAdditionalData.end());
     return false;
 }
 
diff --git a/pmbus.hpp b/pmbus.hpp
index ea2b297..4bdc23f 100644
--- a/pmbus.hpp
+++ b/pmbus.hpp
@@ -11,6 +11,24 @@
 
 namespace fs = std::filesystem;
 
+// The file name Linux uses to capture the READ_VIN from pmbus.
+constexpr auto READ_VIN = "in1_input";
+
+namespace in_input
+{
+// VIN thresholds in Volts
+constexpr auto VIN_VOLTAGE_MIN = 20;
+constexpr auto VIN_VOLTAGE_110_THRESHOLD = 160;
+
+// VIN actual values in Volts
+// VIN_VOLTAGE_0:   VIN < VIN_VOLTAGE_MIN
+// VIN_VOLTAGE_110: VIN_VOLTAGE_MIN < VIN < VIN_VOLTAGE_110_THRESHOLD
+// VIN_VOLTAGE_220: VIN_VOLTAGE_110_THRESHOLD < VIN
+constexpr auto VIN_VOLTAGE_0 = 0;
+constexpr auto VIN_VOLTAGE_110 = 110;
+constexpr auto VIN_VOLTAGE_220 = 220;
+} // namespace in_input
+
 // The file name Linux uses to capture the STATUS_WORD from pmbus.
 constexpr auto STATUS_WORD = "status0";
 
