Loud thud noices on passenger side

I drive a 2004 Hyundai Elantra with 72,000 miles on it. For the last few weeks, I’ve been hearing loud thud sounds on the passenger side when the car is cold or fairly cold. It almost sounds like someone is throwing tennis balls at the passenger side door while I’m driving. It happens when I’m stopped or when I’m driving - either way. Today, the Check Engine light went on; I don’t know if it’s related.

Regarding the check engine light, you can get the code for free by visiting autozone, advance or pepboys. Don’t let them sell you anything but report back with the code.
Not sure what the tennisball sound would be, tho.

could you be heaqring the door locks being actuated.

When the battery is almost dead the locks will start locking and unlocking on some cars. We had a Chevy corsica that was doing that when the alternator went dead.
Maybe that is why the check engine light went on.

Or that old lady with the cane, that you didn’t yield for in the crosswalk, is clinging onto the mirror.