Strange Problem...........

Hello Friends.....I am facing a strange problem.

I have two independent systems connected to the same power source (AC 220V). One is frontier digital timer 619 (http://www.king-ielec.com.tw/all/manuals/timer/619mode_619.pdf) for controlling my drip irrigation for the plants and other one controls the water level in the overhead tank, which is built on stand-alone Arduino atmega 8. Both systems are installed side by side as shown in the attached pic. Problem is when the timer switches off(not every time, but most of the times), it makes either the water level control system hang or reset. Not sure what is causing this issue. Timer is directly powered by AC 220V and Arduino stand-alone is power by 12 V SMPS adapter, which was regulated to 5V using 7805, tried replacing the adapter with new one, but no luck. If I disconnect the timer, water level control system works perfect without any issues. Any suggestions are welcome….

Drip controller (timer not so much as valves) is sucking too much power. When timer activates valve(s), it draws down the power so much that the arduino resets. To validate, power the arduino off a different branch circuit, or a battery, for a period of time and see if you experience more resets when the timer activates it's peripherals.

Solution(s); 1) remove some of the other loads from the service branch, 2) power one of the elements of this system off a different service branch. 3) put a bunch of really big electrolitic capacitors ('filter' caps) in the arduino's power circuit (between the 7805 and the SPS). 4) power the arduino (not it's peripherals) off a battery.

Did you put a decent sized electrolytic across the output of the 7805. If you did, I'd be inclined to make it bigger.

The output capacitor at 7805 was 47mfd. If I increase this capacitor value, won't it increase the voltage?

@123Splat,

The problem is at the time of timer goes off, So I am not sure sucking too much of power is an issue here. I am thinking some type of interference. Also the problem is not just reset(in fact reset is not a big problem for me), the main problem is it makes arduino hangs sometimes. Anyways.. I am going to try solutions you mentioned 2 - 3.

I also notice that the output of your timer runs directly under the wall wart. Could you perhaps reroute this. It's just possible that RF interference on this line is somehow causing problems to the logic of your power supply.

You could try an earthed shield around your controller as well. It does sound like either power or radio interference causing the problem.

Making the capacitor in the power supply larger on a 7805 will not increase the voltage.

Hi,
Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png or pdf?

Have you bypassed the 7805 with 0.1uF caps, the supply pins and the inputs of the atmega8.

Tom...... :slight_smile:

Lavan:
The output capacitor at 7805 was 47mfd. If I increase this capacitor value, won't it increase the voltage?

47 millifarad? 47000µF? Really?

Actually, the output capacitor of the 7805 does not need to be more than 4.7µF. What is important is that it (and the 0.1µF in parallel with it) are very close to the output terminals of the 7805. The 47µF capacitor would be more useful across the input of the regulator.

The capacitor value increasing the voltage? Do you somehow imagine if you only had a 0.1µF across the output of the 7805 (which would probably be quite sufficient, actually) that you would get only a volt or two?

My concern would be how you connected the sensors to this circuit.

Hi, mfd can be microfarad, uF is microfarad, mF is millifarad.
I have seen it on the older circuit diagrams, particularly old valve apparatus.

Tom...... :slight_smile:
PS when I was a lad, and had just dawn on me how a valve or tooob worked I ttrawledthe local library for radio books to look at the circuit diagrams to work out how they functioned. OOOhhh those were the days.

Thanks all for your responses and sorry for my delayed response, it took some time for me to draw the schematic in Eagle as it was my first schematic. I am a kind of perf board guy and never used any CAD software before, but it was a good learning :slight_smile: . I have tested this circuit with another external power supply and the results are puzzling.

This circuit was built on ATMEGA8L-8PU and I have loaded Arduino boot loader on it. When I tried with another 12 V power supply (which was built on LM350 with 2AMP transformer) Arduino comes up as normal. When I power on and power of the drip timer, I have encounter the same problem Arduino hangs, this rules out the power supply adaptor as a culprit. Another problem noticed was, every time I switches off the power supply, something happens and Arduino won’t come up, this power supply has a 4700uf/50V capacitor inside and voltage decreases gradually when it was powered off, not sure gradually decreasing voltage is causing some issue here. I had to reload the code to make it functional. This pointed out me to doubt ATMEGA8L and boot loader. So I have replaced the ATMEGA8L with boot loaded ATMEGA328 and everything works perfect and I could not recreate this problem, monitoring it since last 24 hours and everything looks good as of now. This opens up new questions, why this problem is only with ATMEGA8? Is it boot loader problem or something else? BTW, I tried with two different ATMEGA8 chips, encountered same problem and ATMEGA328 works fine.

Schematic.pdf (17.8 KB)

Hi where are the pull down resistors on your float switches?

Tom...... :slight_smile:

Post images on Web pages as .jpg (or .png or maybe .gif) so they appear in the web page, not .pdf which tend to require another program to visualise.

Firefox is supposed to render .pdf but often does not - as in this case (presumably due to be the way the BBS software treats it).

I don't see an inductive kickback diode on your schematic for the relay. Does the relay itself have it?

Also, a value of 10K for R3 seems rather weak for the relay switching transistor. Perhaps 1K or 2.2K would provide improved switching characteristics of the relay.

EDIT:
From my experience, I can only get about 150mA continuous current from a 7805 (without heatsink) with 12V input before thermal shutdown starts to take effect. However if it's input power is reduced to 7.5 to 9V, the available continuous current will significantly increase.

Pull down resistors and fly back diode for relay are actually present on the circuit but I missed to put them on the schematic and transistor base resistors are 1K (my apologizes, copy paste problem :-))

Hi, have you got bypass capacitors on the float switch inputs, like 0.1uF.
How long are the wires from the arduino to the float switches and do they physically run near your power wires.
What value are your pull down resistors?
Its sounds like switching noise getting into the float switch leads.

Tom........ :slight_smile:

Tom, The distance between arduino and float switches is around 40 feet. Yes, these wires are running in same casing of power wires. I too suspected the noise and tried .1 uf across the float switches, but that did not help. I have also grounded the arduino properly to the earth. pull down resistors are 10K. By the way, this problem is not repeated since last 5 days after I replaced Atmega 8 with Atmega328. So I am puzzled why this problem is only with Atmega 8.

Hasn't the 8 got very little in the way of flash and RAM?

Aware of the fact that Atmega 328 has more flash and memory, but never imagined that these two factors could contribute to issues like hanging and resetting. Good to know.

Its time to revive the same topic...

I am facing the exact same issue but the only difference is I am already using a Atmega 328p.

Any suggestions?