-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Input Voltage for the TMP sensor, affects the measure scale #273
Comments
Regarding the voltage on R3 and R4 and how the voltage changes from USB input to external Vcc input. Lets review a bit to get a common understanding. RatiometricThe A2D (Analog to Digital) conversion process is of a type called "ratiometric " This means that any change to the reference voltage of the A2D will cause a change in the converted digital value. So if changes to the supply to the MoonRat and therefor the UNO make changes to the Vcc errors will occur in the converted temperature. Programable ReferenceThe Atmega328 has in internal reference from which the A2D can also be referenced. Voltage of TMP36 at <= 50CThe TMP36 data sheet shows a typical output voltage versus temperature Conclusion Factory Calibration Is Probably A RequirementWhile I have not tried to make an error budget and unless someone undertakes the task to do so and can demonstrate that we do not need to do so, I think it is a requirement that we build a factory calibration methodology into our device. Calibration One or Two PointsWe would place the TMP36 sensor into a calibrated temperature environment and then adjust (a multiplicative offset I think) the returned value to report the correct value of the calibrated environment. Calibration and Storing CalibrationWhile I have not tried to work out code details, the Arduino MAP function is probably a very handy way to do this. |
See more about the MAP function here: Note that the function uses integers and truncates and so the numbers fed into it should probably be multiplied by ten before the MAP function and then a floating point divide by ten of the returned value from the MAP would preserve some accuracy. However I am only speculating. |
Arduino UNO R3 and Arduino UNO R4 WiFi default 5 volts pin issue
Here we test just the sensor to verify that the lectures of the temperature were right, the problem surges when we measure with a voltmeter the voltage input that it receives. For the calibration, it is necessary to consider the input voltage to set the correct scale and get good sensing. Then we proceed to make the next proofs.
USB case
The Arduino board is connected to the USB port in the computer and these are the lectures:
R3 ------------------------------------------------------------------
R4 ------------------------------------------------------------------
As we can see the first one which is the Arduino R3 has a better and stable input voltage for the sensor and the Arduino R4 doesn't.
12 Volts Power Supply
The Arduino board is connected to 12 volts, and the voltmeter measures are:
R3 ------------------------------------------------------------------
R4 ------------------------------------------------------------------
In this case, the Arduino which is more confident is the R4.
Solution
We propose adding the next function to the code to detect the Arduino board's real voltage in the 5-volt pin.
The above code "solves" the problem because we can use that real voltage to calibrate the sensor with the current voltage in the 5-volt pin.
But... :(
This code doesn't work in Arduino R4, but the R4 has a more stable voltage when connected to a power supply over 6 volts, its 5-volt pin always has 4.98 volts.
So we propose an #ifdef conditional in the code where if the variables and default functions that measure the voltage in the Arduino board (R3 case) then we can run the above function, if not then we can consider the 4.98 volt to the calibration.
The text was updated successfully, but these errors were encountered: