Thanks for help in advance.
by using attached circuit diagram can i get smooth dc filtering.
is there any technique tofliter noise from avr gpio.
Same as to filter on any I/O in any system - nothing specific to AVR at all.
You need to understand your circuit and find out where the noise gets in. First up your mains transformers are going to couple any noise induced or conducted to you low voltage circuitry. Where does the loop complete? I can't tell you as you’ve not given us much to go on.
i have gone through these documents many times.
So have you applied what you found there ?
have you followed the references at the end?
have you searched-out other resources & guidance?
If it's beyond you, maybe this applies:
you're not going to get a complete solution from a few forum posts!
Nothing to do with your actual problem, but a comment or two on your schematic:
Although drawing a +12 V power connection downwards, (as you have done under the 3 LEDs), is electrically correct, most of us expect a V+ connection to be draw facing upwards, and Ground connections to be draw facing downwards.
The "7812" is actually a connector...
Although we might talk about LM7812's and LM7805's, etc., as a 7812 / 7805, that is slang.
In the schematic you should use the actual part number.
The LM7812 usually has a 0.22 uF cap on the input, in addition to the power supply filter cap.
It's presence / recommendation depends upon the specific manufacturer of the 7812 you are using, and the distance of the regulator from the power supply's Cout.
It would be inexpensive and reasonable to add it.
Lastly, I suspect putting a 5.1 V Zener directly across the 7805's 5V output might be a little bit tricky.
Based upon the specific Zener selected, its power rating, the ambient temperature, etc., it will conduct a little bit of current at 5V, and a 5V regulator can actually have a setpoint a little bit above 5V.
Bottom line, it will likely be conducting, not a lot, but some, current, as you currently have the circuit configured.
IIRC Kartman just suggested a Transzorb in a recent Thread, which I'm not able to locate at the moment, but it might be worth your consideration.
i figured out noise is comming on gpio. and i searched on internet how to filter noise from avr gpio but i didnt find solution.
You did not look hard enough.
Anyway. I use a lot of PLC's in the assemblies I work on. Just about all of them use Optoisolators on their inputs as the optos help to filter out some of the noise due to the LED rise times. They also protect the micro in the PLC from damage as well.
Now, to address the problem on the mega32 unused input pins, simply turn on the internal pull up resistors as a start. THat will hold the lines at a known state. If you are really worried you can add external pull up resistors that have a lower resistance that will provide a stronger pull up on the pins.
With regards to shielding.....Layout is important of course, but placing your circuit in a metal enclosure that has a metal top that is screwed together, and has the enclosure connected to your earth ground can work wonders.
Note that the upper supply & lower supply sections don't share a gnd & cannot share, due to each having its own diode bridge (I'm just pointing this out).
The 5%-10% slop on the 5V reg & 5.1V zener, mean the zener is likely to burn up (or the regulator will shut down).
If you want the relays to open super-fast, add a zener anti-series with their diodes (don't know if you need speed).
move gas/spark/ocv downward & put the three leds up on top.
Is there a connection there? NEVER draw a connection dot where wires cross as a T....use 3-way junctions only..this can be extremely critical to service techs and Mr. Kaboom.
Your optocoupler input should be on the left, rather than backwards.