# Basic Statistics for Sensor Logs

Turn repeated maker readings into a small evidence note: typical value, noise width, suspicious jumps, and what to measure again.

## Outcome
Read a short sensor log and explain mean, median, range, standard deviation, outliers, and moving-average tradeoffs in project terms.

## Safe first step
Keep the raw readings and units before smoothing, deleting, or explaining away a weird value.

## Ladder steps
### 1. Name the measurement
A number is not useful until the unit, sensor, sample rate, and setup are named.

Check: Your note says what was measured and what changed during the sample.

### 2. Find the typical value
Mean or median gives a center to compare against new readings.

Check: You can say whether the value is typical or unusual for this setup.

### 3. Measure the noise width
Range and standard deviation show how much the readings move when the project may be stable.

Check: Your note names the normal wiggle before calling something a signal.

### 4. Mark suspicious jumps
Outliers can be real events, wiring problems, timing issues, or sensor glitches.

Check: Your note marks the jump and names the next repeat check.

### 5. Smooth only after inspection
A moving average can reduce jitter, but it can hide fast changes or add lag.

Check: Your note says what the smoother improved and what it might have hidden.

## Examples
### Spot a suspicious jump
```sh
readings = [22.1, 22.4, 22.2, 28.9, 22.3]
```
Expected signal: 28.9 is not automatically wrong, but it deserves a repeat check

Caution: Do not delete an outlier before explaining why it does not belong.

### Summarize the log before judging it
```sh
mean, median, min, max, range
```
Expected signal: The summary separates center and spread from one dramatic value

Caution: Keep units attached to every number.

### Smooth jitter after reading raw values
```sh
moving_average(window=5)
```
Expected signal: The line gets calmer but reacts more slowly

Caution: Do not smooth away the event you are trying to detect.

## Common traps
- Deleting outliers because they are inconvenient.
- Averaging readings that use different units or setups.
- Publishing a smoothed graph without keeping the raw values.
- Calling noise a trend after one short sample.
- Using a moving average without naming the window size or lag.

## Practice task
Take ten sample readings from a sensor, RSSI sweep, temperature probe, or simulated list. Write the mean, median, min, max, range, one suspicious reading, and the next repeat test.

## Next steps
- Use this before deciding whether an RSSI direction peak is stable.
- Use it before filtering ESP32 or Arduino sensor readings.
- Save the Obsidian note with [[Mean]], [[Median]], [[Standard Deviation]], [[Outlier]], [[Moving Average]], [[Sensor Log]], and [[Raw Data]] backlinks.
- Try interpolation only after the raw readings and noise width make sense.

## Related
- [Applied Data topic group](/topics/data/)
- [Wire a sensor to a microcontroller](/projects/wire-a-sensor-to-microcontroller/)
- [RSSI mapping for direction finding](/learn/rf/rssi-mapping-for-direction-finding/)
- [Stepper antenna sweep for direction finding](/learn/rf/stepper-antenna-sweep-for-direction-finding/)
- [Microcontroller wiring first checks](/learn/microcontroller-wiring-first-checks/)
- [Interpolation for motion and controls](/learn/interpolation-for-motion-and-controls/)
- [Make an Obsidian project note](/learn/make-an-obsidian-project-note/)
- [Electronics and controls](/topics/electronics/)

## Obsidian backlinks

Use these wiki links to connect this note inside a local maker vault:

- [[TopicLadder]]
- [[Maker Learning]]
- [[Basic Statistics for Sensor Logs]]
- [[Applied Data]]
- [[data]]
- [[applied-foundation]]
- [[Name the measurement]]
- [[Find the typical value]]
- [[Measure the noise width]]
- [[Mark suspicious jumps]]
- [[Applied Data topic group]]
- [[Wire a sensor to a microcontroller]]

## Source and next routes

Source: https://topicladder.com/learn/data/basic-statistics-for-sensor-logs/

- [Applied Data topic group](/topics/data/)
- [Wire a sensor to a microcontroller](/projects/wire-a-sensor-to-microcontroller/)
- [RSSI mapping for direction finding](/learn/rf/rssi-mapping-for-direction-finding/)
- [Stepper antenna sweep for direction finding](/learn/rf/stepper-antenna-sweep-for-direction-finding/)
- [Microcontroller wiring first checks](/learn/microcontroller-wiring-first-checks/)
- [Interpolation for motion and controls](/learn/interpolation-for-motion-and-controls/)
- [Make an Obsidian project note](/learn/make-an-obsidian-project-note/)
- [Electronics and controls](/topics/electronics/)
