Arduino freezing after few minutes :/ Software worked for 24h and now it won't.

I have serious issue with my Arduino UNO. Seems that uC start freezing up without any obvious reason.

I start playing with PWM but it seems that LCD and everything what were connected to Arduino were loosing power for some reason.

I attached screen from oscilloscope . On left you can see red cinnected to Arduino +5V out and yellow is connected to I/O PWM (8Hz).

Those blanks in yellow and red are moments when arduino seems to be loosing power (LCD going dark, loosing some letters after 5-10 seconds from start), after some time everything freezes (state is still high seems to be but LCD isn't refreshed at all)...

What is the weirdest is that it worked for over 48 hours without any issue, Today I start experimenting with PWM (for motors and backlight) and despite noise this is what I got. It isn't working any more without PWM.

Seems to be damaged....

Those blanks in yellow and red are moments when arduino seems to be loosing power

I can't see any blanks in the red it looks like the power is continuous. It looks like the software is being reset or is glitching which can happen with noise on the supply from motors etc.
So what are you driving, how is it being powered and what decoupling are you using on the supply?

Grumpy_Mike:

Those blanks in yellow and red are moments when arduino seems to be loosing power

I can't see any blanks in the red it looks like the power is continuous. It looks like the software is being reset or is glitching which can happen with noise on the supply from motors etc.
So what are you driving, how is it being powered and what decoupling are you using on the supply?

Thanks for reply.

Seems that issue show up when I'm trying to control backlight from software (without backlight function PWM has some pauses).

I'm not using any decoupling yet as :confused:

I'm driving 2x 12V fans powered by bench power supply (which introduce a lot of noise btw).

At this moment connection for fans looks like :

uC -> 1N4001 -> BC517 (B) -> FANs (ground as live is connected to power supply as transistor connects to ground)

Nothing else.

I guess I need to first add something to separate it.

I'm not using any decoupling yet

That is almost certainly your problem.
To say you are not using it because there is other noise about is a bit perverse.
See
http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html

Grumpy_Mike:

I’m not using any decoupling yet

That is almost certainly your problem.
To say you are not using it because there is other noise about is a bit perverse.
See
De-coupling

It turned out that those moments from screen were caused by crazy temperature sensor.

Turned out that there is very big noise from PWM (on 34kHz, connected to diode and BC517).

De-coupling of power supply I don’t think it would an issue as it is really good digital bench power supply and without PWM there is no issue what so ever.

Now issue is that PWM at 34kHz causing some big noise. Previous issue without PWM were caused by breadboard (loose cable ? I don’t know I moved it few times and since then it is working fine without PWM)…

I tried to filter some noise by capacitor but I have only 25V 10uF and it is lowering voltage to much to turn on transistor (0.7V)

How can I filter noise between diode <-> IO without lowering voltage so much ???

De-coupling of power supply I don't think it would an issue as it is really good digital bench power supply and without PWM there is no issue what so ever.

You might think it is not an issue but you would be wrong. I don't care that it is a good power supply you still need decoupling on the device itself.

I tried to filter some noise by capacitor but I have only 25V 10uF and it is lowering voltage to much to turn on transistor (0.7V)

??? capacitors do not lower the voltage on a line they smooth it.

Grumpy_Mike:

De-coupling of power supply I don't think it would an issue as it is really good digital bench power supply and without PWM there is no issue what so ever.

You might think it is not an issue but you would be wrong. I don't care that it is a good power supply you still need decoupling on the device itself.

I tried to filter some noise by capacitor but I have only 25V 10uF and it is lowering voltage to much to turn on transistor (0.7V)

??? capacitors do not lower the voltage on a line they smooth it.

Well any way I solved issue by lowering PWM frequency :slight_smile: (to 30Hz (from 31Khz)). Noise is gone, and Arduino seems to be working fine. Only issue which left is LCD.

I have connected LCD to 5V from arduino (same problem is on separate power supply, so not an power problem), backlight is connected to PIN 8 and GND.

Problem is that despite configuration PWM (turned off, frequency, turned digital HIGH) I have some noise on LCD.

Problem is that whole LCD is "waving" and one letter is always changing to something else (but only on second page of menu, nothing else is changed, only 1 position (no matter what were there before).

I checked few pins and it turned out that for example PIN4(ch2) and PIN6 (ch1) starts from 5.119Hz (PIN6), and 31.457Hz(PIn4), after a while (30-90 seconds), frequency changes to 44Hz (PIN6) and 206Hz (PIN4).

Voltage rise from 4.5 to around 4.9V .

Any idea what it could be ?

I will just add that:

if (BacklightCounter > 45){
digitalWrite(BacklightCounter, LOW);
}

This code makes it swapping character after backlight goes off...

carmamir:
Well any way I solved issue ... Arduino seems to be working fine ... I have some noise ... Any idea what it could be ?

Still seems to me that you are completely arbitrarily ignoring Grumpy_Mike's advice to add decoupling capacitors to the power supply and I don't share your confidence that it's not a power supply issue. That aside, until you provide a copy of the code and a circuit diagram I don't see any way to come up with any other suggestions.