Hey guys I have encountered an AVR problem that I hope someone can help me with.
I am using an Atmel Tiny12 to monitor door lock pulses in a car. The door lock actuator is a 12 volt, reverse polarity actuator, with both wires resting at ground when not in use. When the doors lock one wire is energized to 12 volts and I have this wire coupled to the input of an NPN transistor through a 100K resistor.
My problem: Everything works fine as long as I am locking the doors. But, as soon as I UNLOCK the doors the microcontroller resets and starts code execution from the very beginning line. I am thinking that the addition of a diode will stop voltages from the actuator field collapsing from affecting my circuit, but I'm not exactly sure where to put the diode. I can’t put it across the actuator because it is a reverse polarity actuator. I tried adding a diode inline but it failed to fix anything. Any ideas or suggestions?