Skip to content

Commit 8178cb0

Browse files
markodracacoderabbitai[bot]swoboda1337
authored
[mcp3204] differential mode support (#5634)
* Update mcp3204.md with diff mode from This PR adds documentation for the new differential mode feature for the MCP3204/MCP3208 ADC components. * Update content/components/sensor/mcp3204.md Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update content/components/sensor/mcp3204.md Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Update content/components/sensor/mcp3204.md Channels typo Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> * Clean up --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Co-authored-by: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com>
1 parent 87d6be1 commit 8178cb0

File tree

1 file changed

+32
-3
lines changed

1 file changed

+32
-3
lines changed

content/components/sensor/mcp3204.md

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,19 +58,48 @@ sensor:
5858
id: solar_voltage
5959
number: 0 # MCP3204 pin number
6060
61-
# In case MCP3208 is used. you can specify pin number > 4
61+
# In case MCP3208 is used, you can specify pin number > 4
6262
- platform: mcp3204 # Attached to pin 7 of the MCP3208.
6363
id: supply_voltage
6464
number: 7 # MCP3208 pin number
65+
66+
# Measures difference between CH0 (IN+) and CH1 (IN-)
67+
- platform: mcp3204 # Differential pair on pins 0-1.
68+
id: thermocouple_voltage
69+
number: 0
70+
diff_mode: true
6571
```
6672

6773
### Configuration variables
6874

6975
- **mcp3204_id** (**Required**, [ID](/guides/configuration-types#id)): The id of the parent MCP3204 component.
70-
- **number** (**Required**, int): The pin number of the MCP3204
71-
- **update_interval** (*Optional*, [Time](/guides/configuration-types#time)): The interval to check the sensor. Defaults to `60s`.
76+
- **number** (**Required**, int): The pin to measure on the MCP3204/MCP3208
77+
- **update_interval** (*Optional*, [Time](/guides/configuration-types#time)): The interval to check the sensor.
78+
Defaults to `60s`.
79+
- **diff_mode** (*Optional*, boolean): Enable differential mode measurement. Defaults to `false`.
7280
- All other options from [Sensor](/components/sensor).
7381

82+
## Operating Modes
83+
84+
The MCP3204/3208 supports two input configurations:
85+
86+
### Single-Ended Mode (default)
87+
88+
Each channel measures voltage independently relative to ground. The MCP3204 provides 4 channels,
89+
and MCP3208 provides 8 channels. This is the default operating mode when `diff_mode` is not
90+
specified or set to `false`.
91+
92+
### Differential Mode
93+
94+
When `diff_mode: true`, channel pairs measure the voltage difference between two inputs (IN+ and
95+
IN-). Specify the positive input channel number with the `number` parameter. The next sequential
96+
channel automatically becomes the negative input (IN-).
97+
98+
Available differential pairs:
99+
100+
- MCP3204: 2 pairs (CH0/CH1, CH2/CH3)
101+
- MCP3208: 4 pairs (CH0/CH1, CH2/CH3, CH4/CH5, CH6/CH7)
102+
74103
## See Also
75104

76105
- [SPI Bus](/components/spi)

0 commit comments

Comments
 (0)