My wife drives a Hyundai Tucson. A few months ago we replaced all four tires. After about 7K or so I rotated the tires. A few hundred miles later the TPMS light came on. Nothing wrong with tire pressure. I pulled the code and it told me that the front right sensor failed. No, problem, we will take care of it shortly and have the sensor replaced.
However, it made me wonder. I believe this car has the sensors inside the rim. I know the basics of the workings, but I can’t figure out how the computer knows which tire/wheel/sensor is having the problem. Had the battery died prior to me rotating the wheels, it would have been the rear right wheel. Now the tire is on the front and the computer set the correct code. Is it all magic?