Repository navigation
Decode Verisense SR68/SR61 GSR against its 0.4986 V amplifier reference - #312
Merged
Merged
Conversation
The SR68 and SR61-5/6 GSR front end biases its amplifier from a 261k/100k divider off the 1.8 V rail: 1.8 x 100 / 361 = 0.4986 V, confirmed by the hardware designer, and the same on every Verisense revision that has the front end. The decode divided by the Shimmer3's 0.5 V instead, so every resistance read about 0.5-1% high (a real 2.7 MOhm load, DEV-793 B4d, read 2778 kOhm rather than 2758) and an open circuit about 4.0 GOhm rather than 541 MOhm. The C# API and the web SDK already divide by 0.4986 V. SensorGSR gains a per-front-end amplifier reference beside the resistors and the open-circuit limit, defaulting to 0.5 V; SensorGSRVerisense sets the divider value for the SR68 and SR61. The static decode methods keep their signatures, at 0.5 V, and gain overloads that take the reference, so the Shimmer3, ShimmerGQ and SR62 paths, and outside callers such as the GQ emulator in Shimmer-Advance-API, are unchanged. The range-3 open-circuit limit stays 1138, the value the C# API and the web SDK use. It clears the corrected reference (code 1134.3), and the codes it now also moves, 1135-1137, decode to 0.7-3.0 GOhm, an open circuit either way. API_00015 and API_00019 are updated for that, and API_00015 gains a check on the reference and on the B4d load. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Base automatically changed from
DEV-1070_gsr_below_reference_reads_open
to
master
October 1, 2026 05:24
JongChern
self-requested a review
October 1, 2026 05:45
Contributor
|
ok looks good |
JongChern
approved these changes
Oct 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #307 (DEV-1070), which is stacked on #305 (DEV-1067). It targets the DEV-1070 branch, so the diff is this change only.
Explainer: before/after charts for DEV-1067, DEV-1068 and DEV-1070, the sibling PRs, and the GSR resistor table per hardware model: https://claude.ai/artifact/6hDc2Ue9hdF8gcUDZXzFts (Shimmer sign-in)
Problem
The Verisense SR68 and SR61-5/6 GSR front end biases its amplifier from a 261k/100k divider off the 1.8 V rail: 1.8 × 100 / 361 = 0.4986 V. The hardware designer confirmed the divider, and it is the same on every Verisense revision that has this front end. The decode divided by the Shimmer3's 0.5 V instead.
Fix
SensorGSRgains a per-front-end amplifier reference,currentGsrAmplifierRefVoltage, beside the resistors and the open-circuit limit. It defaults toGSR_AMPLIFIER_REF_VOLTAGE(0.5 V).SensorGSRVerisensesetsVERISENSE_PULSE_PLUS_GSR_AMPLIFIER_REF_VOLTAGE(the divider value) for the SR68 and the SR61, the same place it sets their resistors.calibrateGsrDataToKOhmsUsingAmplifierEq,calibrateGsrDataToKOhmsWithOpenCircuitLimitanduncalibrateGsrDataTokOhmsUsingAmplifierEqkeep their signatures, at 0.5 V, and gain overloads that take the reference. The Shimmer3, ShimmerGQ and SR62 paths are unchanged, and so are outside callers: the only one found is Shimmer-Advance-API'sEmulatorShimmerGq, which uses Shimmer3 values.Tests
API_00015test005API_00015test006 (new)API_00015test007 (new)API_00019test002setCurrentGsrAmplifierRefVoltageline removedCI builds only
ShimmerDriverPC, so it will not run these tests. They were run locally.After merge
VerisenseFileParserPC.jargets this only when re-vendored.Sibling APIs
None need this change:
ShimmerBLEAPI/Sensors/SensorGSR.cs) and ASM_BaseStation (bothSensorGSRcopies): already 0.4986 V.SensorADC): already 0.4986 V.🤖 Generated with Claude Code