Bringing It Together: Real-World Examples

AC Voltage (RMS)

Physical Value:
230.50
Digital Value:
2305
Binary:
0000 1001 0000 0001
Range:
0 to 6553.5V
Scale Factor:
10
Digital Range:
0 to 65535
Using 16-bit unsigned with 0.1V resolution. Chosen because AC voltage is always positive, and typical measurements need 0.1V precision up to ~400V with headroom for surge voltages.

Battery Current

Physical Value:
-45.60
Digital Value:
-456
Binary:
1111 1110 0011 1000
Range:
-3276.8A to +3276.7A
Scale Factor:
10
Digital Range:
-32768 to 32767
Using 16-bit signed with 0.1A resolution. Signed value needed for bidirectional current flow. Scale factor of 10 provides one decimal place precision while maintaining good range.

Solar Power (DC)

Physical Value:
75420.00
Digital Value:
75420
Binary:
0000 0000 0000 0001 0010 0110 1001 1100
Range:
0 to 4,294,967,295W
Scale Factor:
1
Digital Range:
0 to 0
Using 32-bit unsigned with 1W resolution. Large range needed for commercial installations, unsigned because power flow is unidirectional. No decimal places needed for power readings at this scale.

Grid Power (Bidirectional)

Physical Value:
-42680.00
Digital Value:
-42680
Binary:
1111 1111 1111 1111 0101 1001 0100 1000
Range:
-2,147,483,648W to +2,147,483,647W
Scale Factor:
1
Digital Range:
2147483648 to -2147483649
Using 32-bit signed with 1W resolution. Signed value needed for import/export power flow. Large range accommodates commercial installations while maintaining watt-level precision.

Status Flags (8-bit)

Binary:
10100110
System Active (bit 0)
Error Present (bit 1)
Battery Connected (bit 2)
Grid Connected (bit 5)
Maintenance Mode (bit 7)

Key Decision Factors

  • Required range (maximum and minimum values)
  • Needed precision (decimal places)
  • Direction of measurement (signed vs unsigned)
  • Memory and bandwidth constraints
  • Industry standards and protocols