Electrical Energy Calculator
Calculate electricity use from power and duration, or constant DC voltage and current. Compare energy use over different operating times in watt-hours, kilowatt-hours and joules.
Open toolInteractive calculation is unavailable until JavaScript loads. The formulas and reference information below remain available.
Calculate DAC output voltage from a digital code, or the nearest code for a target voltage, for unipolar or bipolar outputs.
Choose Code to voltage or Voltage to code.
Enter the DAC resolution in bits and the reference voltage with its unit.
Enter the output gain if an amplifier or a ×2 output stage follows the DAC; use 1 otherwise.
Choose Unipolar for a 0 V to VREF output or Bipolar for a ±VREF output with offset binary codes.
Enter a code as decimal, 0x hex or 0b binary, or move the code slider; or enter the target voltage.
Read the output voltage or nearest code, the output step and the remaining error. The staircase shows the codes around your result.
Use Copy result for a labeled summary. Reset restores the starting values.
A digital-to-analog converter produces one of 2^N output levels. In straight binary coding each code adds one step of VREF / 2^N, so code D gives VREF × D / 2^N and the highest code is one step below the reference.
A bipolar converter with offset binary coding spans −VREF to +VREF. Code 0 gives −VREF, the middle code 2^(N−1) gives 0 V, and each step is 2 × VREF / 2^N. An output gain multiplies every level and every step.
To reach a target voltage, the calculator rounds to the nearest code. The remaining error is at most half a step, unless the target lies outside the output range, where no code reaches it and the nearest end code is shown instead.
Only the power-of-two convention is used, as DAC datasheets such as the MCP4725 state it. The ADC counts-to-voltage calculator also offers the VREF / (2^N − 1) convention.
Limitations: this is an ideal model. Real DACs add offset, gain and linearity errors, reference tolerance, output loading and settling time. Some parts use two's-complement codes for bipolar outputs; convert those to offset binary by inverting the most significant bit. For reading an ADC use the ADC counts-to-voltage calculator; for noise and effective bits use the ADC quantization, ENOB and SNR estimator.
Unipolar output: VOUT = G × VREF × D / 2^N. D is the code, N the resolution, VREF the reference voltage and G the output gain.
Bipolar output: VOUT = G × VREF × (2 × D / 2^N − 1), with offset binary codes.
Output step: Step = G × VREF / 2^N for unipolar, 2 × G × VREF / 2^N for bipolar.
Nearest code: D = round(VT × 2^N / (G × VREF)) for unipolar, round((VT / (G × VREF) + 1) × 2^(N−1)) for bipolar, limited to 0 … 2^N − 1.
12-bit, VREF = 5 V, code 2048: 2.5 V. One step is 5 / 4096 = 1.2207 mV, and 2048 steps are half the reference.
12-bit, VREF = 2.048 V, gain 2, code 1000: 1 V. 2 × 2.048 × 1000 / 4096 = 1 V. The gain doubles the step to 1 mV.
4-bit bipolar, VREF = 5 V, code 0b1111: 4.375 V. Each step is 2 × 5 / 16 = 0.625 V. Code 15 is 5 × (30/16 − 1) = 4.375 V, one step below +5 V.
12-bit, VREF = 3.3 V, target 1.0 V: No exact code: code 1241 gives 999.829 mV. 1.0 × 4096 / 3.3 = 1241.21, which rounds to 1241. The output is 170.898 μV below the target, 0.2121 of a step.
8-bit, VREF = 5 V, target 5 V: No code reaches 5 V. The highest code, 255, gives 4.98047 V, one step below the reference, so 5 V is outside the output range.
Microchip: MCP4725 12-bit DAC datasheet
Texas Instruments: Coding Schemes Used With Data Converters (SBAA042A)
Available now
Calculate electricity use from power and duration, or constant DC voltage and current. Compare energy use over different operating times in watt-hours, kilowatt-hours and joules.
Open tool →Available now
Add up to 20 resistors in series using Ω, kΩ or MΩ for circuit analysis and electricity calculations, with a diagram and running total.
Open tool →Available now
Convert absolute temperatures between Celsius, Fahrenheit and kelvin.
Open tool →Nice audio board working as expected.
Given the fact that this was my first purchase and I made it thinking I was buying genuine Yihua products, this has been a setback. I received a lesser known OEM brand called MYTO and while both the products seem to be similar from appearance, my real contention is the quality and quantity of the brass wool. On top of that not informing the customer about the unavailability of the Yihua product and instead sending a product from a different brand is also antagonising. Henceforth, I might just have to think twice before ordering from ThinkRobotics.
TOF MINIF Range Sensor - UART TOF Time-of-Flight Laser Range Sensor
We are disappointed with our recent order experience. We clearly communicated our requirement for 433 MHz antennas on WhatsApp, but the issue remains unresolved. We have been following up for more than 10 days and are still waiting for a proper refund resolution.
As a regular B2B customer, we expected better support. This experience has affected our trust in ThinkRobotics, and we may have to consider other suppliers for future purchases. We request a fair and prompt refund.
Anodised Aluminium Cup Head Washers (Pack of 10)