Gyroscope

I am having a heck of a time trying to get my L3GD20h to display any raw data. I am pretty sure it is wired correctly, but my code isn't working, and I have the library installed. I tried to keep it as simple as possible.

If anyone knows why or has any information that might be relevant, I would appreciate it.

PS, if this is in the wrong subforum, someone please move me.

#include <Wire.h> 
#include <Adafruit_L3GD20.h>

// Comment this next line to use SPI
#define USE_I2C


  // The default constructor uses I2C
  Adafruit_L3GD20 gyro;



void setup() 
{
  Serial.begin(9600);
 
}

void loop() 
{
  gyro.read();
  Serial.print("X: "); Serial.print((int)gyro.data.x);   Serial.print(" ");
  Serial.print("Y: "); Serial.print((int)gyro.data.y);   Serial.print(" ");
  Serial.print("Z: "); Serial.println((int)gyro.data.z); Serial.print(" ");
}

I am having a heck of a time trying to get my L3GD20h to display any raw data.

I've never had any luck getting a gyroscope to display any data, either.

I am pretty sure it is wired correctly

So sure, in fact, that you didn't think it necessary to include a schematic. Well, I'm equally certain that it is NOT wired correctly. If it was, you'd be getting some kind of data, reasonable or not, from it.

Did you read the guide at all:

PaulS:
I've never had any luck getting a gyroscope to display any data, either.
So sure, in fact, that you didn't think it necessary to include a schematic. Well, I'm equally certain that it is NOT wired correctly. If it was, you'd be getting some kind of data, reasonable or not, from it.

SCL is connected to A5
SDA is connected to A4
GND is to GND
Vin is to 3.3V

Dan95:
Did you read the guide at all:
Arduino | Adafruit Triple Axis Gyro Breakout | Adafruit Learning System

Yes, that is where some of the code came from actually.

To determine if the hardware is working/wired correctly, run the I2C scanner sketch.

// I2C Scanner
// Written by Nick Gammon
// Date: 20th April 2011

#include <Wire.h>

void setup()
{
  Serial.begin (115200);

  Serial.println ();
  Serial.println ("I2C scanner. Scanning ...");
  byte count = 0;

  Wire.begin();
  for (byte i = 8; i < 120; i++)
  {
    Serial.print("Checking address: 0x");
    Serial.println(i, HEX);
    
    Wire.beginTransmission (i);
    if (Wire.endTransmission () == 0)
    {
      Serial.print ("Found address: ");
      Serial.print (i, DEC);
      Serial.print (" (0x");
      Serial.print (i, HEX);
      Serial.println (")");
      count++;
      delay (1);  // maybe unneeded?
    } // end of good response
  } // end of for loop
  Serial.println ("Done.");
  Serial.print ("Found ");
  Serial.print (count, DEC);
  Serial.println (" device(s).");
}  // end of setup

void loop()
{
}

PaulS:
To determine if the hardware is working/wired correctly, run the I2C scanner sketch.

// I2C Scanner

// Written by Nick Gammon
// Date: 20th April 2011

#include <Wire.h>

void setup()
{
  Serial.begin (115200);

Serial.println ();
  Serial.println ("I2C scanner. Scanning ...");
  byte count = 0;

Wire.begin();
  for (byte i = 8; i < 120; i++)
  {
    Serial.print("Checking address: 0x");
    Serial.println(i, HEX);
   
    Wire.beginTransmission (i);
    if (Wire.endTransmission () == 0)
    {
      Serial.print ("Found address: ");
      Serial.print (i, DEC);
      Serial.print (" (0x");
      Serial.print (i, HEX);
      Serial.println (")");
      count++;
      delay (1);  // maybe unneeded?
    } // end of good response
  } // end of for loop
  Serial.println ("Done.");
  Serial.print ("Found ");
  Serial.print (count, DEC);
  Serial.println (" device(s).");
}  // end of setup

void loop()
{
}

Found 0 devices, well there is our problem. Hmm, now to fix it.

Hmm, now to fix it.

Check your soldering. Make sure that there are no bridges or poor joints. Make certain that the wiring matches the picture. Try another I2C device, such as an RTC, to make sure that the pins are good (undamaged).

PaulS:
Check your soldering. Make sure that there are no bridges or poor joints. Make certain that the wiring matches the picture. Try another I2C device, such as an RTC, to make sure that the pins are good (undamaged).

I don't think I have another RTC device, and it's not soddered, I am just using jumpers right now.

it's not soddered, I am just using jumpers right now.

So, there is a good chance that you are not making a good connection.

I see, so I am guessing I should probably just solder it. I have attached two pictures of the current setup.

The wires going to the Arduino are fine. The gyro board appears to have headers soldered on. It's hard to tell if the header pins extend below the gyro board, into the breadboard. If not, then you are not actually connecting power and ground to the gyro board. If they do, then everything is soldered, assuming that the headers are not just pushed through the holes in the gyro board.

PaulS:
The wires going to the Arduino are fine. The gyro board appears to have headers soldered on. It's hard to tell if the header pins extend below the gyro board, into the breadboard. If not, then you are not actually connecting power and ground to the gyro board. If they do, then everything is soldered, assuming that the headers are not just pushed through the holes in the gyro board.

Yes, they do go below into the bread board, but just to be sure I will take it off and just use the jumpers.

That still didn't work, the connections seem solid though.

PaulS:
To determine if the hardware is working/wired correctly, run the I2C scanner sketch.

// I2C Scanner

// Written by Nick Gammon
// Date: 20th April 2011

#include <Wire.h>

void setup()
{
  Serial.begin (115200);

Serial.println ();
  Serial.println ("I2C scanner. Scanning ...");
  byte count = 0;

Wire.begin();
  for (byte i = 8; i < 120; i++)
  {
    Serial.print("Checking address: 0x");
    Serial.println(i, HEX);
   
    Wire.beginTransmission (i);
    if (Wire.endTransmission () == 0)
    {
      Serial.print ("Found address: ");
      Serial.print (i, DEC);
      Serial.print (" (0x");
      Serial.print (i, HEX);
      Serial.println (")");
      count++;
      delay (1);  // maybe unneeded?
    } // end of good response
  } // end of for loop
  Serial.println ("Done.");
  Serial.print ("Found ");
  Serial.print (count, DEC);
  Serial.println (" device(s).");
}  // end of setup

void loop()
{
}

I have a question about this, shouldn't the serial number be 9600?

Also I was wondering if it is possible to find the id of the gyro in the data sheet?

This was the message i got
I2C scanner. Scanning ...
Checking addresecking address: 0x74
Checking address: 0x75
Checking address: 0x76
Checking address: 0x77
Done.
Found 0 device(s).
x73
Checking address: 0x74
Checking address: 0x75
Checking address: 0x76
Checking address: 0x77
Done.
Found 0 device(s).
x73
Checking address: 0x74
Checking address: 0x75
Checking address: 0x76
Checking address: 0x77
Done.
Found 0 device(s).
IöQdHß–ÒÉe6FØIÓ4§J“ZI1�€eXŸšE–<°=¤i>À4À4=D¾F¾F6Fx!•!$–�€I,Á-�Ÿ”ê=F>F6Fp!!–<°= i>À4À4À0À1�€eP*:$–�m”§L“Zé1@]¦X#•!!–8-’ãlÙNÉ4`e]¦›– Ó,“K¨’ãlm>À4d%”‰a0‚XI´X¤P´;—’ãhÙLÒDúDºF¾F6F6Æp!$º[

I have a question about this, shouldn't the serial number be 9600?

Why speak really slowly when your listener can understand speech at normal speeds?

Also I was wondering if it is possible to find the id of the gyro in the data sheet?

It would be a poor data sheet that did not include the address.

PaulS:
Why speak really slowly when your listener can understand speech at normal speeds?
It would be a poor data sheet that did not include the address.

Ah, is there another place I need to also set the communication speed?

Viper360:
Ah, is there another place I need to also set the communication speed?

You set the speed in the sender app and make the receiver app use the same speed, or vice-versa.

I have tried soldering it, and it is still not being found. Is there a way to check if the board is good?

I tell for sure from your photo, but it looks like the ground wire is not on the ground pins of the arduino.

jdelcamp11:
I tell for sure from your photo, but it looks like the ground wire is not on the ground pins of the arduino.

It is soldered now, and I made sure they are in the right position.