Math Bridge: What Raw Code 2361 Means

← Back to Processing Readings Into Packets
Math BridgeFundamentalsInteractive runway

What Raw Code 2361 Means

One thread, no skipped algebra: turn one 12-bit code into volts, apply two declared decoding rules, and see why their answers differ.

Phoebe, the physics guidePhoebe guides
The one targetConvert code 2361 using an explicit measurement contract.
The chapter case12 bits, 3.3 V, TMP36-style and scale-by-100 rules.
What it buys youNever mistake a bare integer for a physical measurement.

A field team faces an unresolved physical question: What Raw Code 2361 Means They must answer it before changing raw twelve-bit code on the real device. Predict the direction first.

See the relationship before changing it

The figure reads from left to right. The blue card is raw twelve-bit code. The middle card applies this page's relationship. The green card is tmp36-style reading. Walk the arrows once: set the input, apply the rule, then read the result with its unit.

The retained audit below checks several chapter fixtures. This added model holds every other chapter fixture fixed, so the numeric fixture does not switch without explanation.

Raw twelve-bit code changes tmp36-style reading An input card leads through the page relationship to the tmp36-style reading result. SET INPUT ONE CONTROL APPLY RULE predict calculate check units READ RESULT
Walk the arrows. The outputs use V = codexV_ref/2^N, T = (V-V_0)/S, and T = code/100, the same conversion steps derived above.

Derive the baseline in four named moves

  1. 1

    Name the input. The chapter baseline for raw twelve-bit code is 2361.

  2. 2

    Name the relationship. V = code x V_ref/2^N; T_sensor = (V - V_0)/S; T_scaled = code/100

  3. 3

    Substitute the chapter fixture. Set raw twelve-bit code to 2361. The page ledger gives tmp36-style reading as 140.2 degrees C.

  4. 4

    Read the result. Keep degrees C beside the value. Use it only inside the technical boundary on this page.

Predict, then change raw twelve-bit code

Try Predict the direction of tmp36-style reading. Move one control, calculate, then check your prediction.

2361
Chapter baseline
TMP36-style reading

Observe The outputs use V = codexV_ref/2^N, T = (V-V_0)/S, and T = code/100, the same conversion steps derived above. Reset the control to 2361 and compare tmp36-style reading.

Explain Only raw twelve-bit code moves here. The other chapter fixtures remain fixed.

Check yourself

What should you do before trusting a moved-control result?
Answer: Predict its direction, apply the shown relationship, keep the units, and reset to the worked baseline.
What does this small model leave out?
Answer: Only raw twelve-bit code moves. Field effects named in the page's technical boundary stay fixed.

1. A code is an address, not a temperature

A 12-bit converter can write 4,096 different code addresses. Code 2361 tells you which address was selected. It does not tell you the voltage range, sensor law, scale, offset, or unit. Those belong to the measurement contract.

Phoebe: Think of “2361” as a room number. Without the building address, it can point to many different places.

2. Put the contract beside the bits

Contract itemRule used here
bit depth12 bits, so 2¹² = 4,096 levels
reference3.3 V across the full code range
sensor ruleV_out = 0.5 + 0.01T
payload rulescaled temperature = code/100

3. Derive both readings

V = code × V_ref/2^N; T_sensor = (V − V_0)/S; T_scaled = code/100
1

Count the levelsFor N = 12, 2^N = 4,096.

2

Find one code stepq = 3.3 V/4,096 = 0.806 mV per code.

3

Convert code to voltageMultiply code by the step: V = code × 3.3/4,096.

4

Undo offset and sensitivityFrom V = 0.5 + 0.01T, subtract 0.5 and divide by 0.01.

5

Try the other contractA scale-by-100 payload simply gives T = code/100.

4. Reproduce the chapter's code 2361

V = 2361 × 3.3/4096 = 1.90 V

The TMP36-style rule gives T = (1.90 − 0.5)/0.01 ≈ 140 °C. The scale-by-100 rule gives T = 2361/100 = 23.6 °C. Rounded as the chapter does, the disagreement is 140 − 23.6 = 117 °C. Both calculations are valid; only the declared contract tells the receiver which one applies. Separately, the chapter's 600 Hz component sampled at 1,000 Hz aliases to 400 Hz, showing another upstream limit that processing cannot undo.

5. Try the same formulas

TryMove the raw code around 2361 and compare the two temperatures produced by two honest but incompatible contracts.

ADC voltage
TMP36-style reading
Scale-by-100 reading
Disagreement

ObserveThe same slider position produces two changing temperatures because each decoder applies a different scale and offset.

ExplainThe outputs use V = code×V_ref/2^N, T = (V−V_0)/S, and T = code/100, the same conversion steps derived above.

Technical boundaries.

The widget compares exactly the chapter's two illustrative contracts.

It does not claim that code 2361 really came from a TMP36 or that 140 °C is valid for a particular installation
Needs separate evidence

Use field evidence or a deeper model before release.

6. What the result buys you

A payload must name schema version, units, scale, offset, signedness, width, byte order, and invalid-value rules. A golden payload should prove that device, gateway, and cloud all decode the same bytes to the same engineering value.

7. Check yourself

1. How many codes does 12 bits provide?

Answer: 2¹² = 4,096 codes, numbered 0 through 4,095.

2. What voltage does code 2361 represent at 3.3 V full scale?

Answer: 2361×3.3/4096 = about 1.90 V.

3. Why can two correct calculations disagree by 117 °C?

Answer: They apply different contracts. The bits alone do not select a scale, offset, or unit.

Honesty boundary.

These are the chapter inputs, worked results, and named teaching assumptions.

Code 2361
Sensor scale, pressure, or digital result
12 bits
Digital resolution or converter setting
4,096 levels
Sensor scale, pressure, or digital result
3.3 V
Voltage or voltage-step value
0.806 mV
Voltage or voltage-step value
1.90 V
Voltage or voltage-step value
the TMP36-style 0.5 V offset
Voltage or voltage-step value
0.01 V/°C sensitivity
Voltage or voltage-step value
140 °C
Temperature or angle value
23.6 °C
Temperature or angle value
117 °C
Temperature or angle value
the separate 600 Hz to 400 Hz alias reproduce the companion chapter
Frequency, sample rate, or event rate

The sensor law is illustrative, not proof of the hardware behind an unknown payload; the chapter's deeper contract and calibration evidence remains required.