Your Toyota Sienna's Vehicle Speed Sensor (VSS) sends signals to both the Speedometer and ECU (Engine Control Unit). It is possible to trigger a Check Engine Light and set the OBD II Trouble Code P0500 even when the speedometer is working.
The speed sensor is located on the transmission and can be replaced from the outside in most cases. We recommend ensuring however that the VSS is in fact defective and the problem is not with the electrical wiring to and from the sensor and ECU. Using a Haynes repair manual is always recommend.