SMD Atmega8A AU (1323)

Hello all

I just bought a smd microchip Atmega8A AU (1323) http://botland.com.pl/79-7155/atmega8a-au-smd.jpg .

Im beginner in all that electronics and smd, what i wana do is > https://www.youtube.com/watch?v=30rPt802n1k [u]Shrinkify[/u] my arduino projects and i want to use that Atmega8A AU that i have right now. what i wana do is somehow make my own PCB, solder the SMD microchip and program it with my arduino nano, but the [u]problem[/u] is that i don't know what i need ([u]extra components[/u]) or how to connect it and program it.

Thats all for now, I hope someone can help me, if anyone need something extra to know, don't be ashamed to make questions.

I will be active, Domino60

Youtube_Domino SixO

You have made the wrong choice =( Some are able to solder smd components (with a soldering iron or with paste and hot air), but I can't. The ATmega8A is a little different than the ATmega8, so it might not be compatible with a standard Arduino board. Since you are a beginner, try to stay out of trouble and use as much common used and standard things as possible.

That youtube movie uses an ATtiny chip. You can use a ATtiny85 chip, and make it compatible with the Adafruit Trinket. http://www.adafruit.com/products/1501

If you want an smd component, use the smd version of the ATmega328p.

The best way to shrink a project is to use a small board, like the Arduino Pro Mini. That board has no usb connector, you need an extra adapter board to be able to upload a sketch.

It is even possible to buy two cheap USBasp programmers on Ebay, and use one programmer to write a new sketch in the other one. But even that is not something for a beginner. http://hackaday.com/2011/08/26/dev-board-from-an-avr-programmer/

[u][u]As a beginner i think you are right[/u][/u], I should not use a smd for my projects, i don't have so much experience soldering a smd, so i think i should start with a

If you want an smd component, use the smd version of the ATmega328p.

http://justpushbuttons.com/blog/wp-content/uploads/2011/03/atmega328.jpg with pins and easier to solder.

You can use a ATtiny85 chip

The ATtiny85 have only few pins to write my program, why i need lots of pins is becouse i have lots of sensors to put so i need about 6 analog and 6 digital pins (or more). I think i will try with some kind of microchip.Can you give me a direction again :) how to program or connect the pins and be able to program it with a Arduino nano v3.0 (that the only arduino hardware that i have right now).

Thanks Domino60

Youtube_Domino SixO

Do you want to use the ATmega328p to learn about Arduino ? That chip is used in the Arduino Uno board and also in some Arduino Pro Mini boards. The Arduino Pro Mini has only a few extra components to make it run.

There are tutorials for standalone and for programming. http://arduino.cc/en/Main/Standalone http://arduino.cc/en/Tutorial/ArduinoToBreadboard

You can use the Arduino Nano to test the sensors and the sketch before trying to upload a sketch to your microcontroller.

Do you want to use the ATmega328p to learn about Arduino ?

. Well i have only Arduino Nano and as a beginner i think that will be great to start with.

Do you want to use the ATmega328p ?

Why is there any other microchips that i can use ? As i searched on ebay the ATmega328p its expensive a bit, i will need lots of them, so will be nice if i could use only few components too.

Right now i don't have anything, i need to order from ebay everything, so i need to be sure that everything will work great, until i buy, so i don't want to miss some components to buy, becouse they need a month until they will come to me.

Thanks Domino60

Youtube_Domino SixO

You are right. The ATmega328p DIP-28 is about 3.33 dollars. http://www.ebay.com/sch/i.html?_sop=15&_osacat=0&_from=R40&LH_PrefLoc=2&_nkw=10pcs+atmega328p+dip-28&_sacat=0

The Arduino Pro Mini that I mentioned before has the crystal the 22pF capacitors and the voltage regulator, it is only 2.80 dollars http://www.ebay.com/sch/i.html?_sop=15&_osacat=0&_from=R40&LH_PrefLoc=2&_nkw=arduino+pro+mini&_sacat=0

It can be less than a dollar, with the old ATmega8. If you use the internal oscillator of 8MHz, you can omit the the crystal and the two 22pF. You would have to make your own bootloader, and your own board definition for Arduino. That is something for advanced users. And not all libraries work with the old ATmega8. http://www.ebay.com/sch/i.html?_sop=15&_osacat=0&_from=R40&LH_PrefLoc=2&_nkw=10pcs+atmega8+dip&_sacat=0

I read about the ATmega8A, and it is a drop-in-replacement for the ATmega8. So I was wrong, they are the same (the ATmega8A uses less current). So instead of the ATmega8, you can use the ATmega8A as well. The smd version of the ATmega8A is only 80 dollar cents, but soldering is a problem.

I happen to have a few ATmega8 chips with specific bootloader for the internal 8MHz oscillator and it's own board definition for the Arduino lying around. They come in handy now and then, but sometimes I ran into the problem that not all libraries work on the old ATmega8. I read on this forum how to make the bootloader, but I don't know where I read it.

What is your project ? Perhaps I can make a guess if it will fit into the ATmega8 or ATmega8A.

Well i think im gona use the ATmega328p [u]10x[/u] cost about 20~30$ its not cheap but i need to create (build) my experience from a lower lvl of hardware and easy to build. I don't wana use Arduino Pro Mini, its cheap "wow" i may buy for my own projects someday , but in that project i wana do i need to use just microcontrollers, not arduino. [u](Because i may sell the project that i will build so i don't need trouble becouse i use a arduino product)[/u]

About Atmega8 or 8A i think i bought something that i don't need right now, i thought that will be easy for me but i don't have the materials to solder a smd chip, so i try to keep trouble away. * I may try in the future solder smd with solder paste and put the PCB in my oven.*

What is your project

  • Well my project is simple, i just use few IR sensors to detect stuffs and turn on a alarm or led, or even use a laser to secure the safety from thieves, something like that, well its a multiple project that i need to combine together.
  • it's not complicated but its my 1st time to work with microcontrollers (microchips) so i dont have lost of time, thats why i need to collect lot of info and start to order from ebay.

Btw after i do the bootloader http://arduino.cc/en/Tutorial/ArduinoToBreadboard I will need to keep the

  • a 16 MHz crystal,
  • a 10k resistor
  • two 18 to 22 picofarad (ceramic) capacitors.

For my project ? If you can send me a similar project with ATmega328p how to use is after bootloader will be nice, i need to know what exactly i need.

ps Thanks alot for help.

Thanks Domino60

Youtube_Domino SixO

And a 100nF to 5V and GND to decouple the power supply. The 5 external components is all you need.

Do you have 5.0V ?
Do you need to protect input signals for peaks ?
Do you need a led or so ?

To write a bootloader, you need the MISO, MOSI, SCK, RESET, GND signals
To upload a sketch you need a usb-to-serial adapter and the RX,TX,GND signals.
http://arduino.cc/en/Hacking/PinMapping168

For accurate analog values, you also need 100nF at AREF and for fast accurate ADC values also an inductance and capacitor at AVcc (see the datasheet).

So i need to keep the a 16 MHz crystal, a 10k resistor two 18 to 22 picofarad (ceramic) capacitors.

as they are and add a 100nF (capacitor ?) between 5V and other one to GND

About 5V could be 1A 2A ....nA ? (I may find some batterys) peaks you mean vibrations or sounds that mey effect my circuit ? Yea i will need few leds, why ? :D

about the bootload i will follow from the arduino website the instructions.

Domino60

Yes, the 100nF capacitor between 5V and GND.
The capacitors next to the crystal are 22pF. Everyone uses 22pF and not 18pF.

The current depends on the sketch and the leds. Perhaps 20mA or 40mA for the ATmega328p chip (just a guess).
If it is battery operated, this page will keep you busy for a while: Gammon Forum : Electronics : Microprocessors : Power saving techniques for microprocessors

With peaks I ment electrical peaks, caused by electric or magnetic influences. If you would connect long wires to the Arduino, those wires will pick up all kind of electric noise.

Yes, the 100nF capacitor between 5V and GND.

1 cap. between battery and 5V chip and other one for GND ? or just one for both ?

About the peaks they will influence in PCB circuit too ? and yes i may put several wires there too.So how can i avoid that peaks ?

About the curent, i don't wana put somekind of battery and burn the atmega I will need to use several leds, lets say about 100+ leds + resistors for each led, so 20mA * 100 leds = 2A / per hour thats right ? So if i connect a 5v battery with 3A or 4A that may burn my Atmega ? or i will need to have a battery for atmega and external power for the leds ?

Lets take that example that i writed, the atmega and 100 leds. I don't wana burn my atmega. So about that im thinking to use a smd battery (like a motherboard have on each PC) for the Atmega and external power (battery) for the leds. ** Why im talking about that right now is becouse i have other project that i need to have about 1000Leds so i never thought that there will be a problem powering them.

Domino60

The decoupling capacitor of 100nF is to decouple high frequency noise to/from the 5V of the ATmega chip. You need one capacitor and connect one lead to the GND and one lead to the VCC of the ATmega chip, preferrably very close next to the ATmega chip.

If you have wires connected to output pins, that is not a big problem. If you have input pins with long wires, you can use a protection resistor in the signal line of 1k or 4k7 (100 ohm to 10k).

The ATmega chip runs at 5V (or lower), regardless how much amperes is available.

Will you be using seperate leds, or led strips ? The Arduino can supply the power for a few leds, but not for 100+ leds. You need a driver for the leds. Perhaps you can look for "Adruino led cube" projects.

The ATmega chip runs at 5V (or lower), regardless how much amperes is available.

So i can use a battery (no more) than 5Volts with (how much) Amps i want ? Thats won't burn my Atmega ?

Will you be using seperate leds, or led strips ?

Im gona use separate leds, i tryed with arduino nano before with 30 leds and resistors and its working, The idea from http://ledcalculator.net/ Power supply voltage (V): 5V LED voltage drop (V): 3.0V LED current rating (mA): 20mA Number of LEDs: 30

All in parallel and for each led a resistor.

The Arduino can supply the power for a few leds, but not for 100+ leds.

So im thinking to add a external power for the leds, and control them with a digital output or more.

You need a driver for the leds

I don't think that is realy necessary.

Perhaps you can look for "Adruino led cube" projects.

They use Transistors ..etc, I don't wana add lots of component, i wanna make it with less components i can, or able to work.

Btw

you can use a protection resistor in the signal line of 1k or 4k7 (100 ohm to 10k)

Thant won't affect my sensors ? I mean they will keep working as well as they work without the resistors ? What i mean again, a sensor need a resistor to be protected from the high curent (Amps) but if i put a extra or change the 1st resistor the curent in my sensor will be less and that won't affect my INPUT (analog) signal ?

Domino60

You can run an ATmega chip from 5V 50mA or from 5V 1000A, it only uses the current it needs. But if you accidently drop a screwdriver on a few wires and cause a shortcut, you get a lot more sparks with the 1000A.

The ATmega chip can supply some output current from its output pins. However if you want to be able to control many leds or more, the ATmega chip can not do that. You will need a transistor or mosfet or a driver chip.

The ATmega328p can control at most 40 leds. The digital pins and analog pins together makes 20 pins. If you set the leds at 15mA, you could use two leds per pin for a total of 40 leds. But I don't know if the ATmega328p can do that all at the same time. You should try that and see if it doesn't get too hot. http://arduino.cc/en/Hacking/PinMapping168

You can run an ATmega chip from 5V 50mA or from 5V 1000A, it only uses the current it needs. But if you accidently drop a screwdriver on a few wires and cause a shortcut, you get a lot more sparks with the 1000A.

So as i understand i can use 5v battery with how much Amps i need to power the ATmega and my all circuit, thats good.

if you want to be able to control many leds or more, the ATmega chip can not do that.

Why not ? I tryed once. I connected 15 leds to a digital pin and other 15 to another pin and worked really well, soon i will try a prototype with my arduino how i will connect 5+ leds to each digital pin, just as i understand the PowerSupply need to be with more Amps that your circuit actualy need to run.

You should try that and see if it doesn't get too hot.

About that i will make a list of the components i need and order everything from ebay, and i will try when they will come, because i don't wanna burn my nano :D

Domino60

An output pin can supply 40mA. But I would avoid the 40mA. About 20mA is no problem and 30mA only if you have to.

So 5 or 15 leds to a single output pin is too much. You might blow the ATmega chip. Some leds give light at only 1mA. So you have to measure to see how much current they actually get. With 5 or more leds, they might share the current of an output pin (and they might still blow the ATmega chip).

I wanna my leds get about 20mA each, so as i see i can't skip the hard way, can you give me a link or a direction how to build the same what i need with transistors ex. 100 leds with ATmega.

You can use a NPN transistor with a base resistor to the Arduino. Or a mosfet with a gate resistor to the Arduino. Suppose 15 leds at 5V, each having a resistor to set the current to 20mA, is a total of 300mA. For example the BC337 can do that. For 300mA the base resistor would be 470 ohm. https://www.sqlskills.com/blogs/paulselec/post/arduino-figuring-out-transistors-and-associated-resistors.aspx

For higher currents a mosfet can be handy. You need a 'logic level' mosfet, those accept the 'logic level' of 5V of the Arduino.

You might have a look at specific led driver chips. They can do a lot of things in just one chip. I know you want to keep it simple, but such chips make it simple (in my opinion). http://playground.arduino.cc/Main/LEDMatrix http://playground.arduino.cc/Main/MAX72XXHardware http://arduino.cc/en/Tutorial/LEDDriver

About the led drivers is realy helpful but as i saw to connect more leds you need more led driver chips, and if you need more leds, you need lots of driver leds and + extra ATmega... so in that case i need more money to spend.

Im thinking something else, I calculated and i need about 4 leds per Digital pin, is there anyway to connect the leds to a external battery apart arduino, but to be controled my arduino ? Like the DC motors, yes i know the dc motors use a transistor, but in my case im able to use only resistors ?

Btw i found this http://www.ecs.umass.edu/ece/m5/tutorials/multiple_LEDs_tutorial.html

How should i calculate what kind of resistors should i use between arduino and transistor if i put more leds ? and how should i calculate the resistor between leds and battery ? The same as a normal led between_ power and led ?

You can not create current out of thin air. So you are gonna need a driver or transistor.

The resistor value for the led at 5V is the same as when the transistor (or mosfet) can switch it on and off.

The schematic you found is with a other transistor, the BC337 can handle more current.
Read the datasheets if they can handle the current you want.

The resistor from the Arduino output pin to the base if the transistor is calculated with the datasheet of that transistor.
Suppose the Hfe (the gain) at 300mA is 60.
So the base current should be 300mA / 60 and add another 30% for saturation.
Arduino pin output is 5.0V, and the base voltage is 0.7V.
So (5.0 - 0.7) / (300mA / 60 + 30%) = 661 ohm
(5-0.7)/(0.3/60*1.3) - Google Search ← copy this whole link in the browser