Advanced IoT Devices (ESP32)
CE 351
James Ferguson

Introduction
The goal of this lab is to gain experience with the ESP32 microcontroller by developing an accelerometer data acquisition system that wirelessly sends recorded data to an SD card at connected to a base station. The system will use two ESP32s an MPU6050 accelerometer and a micro SD card. The work done here follows tutorials by Dr. Li.

Methods
First the ESP32 was setup with the Arduino IDE and a simple blinking script.



Then data logging was tested over serial with a single ESP32 using this script. 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 card example script ran successfully. the output of this script can be viewed here. The following shows the wiring for the last two tests.



Wireless functionality was then added to both the ESP32s. The transmitting ESP32 which is connected to the MPU6050 uses this script and the receiving ESP32 which is connected to the SD card module runs this script. The data received was first logged over serial as shown below but was then updated to use the SD card.



This data was logged into the following file structures.

These scripts where then cleaned up and switched to storing values as 16 bit ints rather than floats for speed. The updated receiving script can be viewed 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.




Results
The following shows logged data graphed with this python script. The raw data can be accessed in the following links: AccX, AccY, AccZ.


Conclusion
The data logger worked as expected. It is belived that the PCB will also function as needed but this is yet to be tested.