As7341
AS7341 10-channel spectral light sensor implementation.
Measures photon flux across 9 spectral bands (415nm to 910nm) using the AMS AS7341 sensor IC. Readings are converted from raw photon counts to flux (photons/s) using the configured integration time.
LightConfidence
¶
Bases: Confidence
Confidence specification for spectral light measurements.
Instead of a simple ± interval, spectral sensors have channel-specific uncertainty expressed as center wavelength variance and full width at half maximum (FWHM).
Attributes:
| Name | Type | Description |
|---|---|---|
center_wavelength_variance |
Uncertainty in peak wavelength (nm). |
|
full_width_half_maximum |
Channel bandwidth at half sensitivity (nm). |
Source code in pt/controller_3/src/plant_controller/sensors/as7341.py
GreenhouseAS7341
¶
Bases: Sensor, I2CInterface
AS7341 spectral light sensor for greenhouse-level measurements.
Reads 9 spectral channels (415nm through 910nm NIR) and reports photon flux in photons/s. Uses 64x gain by default.
This sensor does not use the standard Sensor.init because it reports multiple parameters from a single physical device.
Attributes:
| Name | Type | Description |
|---|---|---|
wrapped_sensor |
The adafruit_as7341.AS7341 driver instance. |
|
time_between_reads |
Interval between measurement cycles (seconds). |
|
integration_time |
Computed integration time per reading (seconds). |
Source code in pt/controller_3/src/plant_controller/sensors/as7341.py
40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 | |
photon_count_to_flux(count)
¶
Convert a raw photon count to flux (photons/s).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
count
|
Raw channel count from the sensor. |
required |
Returns:
| Type | Description |
|---|---|
|
Photon flux in photons per second. |
Source code in pt/controller_3/src/plant_controller/sensors/as7341.py
read()
async
¶
Read all 9 spectral channels and save as Measurements.
Source code in pt/controller_3/src/plant_controller/sensors/as7341.py
83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 | |
get_capabilities()
¶
Return capabilities for all 9 spectral channels.