Hi @pmppires,
I suggest you take a look at some of the SD Card examples in the cube firmware on how to create, read and write files using FatFS on SD cards. See if you can find whate you're looking for in that respect - Then we can move on to maybe displaying some of that in a TouchGFX application.
It sounds to me like you will be having some tasks sampling various sensors to detect people (maybe just one sensor). You will then communicate this event to the GUI task through an OS Message queue which we will pick up in Model::tick() and then write to the log file on the SD card. In the same event, you can update your application to display this new value.
Check the sticky in this forum for how to integrate your application with hardware peripherals.
Let me know!
/Martin