Using current limiting resistors on AVR I/O pins

Today I want to talk about protecting digital Inputs of AVR or any other microcontroller from over-voltages. When you look at majority microcontroller circuits found on internet shared by hobbyists you don’t find any input protection. Some argue that in most cases this is not needed, or simply don’t understand how it works. Lets see how simple resistor can save a day.

Lets see at simplified version of digital input of AVR microcontroller.


We can see there that input uses CMOS logic where transistor is switched by voltage. According to AVR datasheet, gate control voltage should stay within -0.5V to VCC+0.5V range. If we power our device with 5V supply, we need to make sure that pin input voltage stays in range -0.5 to 5.5V. When input voltage source is taken from same power supply, then we don’t have to worry much about it. But what if AVR is accepting digital signals from other sources like sensors, other devices that are powered with their own power supplies. Can we be sure that voltage will always be within safe limits. This is why there are two clamping diodes (sometimes called ESD protection diodes) used. They are here to protect logic from over-voltages and under-voltages. Actually they do their work pretty well… until they die. Lets take situation when voltage at pin is 7V what happens here. D1 Anode voltage is 7V while cathode is VCC=5V. Then we get 7-5 = 2V on diode. But diode forward voltage drop is about 0.7V. Diode becomes unprotected and high current flows through diode until it fails. And so logic becomes unprotected. Same is with under-voltage. If we apply -2V at input pin then diode D2 starts conducting forward from GND to PIN with 2V across. Again voltage drop at diode is 0.7V and so current grows until diode fails. And so if we expect that input voltage may be off limits we need to add current limiting resistor. Continue reading

Understanding 1-wire interface

1-wire devices are commonly used in many applications. You probably are familiar with famous DS18B20 digital temperature sensor in TO92 package. They can be powered and interfaced using same single data line plus ground return of course. 1-wire originally was designed by Dallas Semiconductors Corp. which is also a major provider of 1-wire devices like temperature sensors, timers, real time clocks, memory and well known iButton.

1-wire devices. DS18B20 and iButtons

1-wire interface is a bidirectional, half duplex slow serial communication standard. It doesn’t use any clock signal. When talking of speed, standard data rate is 15.4kbps. But there is possible to overdrive 1-wire communication to up to 125kbps. Continue reading

What microcontroller development boards I have

During time I’ve been purchasing or building various microcontroller boards. Most of them were used just to try things out or because they were cheap to get. So I thought, why not to blow dust away and see what we have here. Maybe there will be some fresh thoughts on where to use them.

collection of microcontroller boards

Probably I should spare a few words about each of them. Continue reading

Microcontroller based apps for android mobile phones

Recently I obtained a Samsung Galaxy Ace S5830 android mobile phone. It was released a year before but it seems to have enough power to run most of apps you can find around.

It is powered by Qualcomm MSM7227 ARM11 processor running at 832MHz. Has internal 158MB of internal memory and can support up to 32GB MicroSD flash card. Other features include GPS, WiFi, 320×480 TFT touch screen, 5MP camera and so on. Device is powered by Android OS v2.3. These are specs you can find on any mobile website. To get your own Samsung phone, check out phones4u.

Smart phone devices are as valuable as there are some useful apps there. So I started wandering if there are electronics/microcontroller related apps that could be useful in daily work. Lets see what can we find in app store. First of all we are interested in free apps. Search on AVR microcontrollers gave me coupe results: AVR Fuse Calculator and Using Atmega128 apps. Lets see what are they capable of. Continue reading

ECE4760 Spring 2012 projects are here

Some time ago we noticed that Cornel University ECE4760 project list started to build up. It seems that the project list is finished with 30 great projects built around AVR microcontrollers. Students as always prove to be creative and inspiring. Like each year they came up with new ideas and implementations. We like that they use free tools to build them. The compiler they use is WinAVR/GCC compiler. So everyone can replicate one or another idea if needed.

It is hard to go through whole project list as it would tike time and we still wouldn’t be able to tell the thing. Some of them really are worth attention like EEG Pong, where device reads brain waves and this controls computer cursor. Continue reading