AVR Freezes (Literally)

Go To Last Post
23 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I made a twinkling star ornament using 80 ultra-brite LEDs
and using an atmega168 to generate random 8bit values at
PORT D. The port switches 8 transistors on/off and that makes
the LEDs twinkle.

I hung it in the porch window last night and when the temp got
down to the 40's it simply froze with all the leds ON.

When I brought it back inside and warmed it up a bit it again
ran normally?

The atmega168 is running using the internal rc oscillator...is this
perhaps what is wrong? will cold temperatures mess up the rc osc
so badly it will simply freeze a running program?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

with all the leds ON

If you hold your AVR in reset, are the lights all on or all off with your circuit?

What I'm wondering is if the device is battery-powered and you have the brown-out detector on and the voltage drops due to cold batteries, the AVR will go into reset.

Another possibility is condensation/frost creating a conductive path somewhere in your circuit.

AVRs (and the internal oscillator) should run fine in porch temperatures, unless this is an Antarctic porch in mid-Winter.

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

AVR should be fine so I suspect it is something else (I have been testing an atmega168 in the chamber just this week at -40C (or F))

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The LEDs are on when a port line is zero and off when it is a 1.

I built no reset switch into this simple project so I'm not sure
what state they are in if you hold reset.

Brown-out is not enabled.

When the circuit freezes all port D lines are zero since all LEDs
are lit up.

The ornament is powered by a LARGE wall-wart. The entire circuit draws
3.8 amps when all LEDs are lit. Voltage never drops below 4.90, the
V+ is regulated by a 7805/2N3055 with attached heatsinks.
(these surplus wall-warts powered some sort of computer)

This thing is sooo brite that it lights up the front yard enough to walk
in from the driveway without a light :)

It runs forever when inside in the warm air...fails soon when placed
in the cold.

Maybe it is just this one AVR...I will have to unsolder it from the circuit
and stick in another one to test.

I have to figure this out before I make more ornaments as I am going
to embed them inside clear Castolite and there will be no repairs possible
after that.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I vote for the bateries getting too cold.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yahbut, it is wall-wart powered.

Lee

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Gwen,

Try adding a say 1 Meg resistor across the crystal pins.
This may cause the oscilator to run a bit faster but as temprature drops it may come back into something a bit more reasonable and keep on running.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Dumping ideas..
Since this is on internal oscillator, and it doesn't sound like condensation on the reset pin, that leaves the power supply as a way in. It also sounds like the most probable reason. WHY are you running without BOD or other reset circuitry?
"7805/2N3055" sounds like a 7805, possibly with a diode in it's GND pin to increase the voltage to 5.6, and then a 2N3055 voltage follower. How much capacitance do you have on the 7805's output, and across the extra-voltage diode? 7805's can get rather strange when there isn't enough capacitance, and temperature is low. If the answer is "The datasheet said optional!", read it more carefully and make certain you have at least 1uF (no extra-voltage-diode) or 2*2uF (one over the extra-voltage-diode and one across the 7805 output). Otherwise they'll oscillate in really funny ways.
How much capacitance do you have on the emitter? When you drop the load (turn off the leds), the transistor won't turn off instantly, causing a positive spike. I'd say 10uF will be enough to catch the spike.
How much capacitance on the input? This sounds like a project with long wires, long wires have inductance, and you're switching loads rapidly. This could cause the voltage on the 7805's input to glitch low, causing the 7805 to act funny.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

try a can of freeze spray on ea. individual component, keep the ps inside and run a longer dc cord (for diagnostic purposes).

Rick

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

My suspicion is that the problem is a bad solder joint somewhere that contracts in the cold.

Ralph Hilton

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

My suspicion is that the problem is a bad solder joint somewhere that contracts in the cold.

Could be possible. If there is an extra I/O pin or "regular" LED available, tickle that at intervals to see if the app is still "running". I don't remember any mention of the watchdog timer (hmm, but that wouldn't explain the symptoms, would it?). When it is cold and you restart the AVR, does the app restart?

Will Mom be happy if you plug-in in the kitchen and put your ornament in the freezer and check it periodically? ;)

Lee

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

BTW, for the type of app you describe get yourself a can of HumiSeal "polyurethane conformal coating" or equivalent and spray your completed and tested circuit boards before final assembly/encapsulation. Trust the people at my place that have done industrial production apps for years--uncoated circuit boards subjected to changes in humidity/moisture over time >>will<< eventually have problems, transient or permanent. On a desk/office app you would never see the symptoms.

Lee

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

Last Edited: Fri. Dec 9, 2005 - 06:29 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
BTW, for the type of app you describe get yourself a can of HumiSeal "polyurethane conformal coating" or equivalent and spray your completed and tested circuit boards before final assembly/encapsulation.

Ditto on that! It is expensive, but good stuff. I have stuff on drilling platforms and in
refineries, (very corrosive H2S and salt) and no problems after many years!

Last batch I bought was $200 for a gallon!

Tom Pappano
Tulsa, Oklahoma

Tom Pappano
Tulsa, Oklahoma

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Gwen -

How are you driving the LED drive transistors? Are they junction or FET? Are they N or P? You say that the LEDs are on with the port pin low. What sort of a drive circuit are you using? High-side or low-side switch?

Have you verified whether or not the port pins are twinkling when the LEDs are all on?

Jim

 

Until Black Lives Matter, we do not have "All Lives Matter"!

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
You say that the LEDs are on with the port pin low.

Ooops, I stated that backwards...I'm used to turning LEDs on when the
port pin is low (just like on the stk500) but this time I had to do it backwards
to drive the little pn4401 transistors.

This wal-wart is actually a short cord with a black plastic bricklike thingie
on the end.

Quote:
"7805/2N3055" sounds like a 7805, possibly with a diode in it's GND pin to increase the voltage to 5.6, and then a 2N3055 voltage follower

That's correct, except I used a small resistor instead of the diode ...good idea
to use a diode for this though..I'll try that next time :)

This is for sure a power supply problem! Last night I placed my cousin's bench
supply inside the house and ran a power line out to the ornament and powered it
that way...it twinkled all night in the cold without problems so I have to rebuild the
power supply circuit on the board...I will do so while keeping in mind your suggestions
KKP..

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It occurs to me that maybe the AVR port isn't going to a low enough voltage to turn off the transistors properly when it's cold. I've had this problem at room temperature. A power diode (1N4001 etc) between the transistor emitters and ground would raise the threshold voltage enough to cure this.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I thought of this thread while taking down my holiday lights.

Was the root cause of the problem ever discovered?

Lee

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It was the power supply.
Everything cleared up when I made the supply
exactly like the schematic in the datasheet.

I made about a dozen Christmas thingies inside shadow boxes
and all of them worked perfectly...I had a lot of fun making them.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Nice new avitar Gwen :P.

Although unrelated to your problem, i've had AVRs freeze before. Well, specifically just my butterfly after I tried to draw too much current from the USI Port; the AVR will now completly freeze until reset if I attempt to change any of the USI system or related port pins (this took a hell of a long time to figure out, including pulling out several older firmware versions and going "Waaaa??"). Just an anecdote.

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
Nice new avitar Gwen

I was getting pretty sick of seeing my chubby face and the 'HAPPY 2006'
and I'm sure everyone else was too...so I changed it for this..at least I look
thin, don't you think? :)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

T'was not chubby as far as I could tell :).

The new avtiar is.....very pink and feminine. Actually, I need a good way of saying somthing along the lines of "GOOD GOOD - I may be able to pust a butt picture but that is going TOO far" :D. I'm pretty damn sure Smokey will be along in a moment to give his vocal opinion and save me the trouble ;).

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I think I will change my avatar regularly... the same one gets boring after a month or so.
I wonder why some peoples avatars get to be bigger than 60x60 ? it's unfair... :)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Mine used to be larger than 60x60 (I kept mine for about a year and a half, then changed in honour of my new project :D) - I believe the limit has been imposed recently. Well, more recently than a year and a bit ago.

Butt (hehe) seriously, your new one isn't so bad, so long as I adjust the brightness of my display. I just liked the older one better.

- Dean :twisted:

Make Atmel Studio better with my free extensions. Open source and feedback welcome!