ESP32 IMU
Contents
Introduction
The Makerfabs IMU Module features the 6-axis MPU-6050 MEMS sensor from InvenSense. Each of these 6DoF IMU features an ESP32 with an MPU-6050 which contains a 3-axis gyroscope as well as a 3-axis accelerometer. The MPU-6050 uses 16-bit analog-to-digital converters (ADCs) for digitizing 6 axes. By combining a MEMS 3-axis gyroscope and a 3-axis accelerometer on the same silicon die together with an onboard Digital Motion Processor™ (DMP™). It can be used as a helicopter/quadcopter.
Model: ESP32IMU6
Features
- Integrated ESP32 2.4G WiFi and Bluetooth
- I2C Digital-output of 6-axis MotionFusion data in rotation matrix, quaternion, Euler Angle, or raw data format
- Input Voltage: 3.7V Battery or 5.0V MicroUSB
- Tri-Axis angular rate sensor (gyro) with a sensitivity up to 131 LSBs/dps and a full-scale range of ±250, ±500, ±1000, and ±2000dps
- Tri-Axis accelerometer with a programmable full scale range of ±2g, ±4g, ±8g and ±16g
- Digital Motion Processing™ (DMP™) engine offloads complex MotionFusion, sensor timing synchronization and gesture detection
- Embedded algorithms for run-time bias and compass calibration. No user intervention required
- Digital-output temperature sensor
- Size: max 100mmX100mmX9mm
Usage
ESP IMU Module
- You can get the firmware from here: Github:ESP32_IMU_Module
- After Arduino IDE installed, there is a default package to support ESP32. Install ESP32 board and select the port:
- Choose File -> Preferences -> settings -> Additional Boards Manager URLs.
- Fill the link "https://dl.espressif.com/dl/package_esp32_index.json" and click OK.
- Choose Tools -> Board -> Boards Manager.
- Type "ESP32" into the search box and install "esp32 by Espressif Systems"
- Select Tools -> Board -> Esp32 Wrover Module.
- Select Tools -> Port, select the related Port.
- Choose File -> Preferences -> settings -> Additional Boards Manager URLs.
- Connect the board to the PC by USB cable. Open the file “\ESP32_IMU_Module-master\mpu6050_wifi\ mpu6050_wifi.ino”. Modify the Wifi configuration and PC port.
#define WIFI_CONNECT #ifdef WIFI_CONNECT const char *ssid = "Makerfabs"; const char *password = "20160704"; const char *host = "192.168.1.234";
- Verify and upload it.
- Open the exe “\ESP32_IMU_Module-master\imu_show\dist\imu_show.exe” and reset the board. Wait for a minute and the window will display the mock-up image.
IMU car rasing
1. Firmware about MCU
1.1 uPyCraft_v1.1
- You can download the software from here: link
- Connect the board to the PC by USB cable. Open uPyCraft_v1.1, select the tools:” Tool > board > esp32” and “Tools > port > com*”, click the connected button on right.
If the connection is not successful, the prompt will be shown as “open the serial error, please try again”. You have to update the firmware to promise a connection successfully. The firmware download link is http://www.micropython.org/resources/firmware/esp32spiram-idf3-20190529-v1.11.bin. Open “Tools>BurnFirmware”, set the parameter, as the Picture, and click OK.
1.2 Firmware
- You can get the firmware from here: https://github.com/Makerfabs/Project_IMU-Car-Racing.
- Open all of the Python files in the “\Project_IMU-Car-Racing-master\ESP32_mpu6050\workSpace”, and download it one by one. Click the “DownloadAndRun” button on right, the program has been downloaded to the board, you can see it in the “device” menu on left, as the Picture.
2. Software about PC
2.1 Python3
- You can download from here: https://www.python.org/downloads/
Choose the 3.8.5 version,download and install it.
- "Add Python 3.8 to PATH" the selection must be checked during the installation process, as the Picture.
- It will prompt that some libraries are not installed after the program runs.
You can run the following command in cmd.exe to install and uninstall libraries:
pip install xxx // xxx is library name pip uninstall xxx // xxx is library name pip list // print installed library names
- After the library installation is complete, the python program can be executed on the PC.<be>
3. Operation
- Use the command line to run the file: “/Project_IMU-Car-Racing/car_racing_py/car_racing.py”. Click “GO” and reset the board.
- Tilting the IMU left and right to control the car position.
- Tilting the IMU back and forth to control the car speed.
Spirit level
- The firmware can be obtained from Github.
- Open the program "mpu-cube.ino" by Arduino IDE.
- If you have not installed the package for ESP32 development board, follow the above steps(ESP IMU Module) to do it.
- Select the development board and port in the Tools menu.
- Verify and upload it.
- connect the 1.44' LCD Module to the board, the connection is as the following:<be>
1.44' LCD Module ESP32 IMU GND GND VCC 3V3 SCL IO13 SDA IO12 RES IO14 DC IO27 CS IO26 BL IO25
- Put the board on any surface,the tilt of the surface will appear in the form of a cube on the LCD. If the tilt is close to horizontal, a green circle will be displayed in the center of the LCD screen.
FAQ
You can list your questions here or contact with support@makerfabs.com for technology support.