## General electrical question

26 posts / 0 new
Author
Message

Hello,

I built a car starter that takes commands over SMS. So I can text my car to do stuff. Neat.

Originally it failed because one of my relays decided to stick on one night, and my radio was on, draining the battery.
A quick google search pointed me towards the fact that I didnt have any reverse biased diodes for inductive load protection!

Alright cool. So I threw some on there and did an endurance test of my circuit to make sure nothing would fail again. I did this over night (relays were switching on an off, but were not actually switching on any load). Video here FYI: http://www.youtube.com/watch?v=cLCTgyNxEdE

So I happily put my car starter back in my car. And it worked!!

For about 2 days. I woke up this morning to a dead car again.

Q: Does anyone have any idea why this could be killing my car??? The circuit, when asleep, draws 60mA. I believe thats not enough to kill a car battery in a couple of days.

Cheers!

Well, lets check some numbers, first.

A standard car battery has a capacity in the range of 60 AmpHours to 80 AmpHours.

60mA = 0.06A. So, for one day (24 hours), it uses 1.44 AmpHrs. Lets round that to 1.5 AmpHrs. So, one week would 10.5 AmpHours. Thats pretty significant for a 60AmpHour battery. Should not kill it, but if it was a cold morning and the engine was hard to start, it could be a challenge.

When you say "car dead again" after 2 days.... was the a relay stuck on, again? Or, did things still appear to work (after recharging) but just dead?

Have you measured the actual current? 60mA seems awfully high though an SMS module would probably account for much of that.

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

Quote:

The circuit, when asleep, draws 60mA. I believe thats not enough to kill a car battery in a couple of days.

Yup. A fresh, healthy and fully charged car battery is 50+ amp-hours. So you should get in in the order of 1000 hours (or 40 days).

As of January 15, 2018, Site fix-up work has begun! Now do your part and report any bugs or deficiencies here

No guarantees, but if we don't report problems they won't get much of  a chance to be fixed! Details/discussions at link given just above.

"Some questions have no answers."[C Baird] "There comes a point where the spoon-feeding has to stop and the independent thinking has to start." [C Lawson] "There are always ways to disagree, without being disagreeable."[E Weddington] "Words represent concepts. Use the wrong words, communicate the wrong concept." [J Morin] "Persistence only goes so far if you set yourself up for failure." [Kartman]

And I remember doing that exact math to figure that if my car is off for a month that I should unplug my circuit.

And funny you mention the relay again. I was confident that it was fixed now that I did the relay test. When I unplugged the circuit this morning, I didnt hear any relays unclicking.

However... I just plugged it in on my desk, expecting nothing, and after about 15 minutes, one of the relays clicked again!

Root cause not determined yet though.... any ideas?

I guess I didn't replace the optical isolators (npn transistors on the output side) that would have been damaged in the environment without diode protection. You think that could be it?

It is the same relay too.

Also, damn you guys are fast to respond :)

... its also worth mentioning the circuit for the relays.

I had p channel mosfets, so I used them.
They idle high, and the optical isolator pulls them down via resistor bridge. current through coil goes through mosfet.

Is it possible the mosfest broke too? should they all (isolators and mosfets) be replaced just in case?

If optoosolators or mosfets broke, then it should not operate on that channel.

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

it operated fine (you can see in the video).
now its dead (the same one that died without diode protection).
when i hooked it back up several months after the first death (a few days ago), they all worked fine. Its after being powered for some time that the one that died before re-dies.

would you recommend replacing all components used for switching relays? Or is there a way to determine which ones are for sure still good?

Thinks rarely "die" and then are "resurrected". A few SCR-like lockups will do that with a properly current-limited power supply. The point is that if it is operating now, its not likely to be significantly damaged.

More likely that something else happened. Either pure software OR some input that picked up a transient from a circuit opening or closing that caused the software to think that it needed to do something. These can be most mystifying - they rarely happen in bench testing. Make sure that there are no floating inputs. Any unused pin should be set as an output.

By the way, your relay endurance test needs to be done with realistic loads. Otherwise, it means very little.

Jim

Jim Wagner Oregon Research Electronics, Consulting Div. Tangent, OR, USA http://www.orelectronics.net

Just to chime in with a question, can you post a schematic? That is a sure way to get more precise ideas/answers. With most car startes all relays are normally DE-energized and only used when a function is called for. Those 30a black cube relays are power hungry. The relay 'welding' then 'unwelding' can be caused from the little shock from you picking up the circuit box to see WTF happened?

60ma is really not much. I measured the current draw on my truck battery with nothing turned on and the key off and it was about an amp or so. YOur circuit is no real load.

The schematic would be helpful as I would be curious to see what you have for a power supply. Even with the key off the power can do funny things that may have caused the micro to do funny things(like activate a relay)

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

"The critical shortage here is not stuff, but time." - Johan Ekdahl

"Step N is required before you can do step N+1!" - ka7ehk

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

tkurowski wrote:
However... I just plugged it in on my desk, expecting nothing, and after about 15 minutes, one of the relays clicked again!

Does this mean that you were attempting to operate the relay for 15 minutes, during which time it was failing to respond to your commands, until it finally responded after fifteen minutes of trying? Or that it was sitting, idle, for fifteen minutes, at which point it operated all by itself with no provocation from you? Those are two very different problems, and it's not clear to me from your descriptions which one you're facing.

Do you have, perchance, LEDs connected tp the microcontroller pins that control the relays (NOT in parallel with the relay coils)? These would help you determine if it's a problem with the relay and/or relay switching circuitry versus a software or electrical glitch somewhere on the mcu side of things.

Last Edited: Thu. Oct 4, 2012 - 01:40 AM

I tend to think that 60 mA stand-by @ 12V is a lot.

If you intend to remotely start the car only once a month, or so, very infrequently, then of course an option is to add a Real Time Clock and power the circuit up only for 5 minutes, on the hour. You have to synch your request to that 5 minute window of time when the circuit is watching for an input.

You really need to post the FULL circuit, power supply, inputs, outputs, etc.

Are you familar with "load dump"?

Your circuit may work fine on the bench, but die an early death from the very noisy electrical system typical of vehicles. The micro needs to be protected from the noise, as does every input to the micro, and some outputs, if there is a path for the noise to get back into the micro's pin.

JC

Edit: Typo

Last Edited: Fri. Oct 5, 2012 - 12:15 AM

I'll try to answer in order:

Quote:
More likely that something else happened. Either pure software OR some input that picked up a transient from a circuit opening or closing that caused the software to think that it needed to do something. These can be most mystifying - they rarely happen in bench testing. Make sure that there are no floating inputs. Any unused pin should be set as an output.

By the way, your relay endurance test needs to be done with realistic loads. Otherwise, it means very little.

My uC is optically isolated. If I probe the pins, they are low (relay NOT energized). But the relay is energized. If I probe the npn output on the isolator, its low - it should be high if its "off".
Power to the uC is shared... I should not get any transient effects: I have a TVS diode before the circuit which feeds to a schottky, which feeds to a regulator. The max voltage the TVS can attain before dumping is under the spec of the max voltage of the regulator. (circuit diagram below).

Also, no floating inputs exist, even on unused pins.

Please, can you elaborate on expanding my endurance test? Is there a simple way to imitate my car voltages switching on?

jgmdesign: see circuit below

Quote:
Does this mean that you were attempting to operate the relay for 15 minutes, during which time it was failing to respond to your commands, until it finally responded after fifteen minutes of trying? Or that it was sitting, idle, for fifteen minutes, at which point it operated all by itself with no provocation from you? Those are two very different problems, and it's not clear to me from your descriptions which one you're facing.

I operated the relay once by micro. Then the system was simply in sleep mode. Idle. Without any signal from the micro, the relay turned on. Same one that failed before when without diode protection. I understand that the transistor is the component that fails since it cannot take high voltage impulses. However, as you can see in the video, it was working. So I thought it was ok. Anyways... thats the channel that failed.

Not software (probed the micro. output is not on - relay should not be switched on). I believe the problem is electrical.

Quote:
Are you familar with "load dump"?

No. Can you elaborate or perhaps point me to a website you think could be helpful?
Regarding noise to my micro... I believe I planned for the worst. TVS for voltage spike suppression and a fuse for current spikes. No loops, all power starred out.

All: thank you for your input thus far.

PS: the reason for the extra schottky and resistor on the capacitor is because it was charging up way too fast (20000uF - overdesigned!) and burning my fuse up!

## Attachment(s):

Your micro is not isolated - there is a galvanic path via your 0V. Using optocouplers in the application a unnecessary - the relay itself provides galvanic isolation of the load. Why do you have a diode and resistor in series with the input capacitor? I could understand if it were a battery but your schotty diode in series with the supply is sufficient. GSM modules can cause issues with floating inputs. Unused inputs should be set to output. If you use external interrupts, be sure they are filtered for RF. The GSM module also pulls significant current when it 'phones home' - this may upset your AVR.

Please give us some component values and types.

What if the relay is broken, not the circuit driving it?

It seems you are driving pretty big loads with relays, and the relay contacts do not seem to have any protection, so the contacts may weld together. Permanently.

This may be a side-effect of the relay not energizing or de-energizing fast enough. What kind of diode you have over the relay coil? It may prevent the relay to de-energize the relay coil fast enough, so the relay contacts may bounce and arc.

But not only the diode may be the problem. How fast the FET turns on/off the relay coil power? You should not have any big resistances on FET gate so the FET would be turned on/off quite fast.

A constant 60mA load on my car battery would be completely unacceptable. My car has a pretty old 45Ah battery and the acutal capacity is more down to 32Ah. There are also lots of times when I don't use my car for 2 or 3 weeks in a row and this would mean a completely flat battery.

The full amp Jim measured is probably due to a measurement error. For example, as soon as I open my car door the interior lighting and a small red safety ligt in the door turn on without a key in the contact. The idle load of my car battery is much smaller then 1mA.

I would spend some effort in lowering this power drain but I suspect that most of the 60mA is going to the GSM module. Check each component for power consumption.

You might also consider to power your circuit from a separate battery and recharge this battery automatically, but only when the car is "on". There are also a lot of other ways to bring down the current consumption. For example a simple LM2596 based SMPS (It's completely crasy but a complete PCB is USD1.59 on ebay with "free shipping" directly from China).

Doing magic with a USD 7 Logic Analyser: https://www.avrfreaks.net/comment/2421756#comment-2421756

Bunch of old projects with AVR's: http://www.hoevendesign.com

tkurowski wrote:
Quote:
Are you familar with "load dump"?
No. Can you elaborate or perhaps point me to a website you think could be helpful?
How to select power line polarity protection diodes by Soo Man (Sweetman) Kim (Vishay) mentions load dump.

"Dare to be naïve." - Buckminster Fuller

ka7ehk wrote:
Thinks rarely "die" and then are "resurrected". A few SCR-like lockups will do that with a properly current-limited power supply. The point is that if it is operating now, its not likely to be significantly damaged.
One of the blessings of the voltage regulator's current-limiting feature. Avoiding or limiting latch-up is important.
Ref.
1. SCR and diode rail clamp. https://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&p=985847#985847 by AVR Freaks member KitCarlson.
2. Protecting Inputs from Damageâ€” EOS by Bruce Trump (Texas Instruments).
3. Tutorial: Improving the transient immunity of your microcontroller-based embedded design - Part 1 by Ross Carlton (Freescale) (of a 5 part series).

"Dare to be naïve." - Buckminster Fuller

Last Edited: Thu. Oct 4, 2012 - 06:00 PM

T,

When you say the relay is "sticking on" do you know if it is mechanically stuck or electrically stuck?

Mechanically stuck means the relay stays closed when it is dlectrically de-energized.

Electrically stuck means the relay stays closed because the coil is somehow being energized when you don't expect it to be.

Put an ammeter in series with the coil and see what the current draw is when it "sticks" to distinguish between the two conditions.

Relays can stick mechanically for a number of reasons:

1. Mechanical issues in the linkage ellements (armature, spring, etc).

2. Contacts weld together, sometime temporarily. Usually due to overvoltage, overcurrent, sparking from inductive loads.

3. Armature becomes magnetized and sticks to the coil core when coil current is removed. You can relieve this by putting a thin piece of plastic or brass or aluminum between the armature and the coil's head pole. A properly designed DC relay should not have this magnetizing issue. If yours does, replace it with a different manufacture or model.

Are you pulling the gate up with an unprotected 12v car battery voltage or is there a mistake in the schematic ?

Also, I see no need (not much harm either though) in using a series schottky instead of a standard silicon diode.

More voltage drop on that diode is less voltage drop on the regulator and less heat (doesn't really matter with low current though).

But it's failing on my bench top too. Not even in the car. The relay is not mechanically stuck. The transistor output is as if it is shorted out, electrically actuating the MOSFET and subsequently the relay.

I'm using voltage on the mosfets that comes from free the first schottky. My mistake.

How can I prevent the relays from welding?

At this point, i really think the opto output broke from the lack of diode protection before. It's weird that it worked for about 16min before breaking down again. Oh well. I wonder though, could similar damage have happened to the mosfets? Are they dangerous to use now?

Is the regulator a 78xx three terminal regulator? THey are the worst for an automotive enviroment.

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

"The critical shortage here is not stuff, but time." - Johan Ekdahl

"Step N is required before you can do step N+1!" - ka7ehk

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

Sorry, the circuit is correct. The mosfets run off car voltage.

FQP27P06-ND mosfet
L78S05CV regulator
1n4004 diode

I feel like we are off heading here...
The micro is fine. The software in it is working. Ive gathered that much via probing my circuit. The opto isolator output transistor is dead. This is the failure mode of the transistor from what I gather - it is essentially shorted. Therefore it makes sense that its energizing the coil.

Ultimately, I'd like to know: having added diode protection on the relays, should I change out all my existing optoisolators and mosfets (since they were also exposed to the non-protected relay switching environment?

At this point, is there use in figuring out why the opto failed then worked again, then failed again? Im concerned about this only with regards to the other relays.

Should I be tying voltage driving the coils through the mosfets somewhere else? is there danger otherwise? if so, whats the danger?

Whats the max V on the opto? Couple of good spikes on the Vcar might eat it for lunch. Maybe need an R and a 15V zener and a cap on the Vcar to the opto.

Imagecraft compiler user

Quote:
The micro needs to be protected from the noise, as does every input to the micro, and some outputs, if there is a path for the noise to get back into the micro's pin.

Yes, I fully agree the opto is dead. That is as a result of not having a reverse diode on the relay coil.

Would that have also damaged the mosfets?