ATMEGA328P footprint and further development

Hello! I am planning to create my own circuit board and asking for a help of smart people to avoid an unexpected performance for my newborn creation. The reason I am asking is that it is my the first ever project and i am not really good at it I guess and I need answers.

Information about my circuit board:
I need a circuit board for controlling 4 DC motors

Information about my circuit board:
I need a circuit board for controlling 4 DC motors

Microcontroller: ATmega328P-AU

But I used this more as reference:
https://docs.arduino.cc/hardware/nano/

Motors: G12-N20

Drivers: TA6586

Now questions. Basically, I need to know whether i did right or wrong:
1)First of all, i want to clarify the choice of the driver. As far as i understood it has three important statistics for me: Rated Voltage : 6~12V, Rated Current: 0.07A, Stall Current: 1A. Important sats of the driver are: Wide supply voltage range: 3~14V, Continuous Output current: 5(typ)-7(max)A, Thermal Shutdown protection, Over Current Limit and Short Circuit Protect Function, and I saw that it can controll speed of a motor. It seems that it is everything I need to know to say that this driver is suitable for me. The biggest advantage for me is that it does not require any binding(not sure that i used the right word, i meant creating proper environment for microchip). The only thing that is worrying me is that the output currency of driver is much higher than the rated current of motor, is it fine? Is there a chance that it will overheat?

2)Is the position of capacitors matters? Are they placed right in my scheme? Basically, I would be glad if someone will observe my scheme, because this is my first one ever made. Mostly i am not sure about the placement of capacitors on the PCB. On scheme the 5V supply comes from between the three capacitors from VCC's side(C1,C2,C3) and the capacitor from 5V regulator's side(C5). And as far as i understand from scheme everything should be supplied from this in between place. On PCB I have energy supply of resistor of RST(R1) before the capacitor on 5V regulator's side(not in between place). Does this matter? Scheme is made by analogy with arduino nano scheme.

3)Overall, I would be VERY glad if someone will just observe my scheme and PCB. My PCB has a lot of unused space, but there will be added more stuff, so that's fine. I just want to make sure that I didn't make a lot of mistakes on the current stage.

I would be very glad to everyone who will type any comments/suggestions! I need and want to improve, HELP ME! THANK YOU!


1 Like

For creating scheme and PCB I mostly used this:

Just trying to make sure that it is as understandable as possible

I may be commenting on a translation issue, if so, ignore.
What you propose making is a circuit board, or device, not a "chip".
The chip is the ATMEGA328P itself, in whichever footprint (package) you choose.

Thanks for clarification! Corrected.

I see you're on your fourth edit of message#1. I'll check back tomorrow, see if it's stabilized.

It is stable, i was just correcting my grammar mistakes. Honestly, English is not my first language, so unfortunatelly I may have some.

1 Like

It is too soon to be designing your PCB. That comes later. At this stage, you have not yet finished researching your choice of components.

Next you must build a prototype. You can do this on breadboard, protoboard, stripboard etc. Only then will you have a circuit that you can test, write and test your code to control the circuit and know if you have chosen the appropriate components and designed it correctly.

Once you have a working circuit and code, you can begin testing the circuit for real, with your motors, over a long period.

Once the testing has given you some confidence that your circuit, code and choice of components is good, then you are ready to design the PCB.

If you try to design the PCB now, you will make mistakes and poor choices and waste time, money and components.

1 Like

I'd place all SMD components on the same side of the PCB. Your project doesn't require that the parts are distributed over both sides.

Why not break out the UART to the outside world? This way you can program the device like a regular Arduino and more importantly, it makes troubleshooting your software a whole lot easier.

Yes. The 100nF decoupling capacitors should be positioned as close as possible to the chips' Vcc pins. It doesn't make much sense to have a bank of them all bunched together. Each of your motor driver's chip should have a 100nF decoupling cap close to it.

See the datasheet; they also mention a 470uF bulk capacitor. You can probably get away with a single 470uF cap for all 4 drivers, but it might be wise to make it larger or place a couple instead of a single one. You can always add the footprints for a couple of parts that you don't actually mount if they turn out not to be needed.

You have no protection on this board; I'd add some. A resettable SMD fuse can save you a lot of trouble, for instance.

Why stick with old through-hole motor drivers on an SMD board? Surely, there are newer, more efficient and sturdier types available now.

1 Like

I agree, that it is correct to follow this path, but:
1)I don’t have that much time to do all your steps;
2)I don’t have a free access to all the boards and chips to make experiments and so on, and i am not planning to buy all that stuff just for once in a life project
3)Why do i need to test something that is already tested just for understanding? I have prototype and etc, but it is working on arduino nano plate, not on a naked microcontroller, so i guess i am fine with prototype.
3)Components that are missing do not have that much of importance. I am not certain with resistors/capacitors that I placed. I don’t fully understand their function and how they need to be placed. Probably I placed objects on PCB not that much conveniently. So if you can help me with my scheme and PCB, I would be very glad to get help from you!

Good luck with your project.

3 Likes

I don’t know, but I just have this strong feeling that I need to make it as small as possible and to use every mm on a plate, otherwise it is bad. I just don’t know, why I have this feeling. What are negative sides of placing SMD components on both sides?

Not sure what the word UART means, you mean ICSP. If you meant my ISCP thing, I thought if it is as close to the connections as possible, it is better. But I agree that if I will move that to the side, it will be much easier.

I used them not for motor driver’s chip, but for microcontrollers VCC. Each capacitor for each VCC leg. As far as I understand from my scheme, power from VIN goes to 5v regulator and then supplies everything including microcontroller through VCC legs. So VCC are inputs for microcontroller. So we need to get rid of noice on the legs of microcontroller for better performance of microcontroller via capacitors, am I right with this understanding?

Honestly, I just couldn’t get what was that. And also I thought that it is needed for microcontroller(probably AVCC), not for drivers. Why do we need that for driver? How does this capacitor is different?

Protection from what? All drivers have it own protection from everything it seems. For microcontroller I guess I simply have to make proper environment, as it is in Arduino plates. Am I wrong?

Honestly, the biggest advantage is that it can be placed just naked, without any capacitors and resistors(without creating proper environment, has all protections inside and if I am correct it suits me with its statistics. So that’s why. Which ones do you consider better?

Not enough thermal relief on the caps. it will require more heat to solder them. Caps are sensitive to heat when soldering

Do not put a via on a solder pad.

image

Check your gnd pours for adequate gnd paths

2 Likes

I saw that it can be connected without any capacitor etc. That is why I chose this driver, I am not fully familiar with the use of capacitors etc, but if it is better to place some, I need to find out where to place and understand the why do I need to place them.

I am not sure about that. The thing That terrifies me is that this driver gives out 5A of current and motor consumes 0.7, so the rest 4.3A must be transformed to heat, am I right? That means that driver can be overheated, right? That is why we need capacitors, right? But I do not understand what capacitors will change. They collect the energy for some time, then give it back, but how is that helpful?

That is why I am here on this forum, asking questions to wonderfully smart people, so I can become a little smarter!:grin:

The natural result of this approach will be that you will have to redesign the PCB several times. Where are you going to order it - in China? This means a month or more.
Wouldn't it be better to spend a week testing now than to receive the board and find out that it doesn't work? - and spend an extra month on the next try?

1 Like

Sometimes, feelings can give rise to objective and sensible requirements. Focus your PCB design on the latter.

Higher cost of manufacture. Higher likelihood of damaging parts with a prototype on a workbench (crushing ceramic capacitors). Less transparent when troubleshooting a PCB ("oh wait...I forgot about that stuff on the other side").

Google it; a.k.a. the 'Serial interface' in Arduino terms.
Your ISP connector is fine where it is. I didn't verify if it uses a sensible pinout.

You should, too. See the datasheet. In general, every IC needs all of its Vcc pins decoupled with a decoupling cap.

Partly. Decoupling goes both ways. It's there to prevent noise from the outside world entering the IC through its power supply, and vice versa it's to prevent the IC's own switching noise from affecting other parts of your circuit.

See above.

It has a higher energy storing capacity, which means it forms a local buffer. Compare it to an assembly line where you have a box of parts next to your seat to work with. The bigger the box, the less impact a disruption of parts to your station will have.

Unforeseen conditions, in 99% of the cases caused by our own oversight. It's easy to make a simple routing error on a PCB, inadvertently short Vcc to GND during testing etc.

That's not quite correct and it's unrelated to the DIP package they come in. The choice of SMD parts is much bigger these days. However, if you feel the current motor drivers you have are the best choice, feel free to stick with them.

No.

I agree with @PaulRB that you need to do some breadboard prototyping first. And I'd also recommend reading up on basic electronics theory; especially Ohm's law. It'll serve you well!

1 Like

Again about the prototyping...
I'll tell you a secret - it almost never happens that the developed PCB is fully functional the first time. You always have to redo something - add jumpers, cut tracks, and so on. This is true even for experienced hobbyist.

Never skimp on tests

1 Like

I don’t really understand what should I test. I have a prototype, Arduino nano with driver motors working. I need to take microcontroller, create proper environment(do not need testing? I just don’t know what is the proper position of capacitors. Proper environment is shown in Arduino nano scheme, so I need to recreate it, it does not need testing If I will understand how to place objects that create environment for microcontroller). If I could do all the stuff you are saying, I would love to, but I can’t. And that is why I am looking for people who will not tell me that you should start all over again, but who will tell me what is wrong in my scheme and PCB, why and how to make better. That’s all.

Do you recognize how your board is different from an Arduino?
Edit: I missed your 16MHz crystal - probably because you forgot to add the required capacitors on both sides!

Have you established that there's no unforeseen condition that can induce a voltage spike on your Atmega's RST line that will send it into high-voltage programming mode, erasing the contents of the flash?

There are so many things that can (and will) go wrong and that you don't anticipate.

1 Like

You didn't recreate the Nano environment on your PCB. The location of the chip and resonator on your board is not the same as the Nano. And in the case of a controller operating at 16 MHz, the length and even curvature of the tracks can matter.

You want to do it without tests, so that someone experienced can look at your design and confidently say - it will work. But that doesn't happen. And this way you will never learn anything.

It's up to you though. When you start remaking this board for the third or fourth time, you may remember the advice that was given to you here :slight_smile:

2 Likes