0
\$\begingroup\$

I've recently purchased an accelerometer (Adafruit ADXL345: https://thepihut.com/products/adafruit-adxl345-triple-axis-accelerometer-2g-4g-8g-16g-w-i2c-spi), and I'm working on connecting it up before coding.

Should I plug the Vin to the 3.3V or 5V output on my Arduino Uno?

On the Adafruit website it says: "For 3.3V LOGIC boards: connect 3.3V on the Arduino/Metro to VIN (red wire) on the ADXL343 For 5.0V LOGIC boards: Connect 5V on the Arduino/Metro to VIN (red wire) on the ADXL343" (Source: https://learn.adafruit.com/adxl345-digital-accelerometer/assembly-and-wiring)

As a complete noob, I don't even know if the logic board is referring to the Arduino itself? If it is, the Arduino Uno has both output options, so how do I choose?

\$\endgroup\$

3 Answers 3

1
\$\begingroup\$

The microcontroller on the Arduino Uno (ATMega328P-PU) runs off of 5V, and thus all I/O coming from the digital pins will be 5V maximum. The 3.3V is a bonus output, and is unrelated to the logic levels of the microcontroller. So you would want to connect V_In to the 5V pin on the Arduino Uno.

\$\endgroup\$
1
\$\begingroup\$

The Uno runs off of 5V; the 3.3V pin is for powering things that specifically need it. Your accelerometer module can run off of either since it has its own 3.3V regulator onboard (edit:) but the level shifting circuitry for the I2C needs to be hooked up to +5V to operate, so you need to connect +5V from the Arduino into the VIN pin on the module.

\$\endgroup\$
4
  • 1
    \$\begingroup\$ Although you can power the accelerometer module board off the 3.3V line, the Arduino Uno still uses 5V logic levels which would be a problem (you would be driving 5V through the ESD diodes of the accelerometer IC into the 3.3V supply) \$\endgroup\$ Commented Mar 30, 2022 at 22:32
  • \$\begingroup\$ Ah good catch; I'll edit. \$\endgroup\$
    – vir
    Commented Mar 30, 2022 at 22:34
  • \$\begingroup\$ Thank you both so much. So I'm using the 5V out pin, but could you explain to me what you mean by logic levelling? \$\endgroup\$
    – user270727
    Commented Mar 31, 2022 at 9:23
  • \$\begingroup\$ @Display_name By logic levels, we are talking about the voltages that the Arduino outputs on the digital pins when they are set to the ON / High state. For example, if you do “digitalWrite(13, HIGH)”, pin 13 will measure roughly 5V, not 3.3V. So if you try to communicate with the module, you will be applying 5V to it from an Arduino Uno, and thus you need it powered by the same 5V supply. \$\endgroup\$ Commented Mar 31, 2022 at 12:39
0
\$\begingroup\$

Arduino MCU by default runs from either 5V or 3.3V depending on specific board model. I checked the datasheet of the accelerometer, the accelerometer runs from 3.3V.

Honestly, I found that description of what to connect power wire to really poorly worded, if not wrong (typo?). I believe 3.3V/5V logic boards means the voltage that Arduino MCU runs from. It's the only way it makes some sense.

The bottom line is, if your Arduino's MCU runs from 3.3V, you can connect 3.3V Arduino's main power rail (that powers MCU) directly to accelerometer IC's power line, since it runs from 3.3V as well.

If your Arduino's MCU runs from 5V, you need to connect 5V to accelerometer board's voltage regulator, that will generate 3.3V for the accelerometer IC itself.

If your Arduino runs from 5V, but there is 3.3V output as well (5V Arduino can have on-board regulator for 3.3V output), you can also connect accelerometer IC power to that 3.3V.

Your goal is to make sure that Accelerometer IC itself always receives 3.3V and not 5V.

\$\endgroup\$
5
  • \$\begingroup\$ Thanks so much for the detailed response. It seems though that I should be using a 5v output as even if the ADXL345 did require 3.3V, it should be able to only take that from the 5V due to the way it's manufactured, from what I understand \$\endgroup\$
    – user270727
    Commented Mar 31, 2022 at 9:26
  • \$\begingroup\$ @Display_name tbh I have no idea what you just said. The point is, you connect 3.3V directly to the Acc IC, OR you connect 5V to the linear regulator that will make 3.3V for the Acc IC. Acc IC has a max voltage of 3.6V. \$\endgroup\$
    – Ilya
    Commented Mar 31, 2022 at 9:49
  • 1
    \$\begingroup\$ @Ilya You should not power the accelerometer from the 3.3V output if you have a 5V Arduino, because when you try to communicate with the accelerometer you will apply 5V to the IC which will flow through the ESD diode (which you don’t want). \$\endgroup\$ Commented Mar 31, 2022 at 12:43
  • \$\begingroup\$ @KevinSullivan accelerometer IC works EXCLUSIVELY from 3.3V. It will blow up (burn) if you apply 5V to it, as per its datasheet. The IC has to receive 3.3V in any case, either directly or via regulator. The module also has a level shifter which makes it (the module) compatible with both 3.3V and 5V logic \$\endgroup\$
    – Ilya
    Commented Mar 31, 2022 at 13:06
  • 1
    \$\begingroup\$ @Ilya The IC itself only takes 3.3V, but the question clearly states they are using the Adafruit module, and the documentation for the module clearly says you should connect V_In to 5V for 5V logic boards (which the the Arduino Uno is). \$\endgroup\$ Commented Mar 31, 2022 at 14:42

Your Answer

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