Toyota Avensis Verso - Camshaft position sensor - koootzz

Got the P0340 error which is the cam position sensor, changed out the sensor for a new one but the fault occurs again. If I reset the light when the engine is warm then it will stay off until the engine cools, when the engine light comes back on.

I'm thinking this is likely to be a dodgy connection as it's intermittent (it it was the ECU wouldn't the fault be permanent) but I can't trace the wire back to the ECU. Does anyone have an idea which connection on the ECU is this sensor. There are a couple of blue wires that I can get at, one gives a regular intermittent continuity to the connector but I can't see this is the correct one, why would it be intermittent?

While I think about it, any ideas on suppliers for replacement connectors if one is needed?

Thanks in advance

Toyota Avensis Verso - Camshaft position sensor - koootzz

Got this sorted now, thought I'd post the possible cause as I think it's a little unusual and might help someone.

The car failed to start a few days ago, all the dash lights were on but the engine wouldn't turn over. Checked the cable from the ignition to the starter and this was ok at 12.5v. Then checked across the solenoid terminals and found a voltage of 6v. So it looks like the solenoid was faulty. Changed out the starter for a new one and the error has cleared from the cam sensor and (touch wood) stayed off, I'm thinking it could have been the voltage leaking through the solenoid that was interfering with the sensor?