Hardware/Safety Considerations for AVR projects

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

Hi,

I am quite new to all the micro-controllers and such stuff, I am currently in my first year of Electronics and I have been learning and working on AVR by myself and from this site.


Through the process I have destroyed many AVRs. I have tried to look for a post like this bt haven't found anything on this topic YET.

I need to know what are the safety considerations one should remember while designing an AVR system. I mean if I am giving it input, how should a typical circuit for input be what are the voltage/current limitations. What things to consider for outputs, ADC inputs and other such stuff.

I also want to know about other safety and such things I should keep in mind. I don't want to destroy anymore AVRs, 8) I already have drilled enough to make KeyChains for me and my Friends... :twisted:

PLEASE reply to this as I this as I think this might be beneficial for many other newbies like me and I think this should be made into STICKY if it gets enough answers....

THANKS in ADVANCE to those who will help me and others....

Regards,

Zaid Pirwani
http://ZaidPirwani.com

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

HELP... me and others...

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

Have you read the datasheet? It tells me just about all I need to know - otherwise you're just guessing and dead devices are the result.

If you want to know about protection in specific circumstances - eg automotive or industrial - there has been a few threads on this topic. So help yourself - its all here for you to peruse. And for what isn't answered, a specific question will most likely get a specific answer.

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

Kartman wrote:
Have you read the datasheet? It tells me just about all I need to know - otherwise you're just guessing and dead devices are the result.
Quote:

The DatSheet is a great resource, I have read it, though NOT COMPLETELY, I may have missed somethings, but two of the controllers which I burned were cause I gave them 5V as input, I considered that the high input should be 5V, hence I just need some little practical advice on how to work with the AVR micro-Controller, that's all....

I hope you now understand my situation...

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

Which controller(s) are you using? I seriously doubt 5V did the deed, even on a 3.3V model.

Perhaps there was too much current?

How were the microcontrollers destroyed? Any loud pops/clouds of smoke?

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

To answer your question, what does the datasheet say about maximum voltages on any pin? I can't see why you burned two controllers by giving them 5V input, especially if they were powered from 5V.

The AVR is no different from any other ic when it comes to following the ratings set out in the datasheet. Break the rules and expect smoke. You want the device to survive - stay within the ratings of the device is the simplest advice we could give.

Am I to presume the question you're asking is "why did I burn two controllers"? The answer is "we have no idea" simply because you've provided little information. If you could post the circuit of what you constructed then we'd have a better chance of offering some specific advice.

"My car broke down, what should I do to avoid it happening?" is tantamount to the question you've asked. What answer could you provide to solve my problem?

If you're a total beginner - buy a development board where all the basic stuff is done for you - be it an Arduino or the myriad of boards available today.

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

Actually it's not so easy to destroy AVR's.
One common reason for reporting "dead" AVR's is that the clock fuses have been set wrong.
Lots of posts about that.

If you connect the chip to a voltage higher than it's rated for you might destroy it.
Sometimes the chip seem to survive such mishaps, but it's impossible to tell for sure if some functions have been destroyed.
A couple of weeks ago I managed to connect 10 Volt to my prototype for a couple of seconds. To my surprise it seemed to survive, running the program as before.
Until I discovered that the watchdog never got reset when triggered.

The third way to possibly destroy an AVR is to send conflicting voltages to a pin.
Eg a port pin is set to high output and some external circuit connect that pin to GND.
Any shorts must be avoided.

The fact that you destroyed a lot of chips surprises me.
Makes me believe that you have set your clock fuses wrong.
Maybe describe how you have your AVR connected.
This would help to solve your problem.

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

Quote:
how should a typical circuit for input be what are the voltage/current limitations

You will find the data in an "Electrical Characteristics"/"Absolute Maximum Ratings" section of a specific AVR model. The only important information I could not find there is a maximum current for IO clamping diodes. There is an Atmel applcation note about zero-crossing detector suggesting 1mA is a maximal value.

If you want to know what happens when you violate ANY of the constrains, the answer is "I do not know".

Obey these rules as they guarantee a safe and robust operation.

No RSTDISBL, no fun!

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

mquantz wrote:
Which controller(s) are you using? I seriously doubt 5V did the deed, even on a 3.3V model.

Perhaps there was too much current?

How were the microcontrollers destroyed? Any loud pops/clouds of smoke?

I am using ATmega32 and not the 3.3 version.

I was just giving it output from a sensor and I know that the current was not TOO HIGH.

By destroying the controller, I mean that now it is not behaving as it should, some PINS are internally SHORTED with the GROUND, (even when powered OFF) some are shorted among themselves and other such stuff happened.

SORRY, NO LOUD BANG OR POP NOR SMOKE, that would have been better... :twisted:

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

Use a zener diode to clamp the VCC to a safe level. Follow recommendations for safe handling of parts to avoid ESD damage. Do not power input pins from external devices when power is off on the AVR. That will drive power via the input protection diodes and likely damage the part. If you have a SMPS the zener is important to gaurd agains overshoot as the supply comes up and settles into regulation. Some ICs will die at supplies just above the MAX rating. I know of an Liner Tech part that does this. So NEVER exceed the MAX rating or you do so at your own risk.

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

Kartman wrote:
To answer your question, what does the datasheet say about maximum voltages on any pin? I can't see why you burned two controllers by giving them 5V input, especially if they were powered from 5V.

The AVR is no different from any other ic when it comes to following the ratings set out in the datasheet. Break the rules and expect smoke. You want the device to survive - stay within the ratings of the device is the simplest advice we could give.

Am I to presume the question you're asking is "why did I burn two controllers"? The answer is "we have no idea" simply because you've provided little information. If you could post the circuit of what you constructed then we'd have a better chance of offering some specific advice.

"My car broke down, what should I do to avoid it happening?" is tantamount to the question you've asked. What answer could you provide to solve my problem?

If you're a total beginner - buy a development board where all the basic stuff is done for you - be it an Arduino or the myriad of boards available today.

YES, you are absolutely right, I should have provided more info....

SORRY ABOUT THAT...

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

OK, so thanks to all, I have gone through all the above stuff, now please just guide me a little bit more.

I have an ATmega32, I am using it to drive a robot, which me and a couple of friends made, we are all JUNIORS, micro-controller studies are about 3 years to come in our official class.

I need to know the usual practice of setting up an AVR, I mean I have got an IR sensor which gives voltages in the range of 1V to 4.9V, should I connect it directly to the ADC pins, I have got 8 of such sensors, I need analog input.

I have connected some LEDs as active low(the controller provides ground and the leds are connected to 5V with a 1K resistor).

I have got some push buttons as well connected as active low(when the button is pressed, it will connect directly to ground). The PORT register is HIGH so the PIN register can detect LOW.

I also need to send a signal to another controller, just a LOW SIGNAL and that controller will also send me a LOW SIGNAL at another pin, how to setup that connection or should I just wire them both together. there are 2 pins for this on both uC.

I have also setup 2 PWM channels at OC0 and OC2 and both are connected to 2 H-Bridges, L293D through an OPTO-ISOLATOR

I think that will be enough connections for now, I haven't done these connections, but I am writing my code with this type of connections in MIND...

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

Or more simply to put it here, since I have destroyed a couple of my AVRs, I am afraid to destroy more and need advice from people who know this STUFF.... there is no one here to help me out as my seniors laugh when they see me working cause they think that I will never be able to do it cause I am in first year. But I am very good at learning new stuff.

I need to know the basic connections for a simple LED as active LOW or HIGH, basic connection of an IR LED(receiver), basic connections for a push button and such simple stuff....

I have been learning AVR from books and from this site... but after destroying a couple uC, I am a bit confused....

BTW, THANKS TO ALL!!! you guys are great...

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

For the LEDs you can look for the STK200 schematics at Atmel and then see how they did it. Same for push buttons. For your sensors you did not say if they are off the board or not. I think I would put some resistance between the ADC input and the sensor of at least 300 ohms and then diode clamps to the VCC an GND pins so the input is protected. The resistor limits current to the diodes and also the ESD diodes inside the AVR.

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

some hints:

- user never a LED without limiting resistor !

- apply no voltage on any pin prior VCC or after VCC was swithced off !

- use for experiments a laboratory power supply with current limiting (e.g. 300mA) !

A battery or PC power supply with driving tons of Ampere can easy cause damage !

A low cost experimental power supply can be a 8..12V wall wart with 78L05 behind (limit to 100mA).

AVRs are very robust.
I use AVRs since 1997 and none was damaged until now.

Peter

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

HMmmmm.. robots... You are not trying to drive relays directly from the AVR, are you? Relays (the coil kind, not the solid-state kind) will have a nasty inductive kick when they are switched on and off. That leads to a very high voltage negative spike coming back from the relay to the output driving it when the relay is turned off. That negative voltage can cause all sorts of nasty damage to the AVR.

The standard way to prevent problems is to put a diode across the leads to the relay, anode connected to ground (along with one of the relay leads) and the cathode tied to the AVR output and the other relay lead. This will "short out" the negative spike, preventing damage to the AVR.

Also, if you are driving a relay, how much current is needed to supply the relay? If it is much more than 100 mA, you will need to buffer the signal with a transistor. For specific limits on current sourcing capabilities for your AVR, look at the Electrical Specifications section of the datasheet.

Finally, keep in mind there is a maximum amount of current that can be supplied through the AVR output pins to outside sinks. Again, refer to the datasheet for specifics on your particular AVR.

The suggestions from the others are also along this same line - be sure you are not violating the current or voltage limits of the AVR.

Stu

Engineering seems to boil down to: Cheap. Fast. Good. Choose two. Sometimes choose only one.

Newbie? Be sure to read the thread Newbie? Start here!

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

Quote:
If it is much more than 100 mA, you will need to buffer the signal with a transistor.

Where does this 100mA come from.
Most AVR Datasheets have pins rated at MAX 40mA.
I would not go past 25mA for static currents to eg LED's.

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

Quote:
- use never a LED without limiting resistor !

Do not violate absolute maximal ratings.
Quote:
- apply no voltage on any pin prior VCC or after VCC was swithced off !

Do not violate absolute maximal ratings.
Quote:
- use for experiments a laboratory power supply with current limiting (e.g. 300mA) !

Do not violate absolute maximal ratings...
Do not violate absolute maximal ratings...

It is not that difficult to understand AVRs cannot be operated above/below T=85*C/-40*C, Vcc=5.5V/-0.5V, Icc=200mA/-200mA, iIO=40mA/-40mA, vIO=+0.5V/-0.5V (...) and this list is not that long.

I think that generating the long list of rules he does not understand will not bring him any closer to what he is doing wrong with his uC.

I wonder if there are fully secured kits or simulators for newbies, with a huge LCD and a piezzo which shout out loud:

- you have just violated rule #17: upper clamping diode on PORTB.5 has overcurrent!

or
- you have just violated rule #43: overclocked internal RC above 10% nominal limit - eeprom write failed, content corrupted.

I think such kind of software could be made as a Plug-In for AVRStudio or Proteus.

No RSTDISBL, no fun!

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

Brutte wrote:

I think such kind of software could be made as a Plug-In for AVRStudio or Proteus.
What's next, little explosion on the screen, when you do something wrong?

Wait, http://www.new-wave-concepts.com...

Quote:
However, if the maximum ratings for any components are exceeded, they will explode on screen!
Fogg, all that just because reading comprehension has gone down the drain.

Stealing Proteus doesn't make you an engineer.

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

Quote:
I have got some push buttons as well connected as active low(when the button is pressed, it will connect directly to ground). The PORT register is HIGH so the PIN register can detect LOW.

How are you setting the DDR? Do you realise that if you set the pin as an output you will be shorting it to ground when it's output is high?

Felipe Maimon

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

NEVER feed +5V or short to ground an I/O pin that is programmed as and output. :?

oops didn't see page 2.

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

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

If you are using a plug-in-the-components breadboard, then be careful that you don't have any AVR pins tied to ground or Vcc that shouldn't be. You will burn out the pin on your JTAG or ICE200 if you tie an output pin to either high or low and give it the other polarity though your program.

Make sure that all the chips are plugged into sockets correctly. If pin 1 isn't marked, then find the ground pin on the socket and match it to the schematic.

Generally +5 to +12 volts is safe to use. The only exception is connecting a +12V line directly to an open body wound. Unless you're in some national semi-secret intelligence agency who is asking questions to some poor fool who went down the wrong corridor in the airport, then this probably doesn't apply to you.

If you are working on a project that switches the main 120VAC/220VAC power to an appliance, then use both a triac-opto-isolator and a high-voltage triac. Check the manufacturer's web site for schematics and safety tips.

Keep coffee, coca-cola, and beer away from powered circuitry.

Another dangerous area is old tube-style guitar amplifiers. The tubes require 300-400 volts DC to work properly. Old style cathode-ray picture tubes in television sets and computer monitors can hold a 20000volt charge after being turned off. Don't play around with them. Big capacitors can hold charge also after power-off.