Standalone Atmega328P-PU Servo: Is everything fine ?

Hello I am beginner with electronics and I just need to know if the schematics is fine. I tried this with UNO and external power supply, with GND's connected and worked fine. Now I am not sure if it will work, I make PCB at home and don't want to waste time or money, thanks for help :slight_smile:

Here is my schematics:

Here is my board :

The switch 2 and 3 are just holes for one two-states switch...

You're at least missing one very very very important component which is the 100nF decoupling capacitor as close as possible to the ATmega328p.

And you always have to keep an eye on the power when you share power between micro and servo. Servo's are very power hungry and can draw a lot of current in bursts which can drop the voltage quite a bit. So I rather not share the 5V directly. I'll rather give both there own regulator or at least decouple the micro power from the servo power by adding a (Schottky) diode between general/servo Vcc and micro Vcc with an extra capacitor for the micro (which the servo's can't drain because of the diode).

Also posted at:
https://stackoverflow.com/q/45270830

Also:

A GND test point is nice.

Power LED is always nice.

Suggest having the option of adding a .1 μF capacitor on each wiper to GND (for stability).

Are you sure you want Aref going to VCC.

Do you want an external reset switch?

I would add an FTDI header.

Your GND is too narrow, use a GND plain, connect islands with jumpers to GND or 0Ω SMD 1206 resistors.

You shouldn't have a trace between the crystal pads.

Widen your Vcc traces.

.

All agreed :slight_smile:

Extra thing, add the option for a resistor between Vcc and every servo signal. You can add a 4k7 resistor onto that if you use SG90 servo's and make them a whole lot less violent at startup.

Aref must not be linked by wire to Vcc.
Aref can be programmatically linked to:

  • Vcc
  • Internal reference (1,1V)
  • External reference (any voltage between 1,1V and Vcc)

If you choose internal reference (1.1 V) and if Aref is connected by wire to Vcc you will destroy your microcontroller.

The most important concerning Aref:
It is absolutely necessary to place a capacitor (100 nF) between Aref pin of microcontroler and Gnd pin which is just beside. As close as possible of the two pins Aref and Gnd, it is very important.

It is not by hazard that Atmel has placed a Gnd pin right next to Aref that is why it is compulsory to make good analog measurements. Otherwise measurement will be noisy.

Hello, so I made some edits in my schematics and please let me know if is everything fine :slight_smile: Thanks

Better take more time checking your own work :wink:

.

Do you want the LED on PB0 which is D8.
Or
Do you want the LED on PB5 which is D13?

Now updated, is everything fine ?

Main Schematics:

Schematics with VCC:

Schematics with GND:

Servo are D2-D7
Led is D8

Thanks for help all of you guys :slight_smile:

"Led is D8"
Not D13?

I suggest you add a Schottky diode between the switch and the servo power line to help stop noise from the servos from effecting the the controller.

You need 100nF capacitors for power supply noise de-coupling (snubs out high frequency noise).

You can use SMD capacitors for the 100nF, solder them to the foil side of the PCB.
A 1206 spacing is 0.12" or ~3mm.

I usually add pads for all I/O pins, in this case D9-13.
This way you can easily solder things to the PCB if you need to for unfoseen items.
Example you might need to add a switch.

I would also recommend you to have a few extra pads for future GND connections .

Okay, thanks guys. I followed all your steps and now I am going to build my first double-sided PCB. Thanks for help :slight_smile:

If you are building this yourself, I suggest building a single sided PCB and use jumpers to go over traces as needed, even if you need many.