1

I have a complicated problem with my Arduino circuit being reset/crashing, I will try to describe the best I can.

The Setup:
Basically I have a Arduino 328P circuit that is monitoring some temperatures in an automotive environment. Several one wire temperature sensors connect to the PCB with various distances from 2-10 ft. Each is on a seperate pin. I have also tried analog LM35 sensors. The system works outside the car just fine.

The Problem:
When the car is shut off (not the PCB) the Arduino is being reset despite power still being connected. There is no power spike or loss to the PCB. The car is not actually running, I am just turning the key on and off.

What I have learned:
-When I disconnect the temperature sensors from the PCB, problem goes away.
-It makes no difference if the wires to the sensors are shielded.
-It makes no difference if I use one wire digital or analog sensors.
-It makes no difference if I connect the PCB directly to the battery
-The problem goes away if I run the PCB on a battery not connected to the car. (fully isolated)
-The problem comes back if I ground the PCB to the chassis, but still leave the +12V isolated.
-The chance of a reset changes when the sensors are moved or the length of wire is changed.
-It only resets when the key is turned off, never when turned on.

I tried to explain the best I can without writing a novel. I think I might need to isolate the ground to my PCB somehow. The problem is in the ground or the long wires to the sensors.

1
  • 1
    So you are saying that peak or pulse in the GND level resets the atmega328p. That is not hard to do, I had that with a power supply. Can you show the schematic (with the reset circuit)? – Jot Dec 14 '18 at 23:43
4

There is no power spike or loss to the PCB. The car is not actually running, I am just turning the key on and off.

And did you verify that with a digital scope? I doubt it.

I don't think you understand how ugly the electrical system in a car really is. If there is a coil or relay switched then there will be spikes. Do some research on electronics for use in an automobile.

Automotive relays can have a resistor in parallel with the coil to control the level of the back emf when the relay is turned off. You would think that a reversed diode should be used but a diode causes the coil current to discharge too slow and that causes the contact arcing to be extended. A resistor can be used to speed up the discharge but at the cost of a voltage spike on the electrical system.

An Arduino board is not appropriate. There needs to be a lot more protection.And one wire devices are basically an antenna looking for trouble.

https://www.st.com/content/ccc/resource/technical/document/application_note/1f/d7/fc/6d/2e/27/48/98/CD00181783.pdf/files/CD00181783.pdf/jcr:content/translations/en.CD00181783.pdf

https://electronics.stackexchange.com/a/40425/195251

https://en.wikipedia.org/wiki/Load_dump

https://electronics.stackexchange.com/a/163861/195251

4
  • Yes, I checked both 5v and 12v with a scope. The problem lies in the temperature sensors, when they are disconnected, the problem goes away. Most of the car has been disconnected, fuel pump, injectors, coils etc there is basically nothing left to interfere. – user1113986 Dec 16 '18 at 1:17
  • @user1113986 A battery that can give a lot of amps and wires of some length, that is all that is needed for spikes. If a relay is still in the car and turns on or off then there will be spikes. Can you tell what kind of scope it is? Even with a expensive scope an experienced engineer has still some guessing to do when it comes to spikes. – Jot Dec 16 '18 at 9:41
  • Snap-on Modis scope. Interference is on the ground to the temperature sensors. With the ground disconnected, no problem, but then the system won't work... – user1113986 Apr 28 '19 at 17:36
  • What I would try is to use twisted conductors with an external shield. Connect the shield only at the PCB. If possible have the sensor shielded. Use the twisted conductors for the sensor. Do not use the shield for the sensor. If you can't get it to work then you might want to consider a sensor that is measured, then converted to digital, and the digital signal goes to the Arduino and an optocoupler is used to provide electrical isolation. – Rudy Apr 29 '19 at 22:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.