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.
Convert ADC counts to voltage, or a voltage to the expected count, from resolution and reference voltage, with the LSB size and code band.
Choose Counts to voltage or Voltage to counts.
Enter the ADC resolution in bits and the reference voltage with its unit.
Choose the LSB convention your datasheet or code uses, and Rounding or Truncation for how inputs map to codes.
Enter a code as decimal, 0x hex or 0b binary, or drag the code slider; or enter an input voltage.
Read the voltage or code, the LSB size and the band of inputs that give the code. The staircase shows the code and its neighbours.
Use Copy result for a labeled summary. Reset restores the starting values.
An analog-to-digital converter divides its input range into 2^N codes. One code step, the least significant bit (LSB), is the reference voltage divided by 2^N. A 10-bit converter with a 5 V reference has 1024 codes and an LSB of about 4.883 mV.
Each code stands for a band of input voltages, not a single voltage. With rounding, a code covers half an LSB either side of its nominal value, so an ideal reading is within ±½ LSB of the input. With truncation, a code covers one LSB above its nominal value.
Datasheets such as the ATmega328P state that the top code represents the reference minus one LSB. Some code divides by 2^N − 1 instead, so that the top code equals the reference. The two conventions differ by less than one LSB; choose the one that matches your firmware.
This calculator models an ideal single-ended unipolar ADC. It does not include offset, gain, linearity or noise errors, reference tolerance, input dividers, differential or two's-complement results, or averaging. For noise, SNR and effective bits use the ADC quantization, ENOB and SNR estimator; for converter outputs use the DAC code-to-voltage calculator.
LSB size: LSB = VREF / 2^N, or VREF / (2^N − 1) with the full-scale-code convention. N is the resolution in bits and VREF the reference voltage in volts.
Code to voltage: V = k × LSB, where k is the code from 0 to 2^N − 1.
Voltage to code, rounding: k = floor(VIN / LSB + 0.5), limited to 0 … 2^N − 1.
Voltage to code, truncation: k = floor(VIN / LSB), limited to 0 … 2^N − 1.
Code band: Rounding: (k − 0.5) × LSB to (k + 0.5) × LSB. Truncation: k × LSB to (k + 1) × LSB.
10-bit, VREF = 5 V, code 512: 2.5 V. 1 LSB = 5 / 1024 = 4.88281 mV, and 512 × 4.88281 mV = 2.5 V. With rounding the input was between 2.49756 V and 2.50244 V.
12-bit, VREF = 3.3 V, code 4095: 3.29919 V. The top code is one LSB (805.664 μV) below the reference. With the VREF / (2^N − 1) convention the same code reads 3.3 V.
10-bit, VREF = 5 V, input 1.234 V: Code 253 (rounding) or 252 (truncation). 1.234 × 1024 / 5 = 252.7232 LSB. Rounding gives 253; truncation gives 252.
12-bit, VREF = 3.3 V, input 3.3 V: Code 4095, saturated. 3.3 V is 4096 LSB, one more than the top code, so the ideal ADC saturates at 4095.
Microchip: ATmega328P datasheet, ADC conversion result
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)