Build a wireless link budget
Print every path-loss, receive-power, margin and Fresnel calculation before making a bounded radio-placement decision.

Radio Rosa: I want you to inspect every gain and loss before trusting the final margin.
Predict the reading, then compare it with the measurement.
Python 3 in your browser (JupyterLite)
Python · no installOpen the notebook in your browser and run each Python cell; no install or account is needed.
Three ways to run: use JupyterLite here with no install; run main.py locally from the downloadable lab folder; or open the same notebook in Google Colab.
Steps
Step 1
- Do
- In the JupyterLite notebook, run the Step 1 cell to freeze the fictional 868 MHz radio assumptions.
- You will see
- Input: execute notebook step 1 with its stated deterministic fixture. Observed: fictional point-to-point outdoor link Observed: frequency=868 MHz; tx=14 dBm; antenna gains=2+2 dBi Observed: Required design reserve=10 dB; no measured site data is implied.
- Why it matters
- Expected: the model begins with explicit 868 MHz radio and link assumptions. The run uses 14 dBm transmit power, 2+2 dBi gains, and 2 dB cable loss. Stating sensitivity and reserve makes the later margin calculation auditable. Limit: no site measurement is implied.

Step 1 · Python 3 in your browser (JupyterLite); numbered callout added to a real capture. Enlarge screenshot (new tab) Step 2
- Do
- In the JupyterLite notebook, run the Step 2 cell to calculate free-space loss at four distances.
- You will see
- Input: execute notebook step 2 with its stated deterministic fixture. Observed: 10 51.21 Observed: 100 71.21 Observed: 1000 91.21
- Why it matters
- Expected: free-space path loss increases with distance at the fixed 868 MHz frequency. The run gives 51.21 dB at 10 m, 71.21 dB at 100 m, and 91.21 dB at 1 km. These are formula outputs using distance in km and frequency in MHz. Limit: free-space loss omits the local environment.

Step 2 · Python 3 in your browser (JupyterLite); numbered callout added to a real capture. Enlarge screenshot (new tab) Step 3
- Do
- In the JupyterLite notebook, run the Step 3 cell to compare free-space and log-distance models.
- You will see
- Input: execute notebook step 3 with its stated deterministic fixture. Observed: 10 51.21 67.00 15.79 Observed: 100 71.21 94.00 22.79 Observed: 500 85.19 112.87 27.68
- Why it matters
- Expected: the log-distance model produces greater loss than FSPL at these distances. At 500 m the run reports 112.87 dB modeled loss versus 85.19 dB FSPL. The difference is the modelled extra loss under n=2.7 and PL(1 m)=40 dB. Limit: both models use assumptions rather than site data.

Step 3 · Python 3 in your browser (JupyterLite); numbered callout added to a real capture. Enlarge screenshot (new tab) Step 4
- Do
- In the JupyterLite notebook, run the Step 4 cell to build the receive-power and margin ledger.
- You will see
- Input: execute notebook step 4 with its stated deterministic fixture. Observed: 10 67.00 -51.00 69.00 Observed: 500 112.87 -96.87 23.13 Observed: 1000 121.00 -105.00 15.00
- Why it matters
- Expected: received power and margin fall as the modeled path grows. At 1 km the run gives -105.00 dBm and 15.00 dB margin. Margin is calculated against the stated -120 dBm receiver sensitivity. Limit: fading, interference, and implementation losses remain outside this ledger.

Step 4 · Python 3 in your browser (JupyterLite); numbered callout added to a real capture. Enlarge screenshot (new tab) Step 5
- Do
- In the JupyterLite notebook, run the Step 5 cell to calculate midpoint Fresnel clearance.
- You will see
- Input: execute notebook step 5 with its stated deterministic fixture. Observed: 100 1.47 0.88 Observed: 500 3.29 1.97 Observed: 1000 4.65 2.79
- Why it matters
- Expected: the 60% first-zone clearance requirement grows with path length. At 1 km the calculated midpoint radius is 4.65 m and 60% clearance is 2.79 m. This flags a terrain and antenna-height check for a real path. Limit: the model assumes an equal two-leg midpoint path.

Step 5 · Python 3 in your browser (JupyterLite); numbered callout added to a real capture. Enlarge screenshot (new tab) Step 6
- Do
- In the JupyterLite notebook, run the Step 6 cell to compare three sensitivity and data-rate modes.
- You will see
- Input: execute notebook step 6 with its stated deterministic fixture. Observed: LoRa 0.3kbps -137 32.00 Observed: LoRa 5.5kbps -120 15.00 Observed: FSK 50kbps -105 0.00
- Why it matters
- Expected: the three assumed sensitivities produce different 1 km margins. The local run reports 32, 15, and 0 dB for the listed radio modes. The table exposes a sensitivity-versus-data-rate planning trade-off. Limit: airtime cost and actual radio performance are not modeled.

Step 6 · Python 3 in your browser (JupyterLite); numbered callout added to a real capture. Enlarge screenshot (new tab) Step 7
- Do
- In the JupyterLite notebook, run the Step 7 cell to make a bounded placement decision.
- You will see
- Input: execute notebook step 7 with its stated deterministic fixture. Observed: 1 km log-distance margin is below the 10 dB design reserve. Observed: Action: shorten the path or improve placement, then run a measured site survey. Observed: The table is a planning hypothesis, not proof of packet delivery.
- Why it matters
- Expected: the result compares the modeled 1 km margin with the stated 10 dB reserve. Observed: step 4 reports 15.00 dB at 1 km, but this step says that margin is below 10 dB. Interpretation: those local outputs conflict; do not rely on the REVISE message until the decision logic is reconciled. Limit: the planning calculation still needs a measured site survey.

Step 7 · Python 3 in your browser (JupyterLite); numbered callout added to a real capture. Enlarge screenshot (new tab)
Chapter checks
These questions refer to the chapter’s examples. Use the return links to review their answers.
A node has good average signal strength but intermittent packet loss. What should the learner consider?
Return to the chapter’s knowledge checkA sensor reports strong RSSI, but packet retries increase whenever nearby equipment is active. What should you review first?
Return to the chapter’s knowledge check
Return to Wireless Propagation: Fading and Interference · Browse Labs