4
\$\begingroup\$

I've just bought this accelerometer: https://www.amazon.co.uk/XTVTX-ADXL345-Digital-Acceleration-Gravity/dp/B09NRFDH5J/ref=cm_cr_arp_d_pl_foot_top?ie=UTF8

I've bought it to learn about accelerometers and practise them with my Arduino Uno. I have a few noob questions though.

  1. Are all ADXL345's the same and just sold by different companies, or are they actually manufactured differently?
  2. If they are manufactured differently, how do I find the specs for my specific one to know how much to power it with for example?
  3. Can I use Adafruit's ADXL345 libraries with the component regardless of who it was made by?
  4. The component didn't come with any coding template or instructions, so how do I learn how to code this specific one?

Sorry in advance as I know these are very basic questions. Just looking to learn about these and am a bit lost with where to start :)

Thanks

\$\endgroup\$

1 Answer 1

5
\$\begingroup\$
  1. ADLX345 is a chip manufactured by Analog Devices. What you bought is a module that contains that chip, and many other manufacturers make different modules which contain the same chip, but they might have differences in the external components or other differences like onboard regulator.

  2. If you did not receive documentation from the module seller, then it is a black box you don't know anything about. Never buy anything you receive no docs, or are able to reverse-engineer it, or otherwise know what you are buying. However most modules are very simple and some people have already reverse-engineered the schematics for you. You need to know what you should connect to where, sincr some modules can require 5V or 3.3V supply, and they might use 5V or 3.3V bus voltages, and if that is compatible with your MCU. So just buying and connecting something may not just work or can damage things.

  3. Maybe. It depends on the module and the library. The chip supports both I2C and SPI buses, and it can be set to two different I2C addresses. If the library assumes bus type or address, then some modules may not be compatible. However, the library is not a black box, you have the source code and power to change it to suit your purposes, or use it as a reference to write your own. Accessing chips over a bus is not black magic, it's a basic everyday thing for an embedded programmer.

  4. Isn't that the reason you have the library? It does everything for you, it initializes the chips and provides you a black box to use the chip. Just read the library manual or examples.

\$\endgroup\$
1
  • 1
    \$\begingroup\$ thank you so much. I'll return this pack and buy an official Adafruit one. I'll also start looking into some of the things you mention just to understand the component a little better. Thanks again :) \$\endgroup\$
    – user270727
    Mar 28, 2022 at 17:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.