voltage spike?

Thread Starter

hotpointer

Joined Apr 15, 2015
3
Hello
could somebody look at the circuit diagram attachedpcb picjpg.jpg

the problem i am having is intermittently the Atmega chip resets ...
this only happens when the relays are d energised supplying the two solonoid valves

i think that maybe its a voltage spike ... i do have the circuit protected by flyback diodes(1N4004)

5volts to the relay ...........12volts to the valves

any ideas

thanks
 

MaxHeadRoom

Joined Jul 18, 2013
28,698
I assume both -ve sides of each supply are common?
If so make sure there is a direct return path for the 12v common.

These spikes are the worst.! :eek:
Max.
 

Attachments

Kermit2

Joined Feb 5, 2010
4,162
are you sure that is your schematic? i cant find 12 volts anywhere on it. Your relay will do nothing the way it is drawn. you cannot feed a 7805 with 5 volts and get 5 volts out. i found more problems but dont want to try typing that much with this phone. perhaps you posted an older working diagram, do you have other files that are more in line with your described circuit?

suggest a seperate 5 volt supply that is dedicated to your micro and not connected to any relay.
 

#12

Joined Nov 30, 2010
18,224
Standard beginner problem. The cure is not in the schematic, it is in the physical world. Make dedicated wires for each relay, add bypass capacitors to your processor chip, isolate your power sections with things like a diode and a capacitor or a 100 ohm resistor and a capacitor, etc. Glitch happens. Learn how to redirect or absorb the energy in safe ways.
 

Thread Starter

hotpointer

Joined Apr 15, 2015
3
As i have already had some Pcbs made .... because i have only just spotted this problem :(
do you thing decoupling cap would be a good start point because i can add these to the board....
 

MaxHeadRoom

Joined Jul 18, 2013
28,698
Decoupling is important as well as the BEMF diodes mentioned.
Did you design for diodes across the solenoids, these are normally at the coil rather than the board, anyway.
Max.
 

#12

Joined Nov 30, 2010
18,224
You only have 3 choices: Try some band-aids, learn and do all the math, redesign the board.
Pick one.
 

Thread Starter

hotpointer

Joined Apr 15, 2015
3
hi yes the Solenoids have diodes.
but i can see now that decoupling is needed on the atmega
do you think a voltage drop could be resetting the atmega would the decoupling help with this?

this is my first ever electronic project so don't really know what i am doing

the diodes are on the board
 

#12

Joined Nov 30, 2010
18,224
Optimally, Move the diodes.
Voltage drop, sagging glitch, ground plane bump...no difference to a capacitor across the processor.

It all ends up at, "exactly where in the physical world is that current causing a glitch?".
 

crutschow

Joined Mar 14, 2008
34,464
You can help isolate the micro with a capacitor directly across the power pin to the common pin, and a series resistor a ferrite bead in series with the power line from the micro (and only the micro) to the supply.
 
Top