node-red-contrib-periph-adc-dac 1.4.0 → 1.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -19,6 +19,8 @@ npm install node-red-contrib-periph-adc-dac
19
19
  | `periph-ad5243` | input | Sets and reads the two 256-position wipers of an AD5243 dual I²C digital potentiometer. Wiper values are volatile: both channels power up at midscale (128). |
20
20
  | `ad5248-device` | config | I²C bus and address for an AD5248 |
21
21
  | `periph-ad5248` | input | Sets or reads the two 256-position wipers of an AD5248 dual digital rheostat over I²C. The device is configured via an ad5248-device config node. |
22
+ | `periph-ad5251` | input | Sets and reads the two 64-position wipers of an AD5251 dual I²C digital potentiometer. Both channels power up from their stored EEMEM value (midscale, 32, until a value is stored). |
23
+ | `periph-ad5252` | input | Sets and reads the two 256-position wipers of an AD5252 dual I²C digital potentiometer. Both channels power up from their stored EEMEM value (midscale, 128, until a value is stored). |
22
24
  | `ad7705-device` | config | Bus configuration for an AD7705 |
23
25
  | `periph-ad7705` | input | Reads voltage from a 2-channel, 16-bit sigma-delta AD7705 ADC over SPI. The driver uses the chip's two-phase register-access protocol and polls DRDY over SPI, so only SCLK/DIN/DOUT/CS are needed (no dedicated DRDY GPIO). |
24
26
  | `ad7706-device` | config | Bus configuration for an AD7706 |
@@ -28,6 +30,11 @@ npm install node-red-contrib-periph-adc-dac
28
30
  | `periph-ads1113` | input | Reads the ADS1113 16-bit ΔΣ ADC (one differential input (AIN0 − AIN1), fixed ±2.048 V) over I²C. Default address is 0x48 ; 0x48 – 0x4B are valid depending on the ADDR strap. |
29
31
  | `periph-ads1114` | input | Reads the ADS1114 16-bit ΔΣ ADC (one differential input (AIN0 − AIN1) with programmable gain) over I²C. Default address is 0x48 ; 0x48 – 0x4B are valid depending on the ADDR strap. |
30
32
  | `periph-ads1115` | input | Reads the ADS1115 16-bit ΔΣ ADC (four single-ended or two differential inputs with programmable gain) over I²C. Default address is 0x48 ; 0x48 – 0x4B are valid depending on the ADDR strap. |
33
+ | `periph-ads7828` | input | Reads the 12-bit, 8-channel ADS7828 ADC over I²C as eight single-ended inputs or four differential pairs. Default address is 0x48 ; 0x48 – 0x4B are valid depending on the A1/A0 straps. With the internal 2.5 V reference the REFIN/REFOUT pin must be decoupled with 0.1 µF and nothing else may drive it. |
34
+ | `periph-cat5171` | input | Sets and reads the 256-position wiper of a CAT5171 I²C digital potentiometer. The wiper is volatile: it powers up at midscale (128). |
35
+ | `periph-cs43l22` | input | Controls a CS43L22 stereo DAC with headphone and speaker amplifiers over its I²C control port. The audio stream (I²S: MCLK, SCLK, LRCK, SDIN) comes from the board and is not handled by this node. Send { start: true } only after MCLK is running. |
36
+ | `periph-ds1881` | input | Controls the two audio log-taper channels of a DS1881 dual digital potentiometer. Attenuation is in dB (0 dB = wiper at H); position 63 (Option 1) or 33 (Option 2) is mute. By default the wipers are volatile and power up at mute. |
37
+ | `periph-ds3502` | input | Sets and reads the 128-position wiper of a DS3502 high-voltage I²C digital potentiometer. Wiper writes go to SRAM only (MODE = 1) and never wear the EEPROM; the wiper powers up at the stored Initial Value Register position (factory default 64, midscale). |
31
38
  | `es8311-device` | config | I²C bus and address for an ES8311 |
32
39
  | `periph-es8311` | input | Controls an ES8311 low-power mono audio codec over its I²C control port. The audio stream itself (I²S) is not handled by this node. |
33
40
  | `periph-hx710a` | input | Reads weight from an HX710A 24-bit ADC connected to a load cell via two GPIO pins. Also exposes the chip's on-chip temperature sensor as a raw ADC code. |
@@ -35,6 +42,7 @@ npm install node-red-contrib-periph-adc-dac
35
42
  | `periph-hx711` | input | Reads weight from an HX711 24-bit ADC connected to a load cell via two GPIO pins. |
36
43
  | `hy3131-device` | config | Bus configuration for a HY3131 |
37
44
  | `periph-hy3131` | input | Reads the AD1 differential input (PB2 vs AGND) of an HY3131 DMM analog front end over SPI. Data-ready is polled via the INTF register, so only CK/DI/DO/CS are needed. |
45
+ | `periph-mcp3422` | input | Reads the two differential inputs of a MCP3422 18-bit delta-sigma ADC (I²C) with a one-shot conversion per channel. Full scale is ±2.048 V / gain; the LSB is 2·2.048 V / 2 bits / gain. |
38
46
  | `mcp4725-device` | config | I²C bus and address for a MCP4725 |
39
47
  | `periph-mcp4725` | output | Sets the output voltage of an MCP4725 12-bit DAC over I²C. |
40
48
  | `mcp4728-device` | config | I²C bus and address for a MCP4728 |
@@ -0,0 +1,117 @@
1
+ [
2
+ {
3
+ "id": "tab-ad5251-demo",
4
+ "type": "tab",
5
+ "label": "AD5251 Wiper Sweep Demo",
6
+ "disabled": false,
7
+ "info": "Two scenarios on one AD5251 dual digital potentiometer with nonvolatile memory. An Inject node ticks every 500 ms into a Function node that sweeps channel 0 through 16 evenly spaced wiper codes (0, 4, ... 60), producing the staircase; the periph-ad5251 node returns {channel, code, resistance} which a Debug node shows. A second Inject node sets channel 1 to a 20 kOhm W-B resistance once and a third reads back both channels."
8
+ },
9
+ {
10
+ "id": "inj-sweep",
11
+ "type": "inject",
12
+ "name": "Sweep tick (500 ms)",
13
+ "topic": "",
14
+ "payload": "",
15
+ "payloadType": "date",
16
+ "repeat": "0.5",
17
+ "crontab": "",
18
+ "once": true,
19
+ "onceDelay": 0.5,
20
+ "z": "tab-ad5251-demo",
21
+ "x": 150,
22
+ "y": 100,
23
+ "wires": [
24
+ [
25
+ "fn-sweep"
26
+ ]
27
+ ]
28
+ },
29
+ {
30
+ "id": "fn-sweep",
31
+ "type": "function",
32
+ "name": "sweep channel 0",
33
+ "func": "// 16 steps of 4 codes: 0, 4, ... 60, then wrap.\nlet i = context.get('step') || 0;\ncontext.set('step', (i + 1) % 16);\nmsg.payload = { channel: 0, code: i * 4 };\nreturn msg;",
34
+ "outputs": 1,
35
+ "noerr": 0,
36
+ "z": "tab-ad5251-demo",
37
+ "x": 350,
38
+ "y": 100,
39
+ "wires": [
40
+ [
41
+ "ad5251-node"
42
+ ]
43
+ ]
44
+ },
45
+ {
46
+ "id": "inj-rheo",
47
+ "type": "inject",
48
+ "name": "Channel 1 = 20 kOhm",
49
+ "topic": "",
50
+ "payload": "{\"channel\":1,\"ohms\":20000}",
51
+ "payloadType": "json",
52
+ "repeat": "",
53
+ "crontab": "",
54
+ "once": false,
55
+ "onceDelay": 0.1,
56
+ "z": "tab-ad5251-demo",
57
+ "x": 160,
58
+ "y": 180,
59
+ "wires": [
60
+ [
61
+ "ad5251-node"
62
+ ]
63
+ ]
64
+ },
65
+ {
66
+ "id": "inj-read",
67
+ "type": "inject",
68
+ "name": "Read both channels",
69
+ "topic": "",
70
+ "payload": "",
71
+ "payloadType": "date",
72
+ "repeat": "",
73
+ "crontab": "",
74
+ "once": false,
75
+ "onceDelay": 0.1,
76
+ "z": "tab-ad5251-demo",
77
+ "x": 160,
78
+ "y": 240,
79
+ "wires": [
80
+ [
81
+ "ad5251-node"
82
+ ]
83
+ ]
84
+ },
85
+ {
86
+ "id": "ad5251-node",
87
+ "type": "periph-ad5251",
88
+ "name": "AD5251",
89
+ "bus": "1",
90
+ "rab": "50000",
91
+ "address": "0x2C",
92
+ "rwiper": "75",
93
+ "z": "tab-ad5251-demo",
94
+ "x": 560,
95
+ "y": 140,
96
+ "wires": [
97
+ [
98
+ "dbg-ad5251"
99
+ ]
100
+ ]
101
+ },
102
+ {
103
+ "id": "dbg-ad5251",
104
+ "type": "debug",
105
+ "name": "wiper / resistance",
106
+ "active": true,
107
+ "tosidebar": true,
108
+ "console": false,
109
+ "tostatus": false,
110
+ "complete": "payload",
111
+ "targetType": "msg",
112
+ "z": "tab-ad5251-demo",
113
+ "x": 780,
114
+ "y": 140,
115
+ "wires": []
116
+ }
117
+ ]
@@ -0,0 +1,117 @@
1
+ [
2
+ {
3
+ "id": "tab-ad5252-demo",
4
+ "type": "tab",
5
+ "label": "AD5252 Wiper Sweep Demo",
6
+ "disabled": false,
7
+ "info": "Two scenarios on one AD5252 dual digital potentiometer with nonvolatile memory. An Inject node ticks every 500 ms into a Function node that sweeps channel 0 through 16 evenly spaced wiper codes (0, 16, ... 240), producing the staircase; the periph-ad5252 node returns {channel, code, resistance} which a Debug node shows. A second Inject node sets channel 1 to a 2.2 kOhm W-B resistance once and a third reads back both channels."
8
+ },
9
+ {
10
+ "id": "inj-sweep",
11
+ "type": "inject",
12
+ "name": "Sweep tick (500 ms)",
13
+ "topic": "",
14
+ "payload": "",
15
+ "payloadType": "date",
16
+ "repeat": "0.5",
17
+ "crontab": "",
18
+ "once": true,
19
+ "onceDelay": 0.5,
20
+ "z": "tab-ad5252-demo",
21
+ "x": 150,
22
+ "y": 100,
23
+ "wires": [
24
+ [
25
+ "fn-sweep"
26
+ ]
27
+ ]
28
+ },
29
+ {
30
+ "id": "fn-sweep",
31
+ "type": "function",
32
+ "name": "sweep channel 0",
33
+ "func": "// 16 steps of 16 codes: 0, 16, ... 240, then wrap.\nlet i = context.get('step') || 0;\ncontext.set('step', (i + 1) % 16);\nmsg.payload = { channel: 0, code: i * 16 };\nreturn msg;",
34
+ "outputs": 1,
35
+ "noerr": 0,
36
+ "z": "tab-ad5252-demo",
37
+ "x": 350,
38
+ "y": 100,
39
+ "wires": [
40
+ [
41
+ "ad5252-node"
42
+ ]
43
+ ]
44
+ },
45
+ {
46
+ "id": "inj-rheo",
47
+ "type": "inject",
48
+ "name": "Channel 1 = 2.2 kOhm",
49
+ "topic": "",
50
+ "payload": "{\"channel\":1,\"ohms\":2200}",
51
+ "payloadType": "json",
52
+ "repeat": "",
53
+ "crontab": "",
54
+ "once": false,
55
+ "onceDelay": 0.1,
56
+ "z": "tab-ad5252-demo",
57
+ "x": 160,
58
+ "y": 180,
59
+ "wires": [
60
+ [
61
+ "ad5252-node"
62
+ ]
63
+ ]
64
+ },
65
+ {
66
+ "id": "inj-read",
67
+ "type": "inject",
68
+ "name": "Read both channels",
69
+ "topic": "",
70
+ "payload": "",
71
+ "payloadType": "date",
72
+ "repeat": "",
73
+ "crontab": "",
74
+ "once": false,
75
+ "onceDelay": 0.1,
76
+ "z": "tab-ad5252-demo",
77
+ "x": 160,
78
+ "y": 240,
79
+ "wires": [
80
+ [
81
+ "ad5252-node"
82
+ ]
83
+ ]
84
+ },
85
+ {
86
+ "id": "ad5252-node",
87
+ "type": "periph-ad5252",
88
+ "name": "AD5252",
89
+ "bus": "1",
90
+ "rab": "10000",
91
+ "address": "0x2C",
92
+ "rwiper": "75",
93
+ "z": "tab-ad5252-demo",
94
+ "x": 560,
95
+ "y": 140,
96
+ "wires": [
97
+ [
98
+ "dbg-ad5252"
99
+ ]
100
+ ]
101
+ },
102
+ {
103
+ "id": "dbg-ad5252",
104
+ "type": "debug",
105
+ "name": "wiper / resistance",
106
+ "active": true,
107
+ "tosidebar": true,
108
+ "console": false,
109
+ "tostatus": false,
110
+ "complete": "payload",
111
+ "targetType": "msg",
112
+ "z": "tab-ad5252-demo",
113
+ "x": 780,
114
+ "y": 140,
115
+ "wires": []
116
+ }
117
+ ]
@@ -0,0 +1,129 @@
1
+ [
2
+ {
3
+ "id": "tab-ads7828-demo",
4
+ "type": "tab",
5
+ "label": "ADS7828 Supply Monitor Demo",
6
+ "disabled": false,
7
+ "info": "Eight-channel supply monitor on an ADS7828 with its internal 2.5 V reference. An Inject node ticks every second into the periph-ads7828 node, which scans CH0-CH7 and returns {channels, raw}. A Function node splits the eight voltages into separate messages with topics ch0 ... ch7 and a Debug node prints them. A second Inject node sends msg.differential = \"0-1\" to read a bridge sensor on CH0/CH1 as a differential pair."
8
+ },
9
+ {
10
+ "id": "inj-scan",
11
+ "type": "inject",
12
+ "name": "Scan every 1 s",
13
+ "topic": "",
14
+ "payload": "",
15
+ "payloadType": "date",
16
+ "repeat": "1",
17
+ "crontab": "",
18
+ "once": true,
19
+ "onceDelay": 0.5,
20
+ "z": "tab-ads7828-demo",
21
+ "x": 150,
22
+ "y": 100,
23
+ "wires": [
24
+ [
25
+ "ads7828-node"
26
+ ]
27
+ ]
28
+ },
29
+ {
30
+ "id": "inj-diff",
31
+ "type": "inject",
32
+ "name": "Pair 0-1",
33
+ "topic": "",
34
+ "payload": "",
35
+ "payloadType": "date",
36
+ "repeat": "",
37
+ "crontab": "",
38
+ "once": false,
39
+ "onceDelay": 0.5,
40
+ "z": "tab-ads7828-demo",
41
+ "x": 150,
42
+ "y": 180,
43
+ "wires": [
44
+ [
45
+ "fn-diff"
46
+ ]
47
+ ]
48
+ },
49
+ {
50
+ "id": "fn-diff",
51
+ "type": "function",
52
+ "name": "differential 0-1",
53
+ "func": "msg.differential = '0-1';\nreturn msg;",
54
+ "outputs": 1,
55
+ "noerr": 0,
56
+ "z": "tab-ads7828-demo",
57
+ "x": 340,
58
+ "y": 180,
59
+ "wires": [
60
+ [
61
+ "ads7828-node"
62
+ ]
63
+ ]
64
+ },
65
+ {
66
+ "id": "ads7828-node",
67
+ "type": "periph-ads7828",
68
+ "name": "ADS7828",
69
+ "bus": "1",
70
+ "address": "0x48",
71
+ "reference": "internal",
72
+ "vref": "5.0",
73
+ "z": "tab-ads7828-demo",
74
+ "x": 560,
75
+ "y": 140,
76
+ "wires": [
77
+ [
78
+ "fn-split",
79
+ "dbg-raw"
80
+ ]
81
+ ]
82
+ },
83
+ {
84
+ "id": "fn-split",
85
+ "type": "function",
86
+ "name": "split channels",
87
+ "func": "if (!msg.payload.channels) return null;\nreturn [msg.payload.channels.map((v, i) => ({ topic: 'ch' + i, payload: v }))];",
88
+ "outputs": 1,
89
+ "noerr": 0,
90
+ "z": "tab-ads7828-demo",
91
+ "x": 780,
92
+ "y": 100,
93
+ "wires": [
94
+ [
95
+ "dbg-ch"
96
+ ]
97
+ ]
98
+ },
99
+ {
100
+ "id": "dbg-ch",
101
+ "type": "debug",
102
+ "name": "channel voltages",
103
+ "active": true,
104
+ "tosidebar": true,
105
+ "console": false,
106
+ "tostatus": false,
107
+ "complete": "payload",
108
+ "targetType": "msg",
109
+ "z": "tab-ads7828-demo",
110
+ "x": 990,
111
+ "y": 100,
112
+ "wires": []
113
+ },
114
+ {
115
+ "id": "dbg-raw",
116
+ "type": "debug",
117
+ "name": "full result",
118
+ "active": true,
119
+ "tosidebar": true,
120
+ "console": false,
121
+ "tostatus": false,
122
+ "complete": "payload",
123
+ "targetType": "msg",
124
+ "z": "tab-ads7828-demo",
125
+ "x": 780,
126
+ "y": 180,
127
+ "wires": []
128
+ }
129
+ ]
@@ -0,0 +1,157 @@
1
+ [
2
+ {
3
+ "id": "tab-cat5171-demo",
4
+ "type": "tab",
5
+ "label": "CAT5171 Wiper Sweep Demo",
6
+ "disabled": false,
7
+ "info": "Two scenarios on one CAT5171 digital potentiometer. An Inject node ticks every 500 ms into a Function node that steps the wiper through 16 evenly spaced codes (0, 16, ... 240), producing the staircase; the periph-cat5171 node returns {code, resistance} which a Debug node shows. A second Inject node sets a 22 kOhm W-B resistance once, a third reads back the wiper, and a fourth and fifth toggle shutdown on and off."
8
+ },
9
+ {
10
+ "id": "inj-sweep",
11
+ "type": "inject",
12
+ "name": "Sweep tick (500 ms)",
13
+ "topic": "",
14
+ "payload": "",
15
+ "payloadType": "date",
16
+ "repeat": "0.5",
17
+ "crontab": "",
18
+ "once": true,
19
+ "onceDelay": 0.5,
20
+ "z": "tab-cat5171-demo",
21
+ "x": 150,
22
+ "y": 100,
23
+ "wires": [
24
+ [
25
+ "fn-sweep"
26
+ ]
27
+ ]
28
+ },
29
+ {
30
+ "id": "fn-sweep",
31
+ "type": "function",
32
+ "name": "sweep wiper",
33
+ "func": "// 16 steps of 16 codes: 0, 16, ... 240, then wrap.\nlet i = context.get('step') || 0;\ncontext.set('step', (i + 1) % 16);\nmsg.payload = { code: i * 16 };\nreturn msg;",
34
+ "outputs": 1,
35
+ "noerr": 0,
36
+ "z": "tab-cat5171-demo",
37
+ "x": 350,
38
+ "y": 100,
39
+ "wires": [
40
+ [
41
+ "cat5171-node"
42
+ ]
43
+ ]
44
+ },
45
+ {
46
+ "id": "inj-rheo",
47
+ "type": "inject",
48
+ "name": "W-B = 22 kOhm",
49
+ "topic": "",
50
+ "payload": "{\"ohms\":22000}",
51
+ "payloadType": "json",
52
+ "repeat": "",
53
+ "crontab": "",
54
+ "once": false,
55
+ "onceDelay": 0.1,
56
+ "z": "tab-cat5171-demo",
57
+ "x": 160,
58
+ "y": 180,
59
+ "wires": [
60
+ [
61
+ "cat5171-node"
62
+ ]
63
+ ]
64
+ },
65
+ {
66
+ "id": "inj-sd-on",
67
+ "type": "inject",
68
+ "name": "Shutdown on",
69
+ "topic": "",
70
+ "payload": "{\"shutdown\":true}",
71
+ "payloadType": "json",
72
+ "repeat": "",
73
+ "crontab": "",
74
+ "once": false,
75
+ "onceDelay": 0.1,
76
+ "z": "tab-cat5171-demo",
77
+ "x": 160,
78
+ "y": 300,
79
+ "wires": [
80
+ [
81
+ "cat5171-node"
82
+ ]
83
+ ]
84
+ },
85
+ {
86
+ "id": "inj-sd-off",
87
+ "type": "inject",
88
+ "name": "Shutdown off",
89
+ "topic": "",
90
+ "payload": "{\"shutdown\":false}",
91
+ "payloadType": "json",
92
+ "repeat": "",
93
+ "crontab": "",
94
+ "once": false,
95
+ "onceDelay": 0.1,
96
+ "z": "tab-cat5171-demo",
97
+ "x": 160,
98
+ "y": 360,
99
+ "wires": [
100
+ [
101
+ "cat5171-node"
102
+ ]
103
+ ]
104
+ },
105
+ {
106
+ "id": "inj-read",
107
+ "type": "inject",
108
+ "name": "Read wiper",
109
+ "topic": "",
110
+ "payload": "",
111
+ "payloadType": "date",
112
+ "repeat": "",
113
+ "crontab": "",
114
+ "once": false,
115
+ "onceDelay": 0.1,
116
+ "z": "tab-cat5171-demo",
117
+ "x": 160,
118
+ "y": 240,
119
+ "wires": [
120
+ [
121
+ "cat5171-node"
122
+ ]
123
+ ]
124
+ },
125
+ {
126
+ "id": "cat5171-node",
127
+ "type": "periph-cat5171",
128
+ "name": "CAT5171",
129
+ "bus": "1",
130
+ "rab": "100000",
131
+ "rwiper": "50",
132
+ "z": "tab-cat5171-demo",
133
+ "x": 560,
134
+ "y": 140,
135
+ "wires": [
136
+ [
137
+ "dbg-cat5171"
138
+ ]
139
+ ],
140
+ "address": "0x2C"
141
+ },
142
+ {
143
+ "id": "dbg-cat5171",
144
+ "type": "debug",
145
+ "name": "wiper / resistance",
146
+ "active": true,
147
+ "tosidebar": true,
148
+ "console": false,
149
+ "tostatus": false,
150
+ "complete": "payload",
151
+ "targetType": "msg",
152
+ "z": "tab-cat5171-demo",
153
+ "x": 780,
154
+ "y": 140,
155
+ "wires": []
156
+ }
157
+ ]