Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Input pins Voltage for Atmega8

Status
Not open for further replies.

skmdmasud

Member
Hi..
I am planning to build a brake light for my car with led using atmega8 which will do some flashing and fading etc.. My atmega8 vcc and ground will be using 5V regulator with proper cap. My uC will receive input from

1. Car Brake light wire
2. Car Parking light wire
3. Car reverse light wire

So there will be three input. Now the thing is all this inputs are 12V or 13V. Can i just use a 10K resistor with this 12V inputs, will it burn the uC pins?

Regards.
 
While you can just use a series resistor and rely on the input clamp, it is much better pratice to use a voltage divider. 7.5K over 4.7K yields 4.32V at 12V in and 4.688V at 13.8V in, more than enough to read a logic 1. *I* would also use a 5V TVS, just to be safe. Automotive power supplies are notorously noisey, and can see up to 60V on the 12V bus during a load dump (AC compressor turns off), so when you do your power supply, keep this in mind.
 
Last edited:
While you can just use a series resistor and rely on the input clamp, it is much better pratice to use a voltage divider. 7.5K over 4.7K yields 4.32V at 12V in and 4.688V at 13.8V in, more than enough to read a logic 1. *I* would also use a 5V TVS, just to be safe. Automotive power supplies are notorously noisey, and can see up to 60V on the 12V bus during a load dump (AC compressor turns off), so when you do your power supply, keep this in mind.

Thanks Mike :), voltage divider is what i will do. I looked at TVS diode but couldn't find part number, can you please suggest some common TVS parts used everyday, i have never used TVS so dont know if they are available in my area. Do i connect the TVS with the input + and - at the voltage regulator input pins?

Is there any other precaution that i should take to protect my uC when used in cars specially old and rusty models;).

Thanks and Regards...
 
A TVS is like a zener diode... the cathode goes to the + side, and the anode to the -...
here is an example of how they are used...
Example 1 is a good example of how your power supply should look. A diode (D5) to protect against reverse voltage hookup, forget D6, D1 is the TVS @ 18V, a power resistor, then a 12V zener (D7). This cleaner 12V then feeds your 5V regulator and provides clean 12V power for whatever else your board may use.

Example 2 is a 5V zener, doesn't need to be on your 5V line (like mine), but it wouldn't hurt, and it can also go on your ADC inputs.

You can also go to digikey.com and type in a search for TVS, and you will see a wide variety of through hole and surface mount TVSs.

View attachment 68628View attachment 68629
 
The input TVS clamps the incoming voltage at 17.1 to 18.9V. The resistor drops the incoming voltage to 12V, where the zener maintains it. You don't need this on every input, just your power supply. Example 2 shows an SA5.0 which is a 5v TVS to use on the ADC inputs. When your system is running off battery, your 12V will go down by I * 20 ohm (20mA draw = .4V drop). The regulator is good down to 7V. You can adjust this downward for less drop at higher currents.
 
Last edited:
The output of the transformer is 12V, but I clamp at 18V as you don't want to clamp under normal operation. The DC equivilent may be a little above 12V.

SA5.0's are made to operate on a 5V line.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top