Added extra analogRead() to let ADC cool off #340
Closed
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.
Proposed bug fix for: #334
Summary of bug
Reading multiple analog sensors the same time messes up all readings. For example: the LM35 works fine on its own reporting consistent values but as soon as another analog sensor is added it starts reporting random values between 12 - 50 C°. I tested this with multiple sensors with the same result.
The bug is most likely with the Arduino hardware as I managed to reproduce the issue with a simple two line Arduino sketch.
Test
I tested multiple analog sensors and combinations on a Genuine Arduino UNO and had the same issue all the time. I also tested on a Chinese Arduino NANO which had the same problem.
My proposed solution have fixed issues on both Arduinos
I only noticed at the end that apparently both Arduinos have an ATMEL MEGA 328P on board so it would be great to test the solution on other chips as well but I don't have access to any other boards at the moment.