ESP-32 Flight Datalogger – Design Intro
After the earlier BLE beacon project was shelved due to its limitations, it seemed a good fit as an onboard data logger onboard a remote controlled plane. This data logging function could be expanded for other uses due to its light weight, inexpensive, and highly mobile features. The ESP32-Cam module would still be the mainstay of the entire design, mostly due to the built-in microSD storage. The camera module was removed since it would not be used. Even though the ESP32-Cam module has limited GPIOs, it still has I2C and Serial data buses available.
Tracking the planes location was going to be the primary goal. This would be done using a GP-20U7 GPS receiver. The GPS is a small inexpensive serial device that can be sourced easily. It would only require 1 GPIO pin on the ESP32-Cam module for serial receive.
Additional I2C sensors could be included to expand what could was logged. The selection was narrowed to the INA219 current sensor and later the BMP085 pressure sensor. The current sensor would log the battery level, while the pressure sensor would log temperature and elevation. Having another elevation reading meant the GPS values could be validated.
The HMC5883L magnetometer was excluded since the sampling rate was limited to 1 second by the GPS receiver. Having gyro readings was more of a luxury.
Finally, the onboard features of the ESP32-Cam module could be logged. This would include the wifi feature to log networks in range and their signal strength. Having these readings could help identify RF interference. BLE values were less likely to be source of interference, so this was excluded.
The ESP32-Cam module could benefit from a ribbon cable that could expand the GPIOs when the camera isn’t installed. There didn’t appear to be any such cable during this development. However, this ultimately wasn’t a factor.
Having some control over the data writing was also needed, since any abrupt stop might corrupt the data. This only required 1 GPIO for use as an interrupt. The system could also be put in standby mode to allow the GPS to warm up and get a lock, typically this took 30 seconds. In addition, it prevented wasted logging while sitting on the deck doing preflight checks and waiting for the all clear.
The ESP32-Cam module also has 2 built-in LEDs. The red LED was used to indicate different operating conditions. If a fault was detected, either by a faulty I2C sensor or a missing microSD card, the red LED would strobe quickly. When in normal standby mode, the LED would blink slowly. During logging mode, the red LED would be off, whereas the very bright flash LED would light up each time the microSD write function ran. In all, the operator would be able to visually see how the system was running.
Having the operational requirements was the first step of the project. Knowing what logic and sensor devices in play was also key to development phase. Each of them have datasheets that detail how and what is needed for them to run. In the next section, the power requirement of each component and the entire system will be covered.