All of the wiring diagrams I've found for wiring up a GY-521 accelerometer to an Arduino have looked something like this:

enter image description here

I've read in several places that it needs to be connected to A4 and A5. I want to connect one to a SparkFun ThingDev, which unfortunately only has a single analog input:

enter image description here

Is this possible?

I only need it for a very simple application (finding out if a machine is vibrating or not).


A4 and A5 on the Arduino double as the I2C pins SDA and SCL. You are communicating with I2C, not analog.

The ESP8266 doesn't have I2C in hardware, but there is a software-based I2C implementation which can work on any pins. The pinout you show has I2C labeled on pins 2 and 14. While you can use those you could use any two pins of your choosing.

Note that I2C on the ESP8266 has a slightly different begin function:

Wire.begin(2, 14);

That is where the pins you want to use are assigned - in this case, pin 2 for SDA and pin 14 for SCL.

  • default Wire pins in pins_arduino.h for this Thing are 2 and 14. so Wire.begin() is ok – Juraj Nov 14 '18 at 5:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.