Sensor logger for Raspberry Pi in a stratospheric probe
Do not call main recursively. You are setting yourself up for stack overflow. Consider instead

def main():
    while True:
        try:
            your_logic_here
        except Exception as e:
            your_logging_here

Testing for counter == 4 is better done in a loop:

    for _ in range(4):
        handle_acceleration
    handle_the_rest

An unattended controller should handle exceptions more diligently. For sure, you want to act differently for the exceptions raised by sense (if any) vs exceptions raised by writing to the file.
Regarding battery, avoid binary-to-text conversions. Store your data as binary, and convert them to CSV offline, after the Pi safely returns.