Advanced IoT Devices (ESP32)
The goal of this lab is to gain experience with the ESP32
by developing an accelerometer data acquisition system that wirelessly
recorded data to an SD card at connected to a base station. The system
use two ESP32s an MPU6050 accelerometer and a micro SD card.
The work done here follows tutorials by Dr. Li.
First the ESP32 was setup with the Arduino IDE and a simple blinking
Then data logging was tested over serial with a single ESP32 using this
The following shows the data in the Arduino serial monitor. It is worth
noting that the SD card becomes unstable when powering it only with the
ESP32's 5V pin.
Another ESP32 was then used to test the SD card reader. The ESP32 SD
example script ran successfully. the output of this script can be
The following shows the wiring for the last two tests.
Wireless functionality was then added to both the ESP32s. The
which is connected to the MPU6050 uses this script and the receiving
which is connected to the SD card module runs this script. The data
first logged over serial as shown below but was then updated to use the
This data was logged into the following file structures.
These scripts where then cleaned up and switched to storing values as
ints rather than floats for speed. The updated receiving script can be
here and the updated transmitting script can be viewed here.
A PCB was also designed. The following shows the designed schematic and layout. The ESP32 is on the backside of the board.
ERC and DRC and produced no meaningfull errors.
The following shows logged data graphed with this python script. The
data can be accessed in the following links: AccX, AccY, AccZ.
The data logger worked as expected. It is belived that the PCB will also function as needed but this is yet to be tested.