Skip to main content

Overview

The Voltage converter supports conversions between electrical voltage units, from small millivolt measurements to large megavolt values.

Import

import { VoltageUnitConverter, VOLTAGE_UNIT } from 'univerto/voltage'

Available Units

The VOLTAGE_UNIT constant provides the following units:
  • MILLIVOLT - Millivolt (mV)
  • VOLT - Volt (V)
  • KILOVOLT - Kilovolt (kV)
  • MEGAVOLT - Megavolt (MV)

Usage

import { VoltageUnitConverter, VOLTAGE_UNIT } from 'univerto/voltage'

// Convert 5000 mV to V
const volts = VoltageUnitConverter.from(5000, VOLTAGE_UNIT.MILLIVOLT)
  .to(VOLTAGE_UNIT.VOLT)
  .convert()

console.log(volts) // 5

Common Conversions

Electronic Circuits

// Millivolts to volts (sensor reading)
const sensorVoltage = VoltageUnitConverter.from(3300, VOLTAGE_UNIT.MILLIVOLT)
  .to(VOLTAGE_UNIT.VOLT)
  .convert() // 3.3

// Volts to millivolts (ADC reference)
const adcReference = VoltageUnitConverter.from(5, VOLTAGE_UNIT.VOLT)
  .to(VOLTAGE_UNIT.MILLIVOLT)
  .convert() // 5000

Power Systems

// Household voltage (V to kV)
const householdKV = VoltageUnitConverter.from(120, VOLTAGE_UNIT.VOLT)
  .to(VOLTAGE_UNIT.KILOVOLT)
  .convert() // 0.12

// Industrial voltage (kV to V)
const industrialV = VoltageUnitConverter.from(11, VOLTAGE_UNIT.KILOVOLT)
  .to(VOLTAGE_UNIT.VOLT)
  .convert() // 11000

// Transmission line (kV to MV)
const transmissionMV = VoltageUnitConverter.from(500, VOLTAGE_UNIT.KILOVOLT)
  .to(VOLTAGE_UNIT.MEGAVOLT)
  .convert() // 0.5

Laboratory Measurements

// Battery voltage (mV to V)
const batteryVoltage = VoltageUnitConverter.from(1500, VOLTAGE_UNIT.MILLIVOLT)
  .to(VOLTAGE_UNIT.VOLT)
  .convert() // 1.5

// Power supply (V to mV)
const powerSupply = VoltageUnitConverter.from(12, VOLTAGE_UNIT.VOLT)
  .to(VOLTAGE_UNIT.MILLIVOLT)
  .convert() // 12000

API Reference

For detailed API documentation, see the API Reference page.

Build docs developers (and LLMs) love