I have noticed on my na 300zx the tps has 3 pins but only 2 wires. they look pretty corroded. my question is does that plug send info to the ecu and the other plug thats oval with 3 wires just a power plug? also how do you tell if your tps is working properly because my 300 has terrible idle surge that I have been battling to get rid of.
This is the Hard Idle switch. Cars with manual trans use two wires, cars with auto trans use three. It tells the ECU to put the car into an idle state based on throttle position. You can clean or replace the connector as needed. See above. The oval plug has power and earth and signal wires. The ECU also uses the TPS as a load input. You can also clean or replace this connector as needed. The easiest and in my opinion most effective way to set the TPS is to use an ECU Talk or similar scan tool to adjust the position of the sensor until it is showing .45v with the throttle fully closed. If you don't have a scan tool you can buy one from https://www.ecutalk.com.au/consultlcd.aspx and it will be the best money you ever spend on your car. Or you could probably find a local member who has one that you can borrow. If it is hunting at idle that could be related to the TPS, or other factors. Download a Factory Service Manual from the Tech Section (link in the header menu) and have a look at the various trouble diagnoses procedures listed on slide EF & EC 42.
Grab a can of deoxit d5 contact cleaner mate, and spray a little inside every connector you can get to/open. The stuff works!