WiFi Signal Strength Monitor¶
Monitor WiFi signal strength (RSSI) on Raspberry Pi Pico W.
Overview¶
This example continuously monitors WiFi signal strength and displays it with quality classifications and visual bars.
Source Code¶
File: src/pico_scripts/03_wifi_signal_monitor.py
Features¶
- Real-time RSSI measurement
- Signal quality classification
- Percentage conversion
- Visual bar graph display
- Average signal calculation
- Console output
Hardware Requirements¶
- Raspberry Pi Pico W
- WiFi network (2.4 GHz)
Signal Strength Reference¶
| RSSI (dBm) | Quality | Description |
|---|---|---|
| -30 to -50 | Excellent | Best possible signal |
| -50 to -60 | Good | Very reliable |
| -60 to -70 | Fair | Acceptable |
| -70 to -80 | Weak | May have issues |
| -80 to -90 | Very Weak | Poor connection |
| Below -90 | Unusable | Connection problems |
Configuration¶
Code Explanation¶
Get Signal Strength¶
Classify Signal¶
def classify_signal(rssi):
if rssi >= -50:
return "Excellent"
elif rssi >= -60:
return "Good"
elif rssi >= -70:
return "Fair"
elif rssi >= -80:
return "Weak"
else:
return "Very Weak"
Visual Bar¶
def create_signal_bar(percentage, bar_length=20):
filled = int((percentage / 100) * bar_length)
bar = "█" * filled + "░" * (bar_length - filled)
return f"[{bar}]"
Expected Output¶
WiFi Signal Strength Monitor
============================================================
Press Ctrl+C to stop
Sample #1
Signal Strength: -55 dBm
Quality: Good
Percentage: 64%
Visual: [████████████████░░░░]
Average RSSI: -55.0 dBm
Sample #2
Signal Strength: -58 dBm
Quality: Good
Percentage: 60%
Visual: [████████████░░░░░░░░]
Average RSSI: -56.5 dBm
Usage¶
- Edit WiFi credentials
- Upload to Pico
- Run the script
- Watch signal strength updates
- Press Ctrl+C to stop
Interpreting Results¶
Good Signal (-50 to -60 dBm)¶
- Stable connection
- Fast data transfer
- Suitable for all applications
Fair Signal (-60 to -70 dBm)¶
- Generally reliable
- May have occasional issues
- Good for most uses
Weak Signal (below -70 dBm)¶
- Unstable connection
- Slow speeds
- Move closer to router
Improving Signal¶
- Move Closer - Reduce distance to router
- Remove Obstacles - Clear line of sight
- Change Channel - Reduce interference
- Use External Antenna - If supported
Next Steps¶
- Signal to Blink - Convert to LED frequency
- WiFi Connection - Basic connection
Reference¶
Full source: src/pico_scripts/03_wifi_signal_monitor.py