To convert the 8-bit binary value 11001000 to decimal, the direct answer is 200. The formula used is the sum of each bit multiplied by its positional weight: (1 × 2^7) + (1 × 2^6) + (0 × 2^5) + (0 × 2^4) + (1 × 2^3) + (0 × 2^2) + (0 × 2^1) + (0 × 2^0) = 128 + 64 + 0 + 0 + 8 + 0 + 0 + 0 = 200. In hexadecimal, this same binary string converts directly to C8. But for electrical engineers and makers building smart panels, knowing how to convert binary to base-10 is only step one; step two is converting those raw binary registers from an ADC or power sensor into real-world AC metrics.
| Decimal | Binary (8-bit) | Hexadecimal |
|---|---|---|
| 160 | 10100000 | A0 |
| 180 | 10110100 | B4 |
| 200 | 11001000 | C8 |
| 220 | 11011100 | DC |
| 240 | 11110000 | F0 |
Translating Binary Registers to Real-World AC Power
When reading binary data from a CT clamp or a smart meter like the PZEM-004T via UART, the raw binary payload must be scaled to meaningful electrical units. What assumption fixes the final physical answer? The baseline voltage, phase configuration, and power factor (pf). Without locking in these three variables, your binary-to-Watts math will fail on the bench.
Here is how the answer shifts depending on your target electrical environment:
- 120V Single-Phase (US Standard): If your binary ADC count maps to a 10A current reading, the real power at unity PF is 1,200W (120V × 10A).
- 230V Single-Phase (EU/UK Standard): That exact same 10A binary reading translates to 2,300W because the voltage baseline assumption shifted.
- 400V 3-Phase (Industrial): The binary current reading must be multiplied by √3 (1.732) and the line-to-line voltage. The calculation shifts to roughly 6,928W (1.732 × 400V × 10A). For deeper math on this, refer to standard 3-phase power formulas.
ADC Scaling Matrix: Binary Steps to Physical Units
In embedded power monitoring, you rarely read clean 8-bit bytes. Microcontrollers like the ESP32 use 12-bit ADCs, yielding binary values from 000000000000 (0) to 111111111111 (4095). When pairing an ESP32 with a ZMPT101B AC voltage sensor, you must map these binary steps to physical AC voltages. Note that the ESP32 ADC is notoriously non-linear at the extremes, so Espressif recommends keeping your operating range in the middle of the binary spectrum.
| Binary ADC Count | Decimal Value | Measured AC Voltage (RMS) | Sensor Operating State |
|---|---|---|---|
001000000000 | 512 | 45.2V | Low-end non-linear zone |
010000000000 | 1024 | 90.5V | Linear operating range |
011000000000 | 1536 | 135.8V | Linear operating range |
100000000000 | 2048 | 181.0V | Mid-point (Vref / 2) |
101000000000 | 2560 | 226.3V | Linear operating range |
110000000000 | 3072 | 271.5V | High-end saturation zone |
As shown in the matrix, a binary shift of 512 steps roughly correlates to a 45V physical change in this specific sensor configuration. If your binary readings cap out at 3072, your sensor op-amp is saturating, and you must adjust the physical trim potentiometer on the ZMPT101B module before trusting the data.
FAQ: Binary Conversions in Electrical Projects
How do I handle negative binary values when solar panels export power?
Standard binary is unsigned (only positive). To represent reverse current flow (exporting to the grid), your sensor firmware must use two's complement binary. In a 16-bit signed register, a binary value of 1111111111111100 is not 65,532; it is -4. Always check your sensor datasheet (like the Modbus RTU registers on a PZEM-016) to confirm if the binary payload is signed or unsigned before writing your conversion logic.
Why does my binary-to-hex conversion look wrong in my serial monitor?
The most common bench mistake is endianness. If your power sensor sends a 16-bit binary value for current, it might transmit the Least Significant Byte (LSB) first. If the sensor sends 00000011 (3) then 11101000 (232), reading it as a single 16-bit big-endian integer yields 0000001111101000 (1000 decimal). Reading it correctly as little-endian yields 1110100000000011 (59,395 decimal). Always verify the byte order when converting binary serial streams to physical units.
Can I convert binary directly to BCD (Binary-Coded Decimal) for 7-segment displays?
Yes, but do not use standard hex conversion. BCD forces every 4-bit nibble to represent a base-10 digit (0-9). The binary value 11001000 (200 decimal) converts to BCD as 0010 0000 0000. If you try to push standard hex C8 to a BCD-to-7-segment decoder chip like the CD4511, it will blank the display because hex 'C' is an invalid BCD state. Use a dedicated binary-to-BCD algorithm (like the double-dabble algorithm) in your microcontroller code before sending the data to the display pins.






