My schematic, couple questions.

Shafto

Senior Member
woops... I meant I have the all the grounds connected to the N on the load side... not line.. whew.. I should go to bed now..

Power between pin 2 and 3? but pin 2 is ground on the line side... the mains side.. it's the dirty ground.. right? ...I want to ground out to the N on the load side (taking power between pins 3 and 4)...or no? (which is how the diagram is setup.. I just said it wrong)

why would i ground it to the line side? (pin 2)
 
Last edited:

Shack

Member
The filter does NOTHING.:(
And none of it is needed in the first place.

You may want to check the bypass cap on the Picaxe and investigate the advisability of putting some filtering on the output of the +5 regulator.

You may want to have a look at your drivers too.
 

BeanieBots

Moderator
My fault for not being more explicit.
I meant between pins 2 & 3 on the regulator.
The regulator is on the load side of the filter.

Your PICAXE 0v should be connected to pin 2 of the 5v regulator and not pin 2 of the filter.
 
Last edited:

Shafto

Senior Member
And none of it is needed in the first place.

You may want to check the bypass cap on the Picaxe and investigate the advisability of putting some filtering on the output of the +5 regulator.

You may want to have a look at your drivers too.
I must say I don't understand one bit here.... Why would you say the filter is not needed? I observed how one was needed to run on my computer power supply properly without a dodgy input reference for the ADC.

Maybe you should explain yorself?

What's wrong with my bypass caps on the picaxe? And the drivers?

The output of the regulator goes through a 47uF capacitor not in the schematic because it's already SMTed onto the pins of the reg.. the reg itself is made for auto use, can handle load dump, reverse voltage, and can deal with transients up to 60V on it's own.

Can you be more specific about what you think is wrong and why that's a problem? Your post didn't offer a lot of information.



Beanie, Thanks.. I think I got it figured now.
 
Last edited:

evanh

Senior Member
Ok, how the supply is wired depends on how the outputs are wired. Are you planning on using the car chassis for grounding all the LEDs?

If so, then you want to connect the internal PCB ground (with the Picaxe on it) directly to the chassis. But you also need to have a second chassis wire running to the N input of the mains filter along with the positive supply wire to the P input - twisted as a Black and Red pair.

The reason for this extra wire is because when a spike appears on the positive supply wire it has to inject part of that spike in to the matching supply common. By adding the mains filter and the extra supply wire it is able to divert all that instantaneous current into the extra wire instead of the output ground wire.
 

evanh

Senior Member
Do not connect the filter's N input to the filter's Earth pins. The Earth pins are internally coupled to the filter's output, you don't want the filter's input spikes appearing on the Earth pins.

You could run a third chassis wire for the Earth pins or connect them to the PCB ground.
 

evanh

Senior Member
Another issue is the positive supply for the LED drivers should come via the filter also. So, an upgrade to the filter's current carrying capacity may be in order.
 

Shafto

Senior Member
Schematic updated.

Thanks for replying again evanh.

Earth pins are now connected to the line side N.

Also added more regs for reverse lights, reverse light input (just goes to switch on the regs) and strobe outputs for brakes and reverse lights.. dunno how I want to trigger those yet.

The car chassis will be used to ground the LEDs, but the LEDs do not run through the filter. Only the picaxe, the LEDs run through the "mini filter" on the upper right side of the schematic, just a fuse, varistor, and 0.1uF. Where as the picaxe and all logic running off 5V will be grounded to line side N of the filter... is this correct?

I already have a 4 gauge wire to the back of my car right off the battery.. that's will will feed into the filter, and also feed into the 20amp fuse and to the 9V regs to power the LEDs.

When you say LED drivers what are you referring to? Opto-isolators? they're supply for the transistor collector is 5V, for the input it's the 12-14.5V signal from the car... The 5V through the transistor will only be for signal logic into the picaxe.. so why would that need an upgrade to the power supply?

If you're referring to the ULN2803As.. they don't need a positive supply, they switch the ground.

And if you're referring to the voltage regulators that drive the LED arrays... they'll be fine with the mini filter...
 
Last edited:

BeanieBots

Moderator
I'm with evanh re the ground wires but if you take the lamp supplies from the filter output it will need to be upgraded to a higer current one.
Technically, that would be the correct thing to do, but with care, it might be possible to get away with feeding them from the 'hot' side of your filter.
I would not want to push you down that path but it might be a thought depending on how the rest of your grounding works.
 

Shafto

Senior Member
The filter would have to be quite ridiculous at that point... over 20amp.

There's quite a community retrofitting LEDs into their vehicles (though not many take it this far)

Many people use these PQ09RD21 and the 12V versions with nothing.. no caps, no varistor, nada.. There isn't one reported instance of a failure...

The video of the Green eclipse someone posted earlier seen here: http://www.youtube.com/watch?v=K6sZg3iL5EY

with the fancy LED tail lights has been using the same regulators now with no filtering since 2005.

With separate outputs even if 1 were to fail, I would still have 3 other marker/brake arrays, same with signals....

I'm quite certain this will be the most over engineered LED retrofit going...
 

Shafto

Senior Member
I was trying to think of a good board layout have the 2 ULNs paralleled.. Then I figured I'd just pile one right on top of the other and solder the pins together... That seems like the easiest thing to do. Never designed a board before.. this should be interesting.. if it goes anything like schematic drawing I think I better make 2 attempts.
 

evanh

Senior Member
Where as the picaxe and all logic running off 5V will be grounded to line side N of the filter... is this correct?
Ah, no, battery, alternator and co. are on the "line side". PCB is on the "load side". Connect PCB ground and filter earth pins to the "load side" N pin. Sorry, I should have used those terms before instead of filter input and output. So, when I said filter input I meant line side and when I said filter output I meant load side.

And if you're referring to the voltage regulators that drive the LED arrays... they'll be fine with the mini filter...
Yep, them. Good to hear they are proven. Only other comment I can add is that should one of these regulators fail it'll likely short it's input to 12 volts before the 20 amp fuse pops. This can damage the Picaxe. The standard fix for this scenario is to put a lowish value resistor in series with the Picaxe output signal. Say 1k ohm.

Everything else is looking sweet.
 

evanh

Senior Member
The standard fix for this scenario is to put a lowish value resistor in series with the Picaxe output signal. Say 1k ohm.
Actually, scratch that. It looks like those regulators might have a series resistor built-in on their control pin for this very reason.
 

Shafto

Senior Member
Indeed they do.

I meant the load side, I keep confusing the 2 terms... I had it right in the diagram..

Good stuff.. I'll be placing my order soon.
 

evanh

Senior Member
Hmm, it's not perfect, the lack of filtering on the drivers somewhat defeats the mains filter. The varistors are doing all the hard work. Oh, well.

Make sure the ground plane layout on the PCB is large with good current spreading for all power devices. This combined with the varistors will make the design electrically tough.
 

Shafto

Senior Member
The voltage regs are very robust though, I am much more concerned about getting the picaxe clean power.... and the varistor can take the punishment, I got the beefiest one you can get.. it's meant to be put right across your alternator to clean power for the whole car...

How does not filtering the regs defeat the purpose of the mains filter to the picaxe? I guess if they all died and the picaxe was still working that would be purpose defeated.. but that won't happen... and if something does go wrong, I've got all separated outputs and each is fused at 2amp, if a reg does short it's input to the output the fuse will blow and half the array will still be working.... but I'd put money on me never having to deal with that... They're a very well proven part in this application...

I'd really like to thank you guys for helping me through this, I'd be nowhere without this forum.
 

evanh

Senior Member
How does not filtering the regs defeat the purpose of the mains filter to the picaxe?
The concern is a differential (From a spike) appearing between the Picaxe and the drivers. This could be possible if a similar differential is formed along the 5 volt ground between the big varistor and the drivers. With a strong ground plane between them, though, you should be in good stead.

Hmm, (Light goes on) that's interesting, maybe even removing the Load side chassis wire. And just rely on the Line side one only. With this arrangement you are directing the spikes away from the 5 volt ground, which is good, and putting the burden on the drivers. These, in turn, are able to dump the energy into the LEDs. Spreading the energy out. :)

Dunno, six of one half dozen of the other, it relies on those voltage regulators having lots of built-in spike protection (Not unheard of) but the datasheet you linked just didn't have enough info.
 

Shafto

Senior Member
The concern is a differential (From a spike) appearing between the Picaxe and the drivers. This could be possible if a similar differential is formed along the 5 volt ground between the big varistor and the drivers. With a strong ground plane between them, though, you should be in good stead.
No matter how many times I read that I can't quite get it... "along the 5 volt ground between the big varistor and the drivers" The 5v ground doesn't go anywhere near the varistor for the voltage regs...

Power to the picaxe is separated from the voltage regs, the only way the picaxe is connected to them is through a resistor and into the embedded transistor switch.. if both ground and power are filtered to the the pixace and power to the regs is separate, how can one affect the other?
 

evanh

Senior Member
Sorry, I should have said power ground but it's all the same - Unless you plan to separate the signals from the Picaxe to the control pins then you have to firmly connect the power ground and the 5 volt ground together to prevent ground bounce from causing false triggers and latch-up.

The reason I was using "5 volt ground" was to make it clear I wasn't talking about the chassis or the Line side of the mains filter.
 

Shafto

Senior Member
But then there's no point to having the ground go through the filter to the picaxe?

There are only 2 ground planes, the "power ground" is the chassis ground.. I'm still not quite understanding.
 
Last edited:

BeanieBots

Moderator
But then there's no point to having the ground go through the filter to the picaxe?
I agree, but the only alternative is to have all your load currents feed back to the load side of the filter. The filter cannot cope with that level of current which brings us back to point I made a few posts back.
As pointed out by evanh, by using the grounding he described, the only consequence would be the occaisional false trigger with -ve spikes and the load regulators "should" be able to handle +ve spikes.

I know you are tearing your hair out with all this but the only issues you have remaining are the ground connections.
It might pay you to knock up a simple block diagram of how all the "grounds" will be connected. Then it will be easier to see what/how will/might go wrong and what the consequences are.
Think of each ground wire as being a seperate connection and see where voltages could be generated and what those voltages might do to your circuit.
Posting that diagram would also help us to see if you have done anything that might cause problems.
 

Shafto

Senior Member
Well I'm kind of back at square 1 again with this filter, which I'm just about ready to not use at all since I'm sure the varistor can cope with what it's designed for.. plus the transient capable voltage reg.. I'm quite close to just saying to hell with it.

What's the point in the mains filter if I don't filter the ground? might as well go back to what I was using before.

I still don't get why I can't have the picaxe filtered and the power ground out as per normal.. that's like saying if I don't ground everything in my car through this filter then there's no point...
 
Last edited:

BeanieBots

Moderator
You're still not getting it!
If the PICAXE 0v is filtered, then it is NOT at 0v wrt any other 0v line.
Hence, a 5v signal from the PICAXE is NOT at 5v wrt to a device referenced to any other 0v.
Thus, anything you want controlled by the PICAXE output must also be referenced to the PICAXE 0v or it might suffer false triggers.
That does NOT mean that everything needs to be referenced to the PICAXE 0v line. Only those things that are controlled by it and/or those things that would give undesired results if they are not referenced to the correct 0v line.

If you can't get your head around the grounding, then you might well be better off NOT using a balanced filter and going back to your (Dippy's) original line only filter. However, grounding will still be important but the consequences will be less severe such as lights on during cranking.
 
Last edited:

Shafto

Senior Member
You're still not getting it!
Ya I know, that's what I kept saying, thanks for actually explaining it this time.

I suppose I'll be ditching the filter then... unless I use opto isolators for signals to the regs. but I don't know if they react fast enough to transmit a 3900hz PWM signal?

I don't see how this balanced filter has anything to do with me getting my head around the grounding.. if I connect the line side ground (chassis ground)to the load side (5v ground)then there's no point to having it.. I don't see anything to 'get around' here..
 
Last edited:

evanh

Senior Member
There are only 2 ground planes, the "power ground" is the chassis ground.. I'm still not quite understanding.
There will be a skinny wire between the power ground and the chassis. This is a wobbly connection when a spike arrives on the scene.

And, yes, the mains filter is somewhat (The 5 volt regulator may not be as hardy as the 9 volt ones) defeated while the LEDs are not behind it. Even the first design with the inductor was not achieving what was wanted. You can prolly just go with one varistor and one X2 cap for the 20 amp supply. And have the 5 volt regulator with it's diode and the 4700uF cap feeding from the same 20 amp supply as the other regulators.

And, to stress this, make sure the ground between the components on the PCB is a good one. Eg: A solid square of copper with the components bonded around it's edge. (Assuming single sided PCB.)
 

evanh

Senior Member
There will be a skinny wire between the power ground and the chassis. This is a wobbly connection when a spike arrives on the scene.
The varistor and the X2 cap do a pretty good job of locking the positive to the ground and therefore your PCB ground will "bounce" away from the chassis for a brief moment as the spike passes through.
 

Shack

Member
If you can't get your head around the grounding, then you might well be better off NOT using a balanced filter and going back to your (Dippy's) original line only filter. However, grounding will still be important but the consequences will be less severe such as lights on during cranking.
I agree and what I said in the beginning.

Most of that 12v front end is not necessary at all. If the alternator spikes big enough to damage this PCB the car is probably already on fire or all of the other electronics, bulbs and the radio are blown out.

There is no filtering on the +5 still. It is also "customary" to put a little filtering on the output of the +5 regulator, and a decent by-pass on the PICAXE too.
 

evanh

Senior Member
I still don't get why I can't have the picaxe filtered and the power ground out as per normal.. that's like saying if I don't ground everything in my car through this filter then there's no point...
The purpose of the filter is as an AC isolator (Above 1 kHz or something) from the rest of the car. That means, for it to work correctly, that nothing on the load side can be directly connected to the line side.
 

Shafto

Senior Member
Ok, no more mains filter.

And I shouldn't bother with the other inductor in the line side I was using before? just the 0.22 x2, a 0.1uF ceramic, the big cap, and the varistor... that sounds good to me...

The 5V reg for the picaxe is actually designed for automotive use, here's it's feature list and datasheet link:

http://www.national.com/ds/LM/LM2931.pdf

Features
■ Very low quiescent current
■ Output current in excess of 100 mA
■ Input-output differential less than 0.6V
■ Reverse battery protection
■ 60V load dump protection
■ −50V reverse transient protection
■ Short circuit protection
■ Internal thermal overload protection
■ Mirror-image insertion protection
■ Available in TO-220, TO-92, TO-263, SO-8 or 6-Bump micro
SMD packages
■ Available as adjustable with TTL compatible switch
■ See AN-1112 for micro SMD considerations

As far as I can tell will all the hours of searching I've been doing.. not even the airbag systems in your car use any more than a varistor for filtering to the IC that reads all the sensors...

The one I chose can absorb 12J of energy, 2000amp, 2.5Kv RMS... by far the most robust one I could find.. it responds in less than 25ns, so anything it can't catch the 0.1uf ceramic should get ... + the automotive 5v reg and I always thought I would be fine like that (not that I have any experience but it seems good enough) All if this confusion over more (most likely unnecessary) filtering is driving me nuts, I'm done with it now!
 

evanh

Senior Member
Yeah, sounds good. I'll admit now that even with mains designs I've never used anything more than what you've just listed. :)
 

Shafto

Senior Member
Slick, for the 5v output customary filtering, what is usually customary for that job? a customary job must have a customary part or 2, and I like that.

I think I've seen a 0.1uF and 1 uH together... but I dunno?

And just to confirm.. I should drop the 500uF coil before the varistor? it's useless?

Edit: yes I knew I saw it somewhere here... The guy who created an engine management system called megasquirt (that I had heard of before coming here as I know people who use it in the same car I have) was kind enough to provide me with his schematic seen here:

http://www.bgsoflex.com/v22/megasquirt_ShemV2.2.pdf

if you scroll down to page 4 you'll see the 1uH and 0.1uF on the 5v outputs..(analog and syn) I think I'll just go with 1 though? also.. the zeners on the input, is that a good idea? I already have plenty of 1N4001s if I just get a 12V zener and a 22V I could easily rig up the little array... After the Varistor?
 
Last edited:

evanh

Senior Member
And just to confirm.. I should drop the 500uF coil before the varistor? it's useless?
Yep, I'd not bother. And you can drop the 1 amp fuse and it's varistor also. Just connect the diode to the 20 amp circuit after the main varistor.

if you scroll down to page 4 you'll see the 1uH and 0.1uF on the 5v outputs..(analog and syn) I think I'll just go with 1 though?
Nope. Those are there to reduce logic switching noise back-feeding into the analogue circuits. You don't have any analogue circuit.

also.. the zeners on the input, is that a good idea? I already have plenty of 1N4001s if I just get a 12V zener and a 22V I could easily rig up the little array... After the Varistor?
Nah, varistors do the same job. Zenors(Transorbs) are better for more precise voltage selection is all.


Evan
 

evanh

Senior Member
What you could add, is a 5v6 zenor to the 5 volt rail. This will absolutely protect the Picaxe from over-voltage. Worse case, aside from vaporising, is the zenor cooks and goes short-circuit.


Evan
 

BeanieBots

Moderator
All said and done, it's up to you.
We've given guidance and tried to show how and where the glitches/spikes come from, their magnitude and duration.
The last circuit shown WILL NOT cope with worst case scenario.
Whether or not it will ever need to, is another question.
It will PROBABLY be fine.
I'd fit the 500uH input choke myself.
 

Shafto

Senior Member
Why will it not cope? The varistor will protect everything.. that's what it's made to do specifically.. if airbag systems only use a varistor, why do I need anything more for this?
 

Shafto

Senior Member
No, who would supply that? You didn't answer my question of how or why it wouldn't possibly cope.

In all the reading I've done it's come up a lot.. one of the main reasons behind big advancement in auto varistors because the airbag system has to be the most fault tolerant.. Everything I read about varistors talks about their use in airbag systems as use for the filter... a couple PDFs did show some example circuits with nothing other than a varistor and a couple caps.

Seriously, if the megasquirt engine management system only uses some zeners and caps and it's a marketed product which many use... and airbag systems (according to everything I can find) only use varistors.. then this is all I will ever need... The varistor is built for the worst case scenario specifically.. I really don't understand why you say it would fail.
 
Last edited:

BeanieBots

Moderator
I didn't say "WOULD" I said "COULD" under worst case conditions.
Also, the level of filtering/protection required depends on what electronics is used and how/what outputs are implemented.
An air-bag system has no outputs at all and I'd be very surprised if it has a microprocessor. Hence, very little filtering required.
An incandescent light-bulb needs no filtering because the filament has a large enough thermal lag to absorb the transients.

How long does it take the varistor to react compared to what is the shortest time a digital input can react to? (typ. = 3nS by the way)
How much of a 10nS 5kV pulse will a varistor suppress?

Filtering elecrical noise is comparable to filtering sound.
Consider the VERY loud car stereo.
A lot is 'muffled' by the fact it's in a car. (suppressor on alternator)
A lot is suppressed when you are indoors (local regulator)
A lot is suppressed if you wear headphones (decoupling caps)
The big 'bassey' bits are dampend by solid concrete flooring (local varistor)
Nearly all of it goes if you put your under the duvet (local choke).

Do all of that and you probably wouldn't know the car was there.

Like I've said several times, the choice is yours.
Odds are, you'll get away with it with that last circuit, but it is NOT gauranteed if your car gives you a worst case scenario.

I work mainly in the semiconductor manufacture industry. One of the processes involves producing a beam of ions to impregnate the silicon with impurities. That is done by accelerating the atoms with high potential at voltages up to the best part of 1MV with 10kW behind it. That sometimes 'cracks' over and all the electonics must cope with that. We can't use any memory devices such as micros or even flip-flops because the EM pulse could reset them.
Now, heres the sad but true part.
When designing a circuit that can save a life, the investment in that circuit is valued at £1M per life! That is, it's only worth spending an extra million if it saves a life or (more to the point) if it costs more than a million just to save just one life, it's not worth doing:eek:
A down semiconductor plant can cost £10M/day.
Hence, the failsafes I deal with are comparable (financially) to those that would cause the death of 10 people/day. A very sad fact!
Maybe that has made me over cautious over the years?

How crucial is it that your circuit works every time?
What is the risk and what are the consequences?
How much is a cut corner worth?

Compare that to the original design you are replacing.
What is the life expectancy of a regular car bulb?
Is your circuit more/less reliable?
If it does fail, how quickly/easily can the failed part(s) be replaced?

These are all basic fundamentals that the electronics design engineer must answer as part of the design process. They can only be answered by having a full understanding of both the design and the working environment. If any aspect is not fully understood. Then get in a qualified consultant and pay for a litigation waving certification and peace of mind.
 

BeanieBots

Moderator
That's a good device to use but remember, it doesn't start to conduct until around 48v.
The caps will certainly be very good at catching the spikes but also, don't forget that no device is perfect. That is, the leads have resistance, caps have inductance, inductors have capacitance etc.. etc.. which is why combinations of components are required not just one device does all.

You also need to take into account where the current goes when something like a varistor/transorb/capacitor starts to conduct very quickly and what effect that has.

You can see the effect very easily yourself. Get a simple 1.5v battery and a length of wire. Make some mementary shorts across the battery.
You will see sparks. 1.5v can't jump very far yet it is still possible to get sparks of a mm or so with just a 1.5v cell and a length of wire. That's because of the inductance in the wire!
 
Top