Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 12 of 12

Thread: Adxl343 library not working

  1. #1
    Junior Member
    Join Date
    May 2019
    Posts
    7

    Adxl343 library not working

    Hello everyone , so I'm trying to make a project which involves the use of accelerometer data with the teensy 3.2 . The accelerometer I'm using is adxl343 which is similar to adxl345 but I've tried all kinds of libraries and sample codes I'm not able to receive any sort of data from the accelerometer. It only shows either a bad wiring error or it shows all 0s for xyz values. Even after using the wire libraries I'm not getting any output. Any sort of help would be appreciated.
    Thanks.

  2. #2
    Senior Member+ manitou's Avatar
    Join Date
    Jan 2013
    Posts
    2,014
    Provide more details: which adxl343 are you using? are you using I2C or SPI? for I2C you need pullup resistors on SDA and SCL. which library are you using?

    Adafruit has a ADXL343 breakout with example code, and breakout has pullup resistors. Maybe attach a photo of your wiring between T3.2 and ADXL.

    Sparkfun ADXL343

    Wire lib has an I2Cscanner example that you can use to identify I2C devices hooked to your T3.2

  3. #3
    Junior Member
    Join Date
    May 2019
    Posts
    7
    Hi , so I'm using i2c currently for the accelerometer and have put pull up resistors across the scl and sda lines . I tested the adxl343 library by adaftuit but it gives me a message saying that wiring is not correct but I've followed the instructions as given on the adxl343 site and pjrcs twi site.

  4. #4
    Junior Member
    Join Date
    May 2019
    Posts
    7
    Attaching the link for the circuit .
    https://photos.app.goo.gl/3HJEqZmWoR4H7cGt7

  5. #5
    Senior Member+ manitou's Avatar
    Join Date
    Jan 2013
    Posts
    2,014
    your wiring photo doesn't look like adafruit's example:
    https://learn.adafruit.com/adxl343-b...-guide/arduino

    You don't need pullup resistors (they are already on the breakout), you just need 3v3, GND, and SCL, SDA

  6. #6
    Junior Member
    Join Date
    May 2019
    Posts
    7
    I tried the same at first by not using any pull up resistors but that also does not work for some reason . I will try it out again and post on the forum if it manages to work.
    Thanks for all the help

  7. #7
    Senior Member+ manitou's Avatar
    Join Date
    Jan 2013
    Posts
    2,014
    your photo didn't show a connection to 3.3v??? I don't know what the white wire was hooked to.... pin 13??? are the header pins soldered?

  8. #8
    Junior Member
    Join Date
    May 2019
    Posts
    7
    The 3.3V connection is coming from the pin placed next to vbat as I was not getting 3.3V output at pin 24 which is right above the A9 pin. I've attached the marked pin photo in the previous link. Also the accelerometer is soldered but the teensy is not. And I was getting 3.3V when I connect the USB port so I don't think there should be a problem with the teensy connection itself.

  9. #9
    Senior Member+ manitou's Avatar
    Join Date
    Jan 2013
    Posts
    2,014
    Quote Originally Posted by Ankur26 View Post
    The 3.3V connection is coming from the pin placed next to vbat as I was not getting 3.3V output at pin 24 which is right above the A9 pin. I've attached the marked pin photo in the previous link. Also the accelerometer is soldered but the teensy is not. And I was getting 3.3V when I connect the USB port so I don't think there should be a problem with the teensy connection itself.

    You must solder the header pins to the T3.2 (or use clip jumpers) .... no solder. no workee.

  10. #10
    Junior Member
    Join Date
    May 2019
    Posts
    7
    Yes I will do that and try it out, hopefully by tomorrow I get it working .
    Again thanks a lot for your help, I really appreciate it .
    I will get back on this thread if there is an issue after that .

  11. #11
    Senior Member+ manitou's Avatar
    Join Date
    Jan 2013
    Posts
    2,014
    Quote Originally Posted by Ankur26 View Post
    The 3.3V connection is coming from the pin placed next to vbat as I was not getting 3.3V output at pin 24 which is right above the A9 pin.
    when you solder the headers, you'll want to get rid of your 3v3 breadboard connection next to VBAT. You don't want that 3v3 reaching the breadboard because it could short pin 13.

    pjrc.com sells T3.2 with headers installed.

  12. #12
    Junior Member
    Join Date
    May 2019
    Posts
    7
    Hi , so I soldered the pins on to the teensy and to my surprise it worked . Again thanks a lot for your help. Really appreciate it . Finally it comes down to the simplest things I guess

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •