Skip to content

Conversation

@markodraca
Copy link

This PR adds documentation for the new differential mode feature for the MCP3204/MCP3208 ADC components.

Description:

This PR adds documentation for the new differential mode feature for the MCP3204/MCP3208 ADC components. Differential mode allows the chip to measure the voltage difference between two analog input pins, rather than measuring a single pin's voltage relative to ground. This is useful for applications requiring precise measurements of small voltage differences, noise rejection in sensor readings.

Related issue (if applicable): fixes

Pull request in esphome with YAML changes (if applicable):

Checklist:

  • I am merging into next because this is new documentation that has a matching pull-request in esphome as linked above.
    or

  • I am merging into current because this is a fix, change and/or adjustment in the current documentation and is not for a new component or feature.

  • Link added in /components/index.rst when creating new documents for new components or cookbook.

New Component Images

If you are adding a new component to ESPHome, you can automatically generate a standardized black and white component name image for the documentation.

To generate a component image:

  1. Comment on this pull request with the following command, replacing COMPONENT_NAME with your component name in UPPER_CASE format with underscores (e.g., BME280, SHT3X, DALLAS_TEMP):

    @esphomebot generate image COMPONENT_NAME
    
  2. The ESPHome bot will respond with a downloadable ZIP file containing the SVG image.

  3. Extract the SVG file and place it in the images/ folder of this repository.

  4. Use the image in your component's index table entry in /components/index.rst.

Example: For a component called "DHT22 Temperature Sensor", use:

@esphomebot generate image DHT22

This PR adds documentation for the new differential mode feature for the MCP3204/MCP3208 ADC components.
esphome[bot]
esphome bot previously requested changes Nov 17, 2025
Copy link

@esphome esphome bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this is a feature matched with a PR in https://github.com/esphome/esphome, please target your PR to the next branch and rebase.

@esphome
Copy link

esphome bot commented Nov 17, 2025

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@esphome esphome bot marked this pull request as draft November 17, 2025 14:06
@markodraca markodraca mentioned this pull request Nov 17, 2025
3 tasks
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 17, 2025

Walkthrough

Adds documentation and configuration for differential measurements on the MCP3204 sensor: introduces a thermocouple_voltage example using diff_mode, documents a new diff_mode boolean option, and adds an "Operating Modes" section describing single-ended and differential channel pairings for MCP3204 and MCP3208.

Changes

Cohort / File(s) Summary
MCP3204 sensor documentation
content/components/sensor/mcp3204.md
Adds a thermocouple_voltage differential sensor example (diff_mode: true, number: 0); documents diff_mode (optional boolean, default false); expands number description to reference MCP3204/MCP3208 contexts; adds an "Operating Modes" section explaining Single-Ended and Differential modes and pairing rules (MCP3204: CH0/CH1, CH2/CH3; MCP3208: CH0/CH1, CH2/CH3, CH4/CH5, CH6/CH7); updates See Also to include SPI context and an mcp3204 API reference.

Sequence Diagram(s)

(omitted — changes are documentation-only, no control-flow modifications)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Verify differential channel pair mappings for MCP3204 and MCP3208.
  • Check example configuration syntax and diff_mode description/default.
  • Confirm See Also references and any cross-links are correct.

Suggested labels

next

Suggested reviewers

  • jesserockz

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description check ✅ Passed The description provides clear context about the differential mode feature and its purpose, directly relating to the documentation changes made in the pull request.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Title check ✅ Passed The title '[mcp3204] differential mode support' directly and concisely summarizes the main change: adding differential mode support to the MCP3204 component documentation.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions:
    | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context.
    Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 22faa44 and 673f7d0.

📒 Files selected for processing (1)
  • content/components/sensor/mcp3204.md (1 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**

⚙️ CodeRabbit configuration file

  • Do not generate or add any sequence diagrams

Files:

  • content/components/sensor/mcp3204.md
🧠 Learnings (1)
📓 Common learnings
Learnt from: CR
Repo: esphome/esphome-docs PR: 0
File: .github/copilot-instructions.md:0-0
Timestamp: 2025-08-24T00:13:13.459Z
Learning: Open pull requests against the correct base branch: use `current` for documentation-only revisions and `next` for changes tied to new features in esphome/esphome
Learnt from: jesserockz
Repo: esphome/esphome-docs PR: 4865
File: .github/workflows/needs-docs.yml:0-0
Timestamp: 2025-05-01T03:29:47.922Z
Learning: In the esphome-docs repository, the "current" label is automatically added by a bot to pull requests, making it a reliable indicator for the target branch.
🪛 GitHub Check: Lint
content/components/sensor/mcp3204.md

[failure] 94-94:
Lists should be surrounded by blank lines [Context: "- MCP3204: 2 pairs (CH0/CH1, C..."]

🪛 LanguageTool
content/components/sensor/mcp3204.md

[style] ~76-~76: This phrase is redundant (‘N’ stands for ‘number’). Consider using “pin”.
Context: .... - number (Required, int): The pin number of the MCP3204 - update_interval (*...

(PIN_NUMBER)

⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Build
🔇 Additional comments (1)
content/components/sensor/mcp3204.md (1)

81-92: Clear and well-documented Operating Modes section.

The new section effectively explains the single-ended and differential operating modes, with proper context about channel pairing. The documentation accurately reflects how the diff_mode parameter and number parameter interact.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
esphome[bot]
esphome bot previously requested changes Nov 17, 2025
Copy link

@esphome esphome bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this is a feature matched with a PR in https://github.com/esphome/esphome, please target your PR to the next branch and rebase.

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
esphome[bot]
esphome bot previously requested changes Nov 17, 2025
Copy link

@esphome esphome bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this is a feature matched with a PR in https://github.com/esphome/esphome, please target your PR to the next branch and rebase.

@netlify
Copy link

netlify bot commented Nov 17, 2025

Deploy Preview for esphome ready!

Name Link
🔨 Latest commit 673f7d0
🔍 Latest deploy log https://app.netlify.com/projects/esphome/deploys/691b2bf040aa56000816a500
😎 Deploy Preview https://deploy-preview-5634--esphome.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link

netlify bot commented Nov 17, 2025

Deploy Preview for esphome ready!

Name Link
🔨 Latest commit 11459cb
🔍 Latest deploy log https://app.netlify.com/projects/esphome/deploys/691b3a5e64388d0008741989
😎 Deploy Preview https://deploy-preview-5634--esphome.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@markodraca
Copy link
Author

Documentation, mcp3204 with diff mode

@markodraca markodraca marked this pull request as ready for review November 17, 2025 14:16
@esphome esphome bot dismissed stale reviews from themself November 17, 2025 14:16

Stale

Channels typo

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
esphome[bot]
esphome bot previously requested changes Nov 17, 2025
Copy link

@esphome esphome bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this is a feature matched with a PR in https://github.com/esphome/esphome, please target your PR to the next branch and rebase.

@esphome esphome bot marked this pull request as draft November 17, 2025 15:08
@markodraca markodraca marked this pull request as ready for review November 17, 2025 15:14
@esphome esphome bot dismissed their stale review November 17, 2025 15:14

Stale

@swoboda1337 swoboda1337 changed the base branch from current to next November 17, 2025 22:01
@esphome esphome bot added next and removed wrong-base-branch labels Nov 17, 2025
@esphome esphome bot removed the current label Nov 17, 2025
@swoboda1337 swoboda1337 changed the title Documentation update, mcp3204 with diff mode [mcp3204] differential mode support Nov 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant