user23656: 

I have a L3G4200D (GY-50 model) gyroscope. I have been  trying to learn how a gyro sensor works. The circuit diagram is attached. I want to ask some questions;
a) According to the datasheet of L3G4200D,
    x_lsb and x_msb  (28h and 29h),
    y_lsb ,y_msb     (2Ah and 2Bh),
    z_lsb , z_msb    (2Ch and 2Dh) as  shown in the picture 3.
But according to code that in the picture first, Arduino requests bytes from 168 address of gyro (in the picture, the mark number is 1).
But, 0x28 (hex) stands for b00101000 .
What's wrong with it ? 
b) Output of gyro is outputs degrees/second, is it correct? 
c) In the picture 2, I did not move it, as it shown its results change, how can the angle change? It must be zero when it does not move. 
d) In the picture 1, what I should calculate: highbyte*256+lowbyte ? 
e) What does Fs=250,500,2000 dps mean? I know that Dps stands for Degree Per Second. But what would change by FS range, I mean if I pick either 500 or 2000 ? 

user23654: According to the datasheet, FS seems to be Measurement Range. Also, I think you will find useful information in the following discussions: Understanding the sensitivity of an L3G4200D gyroscope and in How do I get gyro sensor data (L3G4200D) into degrees/sec? Due to the fact that the gyro is 16 bit, the range of values would be 2^16, what makes 65536. So, the values on your screen are between -65536/2 and +65536/2, that's why max. values that you see are around 32000.   There is always very tiny motion that the sensor can detect due to vibrations and etc. So, you should not expect the output of gyro to be a set of constants. Ideally, you should combine the data, lets say for 1 second, and find RMS value(average it) to get the result, don't look just for few instances/samples. Also I should note that if there is ultrasound in the gyro environment, it might also cause wrong results. When outer frequencies coincide with the natural frequency of the gyro system, it leads to resonance and distorted data. This paper has explanation of this phenomenon among with other impacts to the gyroscope. 

user4143: 
According to the datasheet of L3G4200D, x_lsb and x_msb (28h and 29h), y_lsb ,y_msb (2Ah and 2Bh), z_lsb , z_msb (2Ch and 2Dh) as shown in the picture 3. But according to code that in the picture first, arduino requests biytes from 168 adress of gyro(in the pciture ,mark number is 1). But , 0x28 (hex) stands for b00101000 . what's wrong with it ?

168 is, in hex, 0xA8.  That's 0x28 with the MSB set. Why? Well, the datasheet says:

In order to read multiple bytes, it is necessary to assert the most significant bit of the subaddress
  field. In other words, SUB(7) must be equal to 1, while SUB(6-0) represents the
  address of the first register to be read.

So address 0xA8 is the same as address 0x28 plus the instruction "I want to read multiple bytes".

Output of gyro is outputs degrees/second ,is it correct ?

Kind of. The number is actually a representation of the fraction of FS. See below.

in the picture 1,what I should calculate hightbyte*256+lowbyte ?

That is turning two 8-bit values into a single 16-bit value. It's easier to represent it using bit shifts:
(bighbyte << 8) | lowbyte

That is, the high byte is shifted left 8 bits and the low byte is then ORed over the lower (zero) 8 bits.

What does Fs=250,500,2000 dps mean ? I know that Dps stands for Degree Per Second .But what would change by FS range ,I mean if I pick either 500 or 2000 ?

That is the "Full Scale" value. It defines what the raw numbers from the gyro actually mean.  The gyro returns -32768 to +32767. -32768 is -FS, +32767 is +FS. So if the FS is set to 500 degrees per second then:

-32768 is -500 degrees per second
+32767 is +500 degrees per second

The simple formula is (using floating point maths):
DPS = Reading / 32768.0 * FS
The format is more commonly known as Q15 where a 16-bit value is split into 3 parts - a sign bit (bit 15), an integer part (there isn't one in this case), and 15 bits (14-0) of fraction. So the number actually represents, in Q15 format, between -1 and +1 in 65536 steps of 1/65536. That number is then multiplied by the full scale value, just like you would a percentage, to get the real DPS value.

23656: <p><a href="https://i.stack.imgur.com/Tvs16.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Tvs16.png" alt="enter image description here"></a></p>

<p><a href="https://i.stack.imgur.com/1ocVG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/1ocVG.png" alt="enter image description here"></a></p>

<p>I have a L3G4200D (GY-50 model) gyroscope. I have been  trying to learn how a gyro sensor works. The circuit diagram is attached. I want to ask some questions;</p>

<p>a) According to the datasheet of L3G4200D,
    x_lsb and x_msb  (28h and 29h),
    y_lsb ,y_msb     (2Ah and 2Bh),
    z_lsb , z_msb    (2Ch and 2Dh) as  shown in the picture 3.
But according to code that in the picture first, Arduino requests bytes from 168 address of gyro (in the picture, the mark number is 1).
But, 0x28 (hex) stands for b00101000 .
What's wrong with it ? </p>

<p>b) Output of gyro is outputs degrees/second, is it correct? </p>

<p>c) In the picture 2, I did not move it, as it shown its results change, how can the angle change? It must be zero when it does not move. </p>

<p>d) In the picture 1, what I should calculate: highbyte*256+lowbyte ? </p>

<p>e) What does Fs=250,500,2000 dps mean? I know that Dps stands for Degree Per Second. But what would change by FS range, I mean if I pick either 500 or 2000 ? </p>
 23654: <p>According to the <a href="http://www.st.com/content/ccc/resource/technical/document/datasheet/04/46/d6/00/be/d9/46/ae/CD00265057.pdf/files/CD00265057.pdf/jcr:content/translations/en.CD00265057.pdf" rel="nofollow noreferrer">datasheet</a>, FS seems to be Measurement Range. Also, I think you will find useful information in the following discussions: <a href="https://electronics.stackexchange.com/questions/56234/understanding-the-sensitivity-of-an-l3g4200d-gyroscope">Understanding the sensitivity of an L3G4200D gyroscope</a> and in <a href="https://electronics.stackexchange.com/questions/39024/how-do-i-get-gyro-sensor-data-l3g4200d-into-degrees-sec">How do I get gyro sensor data (L3G4200D) into degrees/sec?</a> Due to the fact that the gyro is 16 bit, the range of values would be 2^16, what makes 65536. So, the values on your screen are between -65536/2 and +65536/2, that's why max. values that you see are around 32000. <br> <br> There is always very tiny motion that the sensor can detect due to vibrations and etc. So, you should not expect the output of gyro to be a set of constants. Ideally, you should combine the data, lets say for 1 second, and find RMS value(average it) to get the result, don't look just for few instances/samples. <br><br>Also I should note that if there is ultrasound in the gyro environment, it might also cause wrong results. When outer frequencies coincide with the natural frequency of the gyro system, it leads to resonance and distorted data. This <a href="http://link.springer.com/article/10.1134/S2075108713030048#/page-1" rel="nofollow noreferrer">paper</a> has explanation of this phenomenon among with other impacts to the gyroscope. </p>
 4143: <blockquote>
  <p>According to the datasheet of L3G4200D, x_lsb and x_msb (28h and 29h), y_lsb ,y_msb (2Ah and 2Bh), z_lsb , z_msb (2Ch and 2Dh) as shown in the picture 3. But according to code that in the picture first, arduino requests biytes from 168 adress of gyro(in the pciture ,mark number is 1). But , 0x28 (hex) stands for b00101000 . what's wrong with it ?</p>
</blockquote>

<p>168 is, in hex, 0xA8.  That's 0x28 with the MSB set. Why? Well, the datasheet says:</p>

<blockquote>
  <p>In order to read multiple bytes, it is necessary to assert the most significant bit of the subaddress
  field. In other words, SUB(7) must be equal to 1, while SUB(6-0) represents the
  address of the first register to be read.</p>
</blockquote>

<p>So address 0xA8 is the same as address 0x28 plus the instruction "I want to read multiple bytes".</p>

<blockquote>
  <p>Output of gyro is outputs degrees/second ,is it correct ?</p>
</blockquote>

<p>Kind of. The number is actually a representation of the fraction of FS. See below.</p>

<blockquote>
  <p>in the picture 1,what I should calculate hightbyte*256+lowbyte ?</p>
</blockquote>

<p>That is turning two 8-bit values into a single 16-bit value. It's easier to represent it using bit shifts:</p>

<pre><code>(bighbyte &lt;&lt; 8) | lowbyte
</code></pre>

<p>That is, the high byte is shifted left 8 bits and the low byte is then ORed over the lower (zero) 8 bits.</p>

<blockquote>
  <p>What does Fs=250,500,2000 dps mean ? I know that Dps stands for Degree Per Second .But what would change by FS range ,I mean if I pick either 500 or 2000 ?</p>
</blockquote>

<p>That is the "Full Scale" value. It defines what the raw numbers from the gyro actually mean.  The gyro returns -32768 to +32767. -32768 is -FS, +32767 is +FS. So if the FS is set to 500 degrees per second then:</p>

<ul>
<li>-32768 is -500 degrees per second</li>
<li>+32767 is +500 degrees per second</li>
</ul>

<p>The simple formula is (using floating point maths):</p>

<p>DPS = Reading / 32768.0 * FS</p>

<p>The format is more commonly known as <em>Q15</em> where a 16-bit value is split into 3 parts - a sign bit (bit 15), an integer part (there isn't one in this case), and 15 bits (14-0) of fraction. So the number actually represents, in Q15 format, between -1 and +1 in 65536 steps of 1/65536. That number is then multiplied by the full scale value, just like you would a percentage, to get the real DPS value.</p>
