Gyroscope L3G4200D and problems with thermometer
Morpheus
Posts: 1
Good time of the day!
I bought Parallax Gyroscope Module 3-Axis L3G4200D. Everything works beautifully! However, there is one 'but'. I need the temperature data from the temperature sensor embedded in the gyroscope. I have the code for Arduino and I even obtain the data (t = readI2C(0x26);). But the data itself is not adequate. Namely, the temperature data decreases at heating and increases at cooling.
Which changes do I have to make for the temperature data to be correct?
I bought Parallax Gyroscope Module 3-Axis L3G4200D. Everything works beautifully! However, there is one 'but'. I need the temperature data from the temperature sensor embedded in the gyroscope. I have the code for Arduino and I even obtain the data (t = readI2C(0x26);). But the data itself is not adequate. Namely, the temperature data decreases at heating and increases at cooling.
Which changes do I have to make for the temperature data to be correct?
Comments
I am using the same gyroscope and I am trying to get temperature data from it too
I have noticed the same as you and I was thinking that probably it is correct because in the datasheet, in the table 6, there is the following:
Temperature sensor output change vs. temperature -> -1 °C/digit
I don't know exactly but it may mean that temperature data decreases at heating and increases at cooling (?)
My doubt is instead what temperature data represents. Is it already the temperature celsius value ?
I need temperature data because I am noticing a zero rate level drift that seems caused by temperature change and I want to try to compensate it
do you face a similar drift problem ? do you know by chance the best way to correct it ? I have only the gyroscope on my board, no other device such as accelerometer or magnetometer
thanks
bye
Ste
http://forums.parallax.com/showthread.php?137934-Sample-code-for-temperature-from-Gyroscope-Module-3-Axis-L3G4200D-(-27911)
See post #14.
On the Arduino make sure you store to a char or int type. If 't' is a byte you'll get screwy numbers but that only stores an unsigned byte.
In any case, the temperature reading from this shouldn't be used as a general ambient temperate measurement. That's not what it's for, if that is your intended application. An LM35, as an example, is easier and more accurate (10 bits rather than 8), and directly interfaces to an Arduino analog pin.
-- Gordon
The 25 is not the Temperature it is a Reference number
To Get the Temperature you have to
Subtract the Value in OUT_TEMP(26h) Register From 25
then Add that to 25 Then use it as Deg C or Convert it to Deg F =(Deg C*9/5+32)
Note The Temp is not ambient Temp it is the Sensor Temperature of the chip
which changes negative for positive temp changes because that the direction the Measurements are affected
They increase as temp Decreases so an negative correction is needed.
To Measure Approx Ambient Temp one could add an offset Correction Number to get closer.
Comment the temperature measurement is Sensor Temp not ambient. The following can be used to create something somewhat useful
VAR
Byte STemp, ESTemp
PUB ReadTemp
STemp := Read_1B(OUT_TEMP)
ESTemp := 25 - STemp
ESTemp := ESTemp + 25 - 4 'Deg C the -4 is my correction yours may be different
ESTemp := ESTemp * 9 / 5 +32 'Deg
Not Great but works