Using 12VDC Solenoid as input

Go To Last Post
11 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

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?

Attachment(s): 

--------------------------------
Kevin Pierson

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Opto couplers work good in a commercial version of a product that does just this kind of thing! visit www.autowindow.com

What are you building?

Regards,
Scott

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Scott,

Looks like a more expensive version of the AlienTech module that has been availible since 97ish....

We are a small technology company expiramenting with a wide range of aftermarket electronic projects, most of them focus around adding features to factory alarm systems. Although we don't have any products in full production yet we are currently beta testing a window module similar to the one at www.autowindow.com and a traction control controller module. Are you affiliated with autowindow.com?

Thanks,
Kevin

--------------------------------
Kevin Pierson

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

How is your reset circuit ?

Look at figure 3 of application note AVR042. This issue is also discussed in application note AVR040

Regards,
Alejandro.
http://www.ocam.cl

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Since I do not plan on every performing a reset I just tied the reset pin directly to Vcc. This was one thing I wasn't sure about doing, but its worked for me in other projects. Is adding a pull-up resistor a good idea?

Also, on my regulator output I have a 10uF electrolytic cap, I am planning to try a bigger cap to see if that will help aleviate, what are you thoughts?

Thanks,

--------------------------------
Kevin Pierson

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Most regulators require a ceramic cap in addition to an electrolytic. And don't forget another ceramic capacitor as close as possible to the MCU power pins. 0.1 uF (104) is typical.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
Is adding a pull-up resistor a good idea?

Yes. Add the pull-up, and the cap to ground, and the diode (as in figure 3 of the application note). My theory is that noise is coupling to the reset pin.

Try this and then tell us how result :)

Regards,
Alejandro.
http://www.ocam.cl

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hey thanks for all the comments. I had over looked the application notes and they seem to be an excellant source of info. I do believe placement of my decoupling cap is the main culprit. Unfortunately I am out of town right now and won't be able to to try out the fix until I return home. I do have a simulator box I carry with me so I might try to modify it to generate the load the car is creating and then attach a relay to it to simulate the actuator!

Thanks a ton!

--------------------------------
Kevin Pierson

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It will be better before applying solution is to get solenoid output when you close and open door . It could be case that there will be downed oscillation on its output . If could be the case even for polar solenoids . or let say if there is mechanical vibration , this could be resulted in many pulses coming from solenoid . You can use zener diode to open transistor on signal peak (12 volts ) and also pullup base emitter circtuit with resistor and capasitor as well to proper define opening frequency .
But much better is to check solenoid output it via scope to knwo what things you are dealing with and then it will be possible to apply relevant solution .

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

From first hand experience with AtTiny12's and automobiles....that 0.1uF cap right next to the processor is essential. Regardless of which 5V supply you're using (7805, etc).
Adding a decoupling cap next to processor completely fixed all reset/noise issues my Tiny12 circuit was seeing (I was using a cheap 7805 as well).

Newer model cars have a lot of noise and voltage spikes that love to get by voltage regulators and freak out the processor.

I've attached a pdf pertaining to the nasty voltages found in cars.

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Call me crazy but I always thought a car was a fairly stable electrical system ( in the cabin at least). I know under the hood there are some high voltages switching on and off quickly that create all sorts of bad stuff. I also knew relays, solanoids and the such were bad, so I guess if I would have put it all together I would have figured it out!

Thanks for the PDF, it is very informative. I have decided that my current power supply setup is not going to cut it. Although it is working I am afraid of reliability issues. My next step is to take apart an old car alarm I have and see what exactly they are using. I've installed quite a few car alarms in my day and I have never seen one have a power related problem so I figure thats a good place to start getting ideas. Also, I over-looked the importance of the capacitors. I will add them and test them ASAP. I think that my problems will disapear as soon as I add them!

Againl, thanks everyone for your continued responses!

--------------------------------
Kevin Pierson