I had developed a simple data logger that can log 2 MPU6050 imu with real time without using a RTC device.
- Arduino Nano
- 2 MPU6050
- MicroSD Card shield
I bought all these modules from ebay as shown in the links.
I had modified the lowlatencylogger example from SDFat library and the code is as shown in the attached file.
The way I obtain the unixtime without using an RTC is, I used a dual USB to mini usb cable as shown in this link:
And when I upload my code to the microcontroller through one USB pin to PC, I also connect the other USB pin to a power bank at the same time. So when I unplug the USB from the PC, the micro controller is still power on and the unixtime will still be accurate.
I will start logging when I press the button on the switch and stop when I press it again.
So my question is, connecting a micro controller board to PC and power bank at the same time, will it fry my micro controller, IMUs and microSD card? So far I do not have any problem, but if I use this way in long term, will it be a problem?
Thanks for any advise.
mpudatalogger.ino (13.6 KB)