arduino does not respond after engine is turned off and then on again

I am using our companies board via UART (38400) to communicate with the OBD2 using Arduino.
When using it in a standard way, sending 010C command for receiving the RPM every 30 mls or so, there is no problem. I start sending requests after 10 seconds.
But after I turn the engine off and after a few seconds back on, the Arduino does not respond. I see the adapter flashing in the low frequency of the transmitted commands, but I don't get a response.
I tried to add a reset command but no change.
If I unplug the Arduino Adapter and plug back it usually fixes the problem.
Why does this happen and how can I overcome it.

It could have something to do with the power source fluctuating on/off when the car is stopped, like it is receiving enough power or has stored a bit of current (like an unintentional psuedo-capacitor effect) to keep part of the circuit alive and therefore setting everything into a state of disarray when full power is provided again. Perhaps try adding a solid disconnect to the negative side of the circuit, such as a relay and 555 timer that is triggered by the car starting (to open the current flow) and then physically disconnected by the car being stopped because the relay loses power and returns to a N/O state.

Hi,

Perhaps try adding a solid disconnect to the negative side of the circuit

No, don't go disconnecting gnds.

As everything starts at once, you could be having a synchronizing problem when everything boots at the same time.

It might be an idea to have the arduino powerup say 1 or 2 seconds after power has been switched on, or put a 2 second delay as the first line in the void setup() part of the sketch.

Tom.... :slight_smile:

Thanks all.
Tom, I added earlier a 10 seconds wait before sending and setting up the UART, but no help.
I overcame the problem :slight_smile: by adding RESET (ATZ command) + the sequence I saw in the downloaded code i had (written by Stanley).
As long as I did not get a correct answer from the Arduino for the RPM request, I went on sending RESETs.
Usually after ignition I see 1 - 4 resets . :o
During the regular work, after good startup, Whenever I do not receive an answer from the Arduino for 200 mls I restart the RESET Scenario.

Although the ELM327 manual says an answer should arrive after not more than 10 mls, I have to wait around 20 mls before resending a request, otherwise the Arduino stalls.

All the best