ESP32 Thing Motion Shield Hookup Guide
Software
General Requirements
Note: This example assumes you are using the latest version of the Arduino IDE on your desktop. If this is your first time using Arduino, please review our tutorial on installing the Arduino IDE. If you have not previously installed an Arduino library, please check out our installation guide.
The Motion Shield itself doesn't use any special software. It relies on the SD card library from the ESP32 core, and the LSM9DS1 library, plus whatever you attach to it. Make sure you've got the following installed before continuing on to the examples.
- ESP32 Thing Arduino Core -- Follow the instructions from the ESP32 Thing Hookup Guide.
- Arduino Libraries:
- LSM9DS1 -- Follow the LSM9DS1 Hookup Guide or use the library manager.
- BME280 -- Follow the BME280 Hookup Guide or use the library manager.
- Your choice of NMEA parser, or do it yourself! -- Examples are contained and need no libraries.
The example code used throughout this tutorial can also be found in the ESP32 Thing Motion Shield's GitHub repository.
General Tips
Strapping Pins
The following pins are used to configure the CPU at power up to indicate various booting methods (known as 'strapping' pins). These are exposed to the user, but should be avoided for beginners. Attaching a device that matches the default state during power up should not interfere with the boot procedure. If it seems like the ESP32 isn't booting properly, investigate these pins.
ESP32 Pin Name | ESP32 Thing Pin Name | Default Pull | Description |
---|---|---|---|
MTDI | GPIO12 | High | Internal LDO voltage select |
GPIO0 | GPIO0 | High | SPI/Download boot |
GPIO2 | GPIO2 | Low | SPI/Download boot |
MTDO | GPIO15 | High | U0TXD toggling mode/timing |
GPIO5 | GPIO5 | High | U0TXD timing |
GPIO4 | GPIO4 | Low | Unknown |
If U0TXD, GPIO2, GPIO5 are floating, GPIO0 determines boot mode.
See the ESP32 Datasheet for more information.
Input-only Pins
GPIO34 through GPIO39 work only as inputs, with no internal pull capabilities (as of 10/31/2017).
Standard pin naming
The pins listed in Hardware Overview are also listed here as #defines you can use. Not all are necessary for every application, but it's nice to have them all in one place for reference.
language:c
#define AUX_LED_PIN 13
#define GPS_TX_PIN 16
#define GPS_RX_PIN 17
#define SD_SCK_PIN 18
#define SD_DO_PIN 19
#define SD_DI_PIN 23
#define SD_CS_PIN 33
#define SD_CD_PIN 38
#define IMU_SDA_PIN 21
#define IMU_SCL_PIN 22