How to use an NXP Accelerometer in a circuit

Discussion in 'General Electronics Chat' started by Alexander Hamilton, Oct 9, 2016.

  1. Alexander Hamilton

    Thread Starter New Member

    Oct 9, 2016
    5
    0
    Hi all,


    I am a software developer but new to hardware development. My buddy and I are working on a project that requires us to connect an NXP Semiconductor Accelerometer to a micro controller. My goal is to print the data received from the accelerometer. I don't need any help with the code but I need help connecting the accelerometer. It doesn't seem to be outputting anything. The data sheet for the accelerometer is in the link below. Can someone please give me some advice as to how to hook this up? Thanks!


    NXP Accelerometer Datasheet: http://www.nxp.com/files/sensors/doc/data_sheet/MMA8453Q.pdf
     
  2. kubeek

    AAC Fanatic!

    Sep 20, 2005
    4,670
    804
    Can you show how you have it connected right now? Do you have access to an oscilloscope?
     
  3. Alexander Hamilton

    Thread Starter New Member

    Oct 9, 2016
    5
    0
    Well I have the accelerometer's VDD connected to the microcontroller's 3v3 pinout with a 30K resistor, the GND to GND, and the SDO to the D2 pinout. And no i don't have an oscilloscope
     
  4. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,804
    1,105
    That 30k resistor seems far too high. As per the datasheet the supply current can be up to 165uA.
     
  5. Alexander Hamilton

    Thread Starter New Member

    Oct 9, 2016
    5
    0
    It also says it can be down to 6uA so wouldn't that be around the right amount of resistance?
     
  6. Alexander Hamilton

    Thread Starter New Member

    Oct 9, 2016
    5
    0
    The lowest amount of resistance I've tried is 25k
     
  7. OBW0549

    Well-Known Member

    Mar 2, 2015
    1,322
    890
    The "right amount of resistance" is NONE. Just connect the accelerometer's Vdd pin to the 3.3V supply, as in the Application Diagram in Figure 4.

    The 6 μA to 165 μA current consumption spec in the data sheet merely tells you how much operating current the accelerometer takes.
     
  8. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,804
    1,105
    I'm sure it would work with none, but a small resistor (100Ω?) might be advantageous to use in conjunction with the supply capacitors to smooth the supply.
     
  9. Alexander Hamilton

    Thread Starter New Member

    Oct 9, 2016
    5
    0
    Alright I did that but it's still not outputting anything besides 0's. Do I have everything else connected correctly? I thought I might to have to do something with the VDDIO but I'm not sure what. The data sheet says, "
    External pullup resistors connected to VDDIO are expected for SDA and SCL."
     
  10. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,804
    1,105
    Have you wired it exactly as shown in Fig 4 of the datasheet?
     
  11. OBW0549

    Well-Known Member

    Mar 2, 2015
    1,322
    890
    Vddio is the supply connection for the accelerometer's digital interface to your microcontroller; it should be connected to whatever is supplying the microcontroller's Vdd pin.
     
  12. bertus

    Administrator

    Apr 5, 2008
    15,648
    2,348
    Hello,

    VDDIO is the supply voltage for the IO stage.
    When you want it to be the same as VDD, just connect them together.
    The pull-up resistors on the SCL and SDA are needed for the outputs.

    Bertsu
     
  13. sailorjoe

    Member

    Jun 4, 2013
    361
    63
    AH, I've had a similar problem before.
    1. Make sure your microcontroller has am I2C interface. It's a two wire interface, one line is data (SDA), the other is clock (SCL).
    2. Connect to your microcontroller exactly like shown in Fig 4 of the data sheet. But before you do that, make sure the voltages for power from your microcontroller do not exceed what you NXP can handl, 3.3 V, I think.
    3. Make sure to add pull-up resistors to both SDA and SCL. http://www.ti.com/lit/an/slva689/slva689.pdf
    4. Make sure you're using a good I2C driver in your code. Lots of libraries available for free.
    5. Make sure you know the device address, and use that in your software. Be careful of decimal and hex.
    6. Make sure your initial commands to the device, over I2C, are used to configure the device to start up and configure so it begins to take samples. This may take writing to six different registers.
    If you have an oscilloscope or logic analyzer, you can watch the SCA and SCL lines and see if your mc is sending and if your NXP is responding.
    By the way, what microcontroller are you using?
     
Loading...