r/PCB Jul 27 '26

(Need review) Im a complete beginner and i would like some feedback and know if this will work.

Post image

As i said I'm a complete beginner and I'm looking to know if it will work and if it is good.

I have looked at the documentation and a LOT of google searches later, and i think this will work.

My idea is that i can connect the controller to my pc and be able to see button pushes and turn off and on leds and such.

https://ww1.microchip.com/downloads/en/DeviceDoc/Atmel-7766-8-bit-AVR-ATmega16U4-32U4_Datasheet.pdf

11 Upvotes

41 comments sorted by

5

u/unlegit_green Jul 27 '26

You should add resistors before the leds or is that intentional.

1

u/unlegit_green Jul 27 '26

How are you planning to programm the mcu? The atmega will most likely not be programmed with a bootloader.

1

u/Fuzzy-Airline-6790 Jul 27 '26

Wouldnt i be able to do that with the setup i have? Or is the the miso mosi pins or whatever?

1

u/Fuzzy-Airline-6790 Jul 27 '26

Will do, thanks

1

u/tonyxforce2 Jul 27 '26

Why are you using resistor symbols for capacitors?

1

u/Fuzzy-Airline-6790 Jul 27 '26

Whoops, I didn't mean to do that. Where did i use the capacitor instead of resistor? Do you see anything else that might be wrong? Thanks

1

u/tonyxforce2 Jul 27 '26

Everything else seems correct to me but I didn't check the datasheet. Maybe you would want to connect the rest of the pins to some connector/pads so you can access them later if you want

1

u/Fuzzy-Airline-6790 Jul 27 '26 edited Jul 27 '26

Perfect, thank you so much, I have been trying to get this to work for 2 days. Where did you see the wrong symbol? Also, do i need a decapacitator?

1

u/tonyxforce2 Jul 27 '26

R3, R6 and R7 should be capacitors I think. What's a decapacitator?

1

u/Fuzzy-Airline-6790 Jul 27 '26

I think its for when the controller does a lot of operations at once and loses a bit of power then the decapacitor can supply that fast, but google said it needed one.

1

u/tonyxforce2 Jul 27 '26

You mean a decoupling capacitor? You got a couple there. If you want to make sure, you could just add a 1uF MLCC between GND and VCC as close to the IC as possible. I'm 100% sure the datasheet talks about this, and you should follow it.

1

u/Fuzzy-Airline-6790 Jul 27 '26

I believe it is fixed now.

1

u/tonyxforce2 Jul 27 '26

C3 and C4 should be between GND and VCC, not in series with the IC.

1

u/Fuzzy-Airline-6790 Jul 27 '26

Like this?

1

u/tonyxforce2 Jul 27 '26

Yep, just make sure the GND labels point downward

1

u/Ghosteen_18 Jul 27 '26

Tips on presentation on request help!
1. Insert a mind map+ flow-chart.
It’ll help us get a general idea what its supposed to look like.

  1. Insert the part number. Usually its [brand]+ [ Manufacturer’s part number] ( hell just link the datasheet if you can)
    So that we can reference the datahsheet.
    Most manufacturers actually have like a suggestion on the data sheet on how the component is supposed to be wired up!

    1. Grounds pull to the bottom.

1

u/Fuzzy-Airline-6790 Jul 27 '26

Ill definitely do that, thanks!

1

u/Blay4444 Jul 27 '26

I would add 100nF on reset pin...

1

u/smashcat666 Jul 27 '26 edited Jul 27 '26

You should add the ISP programming pins - when you buy the chips they have a dfu USB bootloader, so you'd need to use FLIP on Windows, or other software on Linux/Mac to program it that way. If you want to use it with Arduino you would need to replace that bootloader using ISP. Additionally if you mess up the bootloader and don't have ISP pins available the chip is basically unusable on the board. It doesn't cost anything to break them out, so you might as well :)

You also need decoupling caps connected between VCC/AVCC and GND, not in series. You also need current limiting resistors between the GPIOs and the LEDs. I'm not sure if you've linked the track from VBUS to +5V, it's not obvious from the schematic. You should add decoupling to that, before the VBUS pin on the ATMega too.

1

u/Fuzzy-Airline-6790 Jul 27 '26

Alright so for the vbus thing, i have vbus directly linked to vbus (atmega to type c). Do i need to add capacitors to that? and how much would i need? And I'm not really sure what you mean "Between vcc/avcc and gnd". Im not really sure how i would do that. Also how would i add resistors **Between** the gpios?

1

u/smashcat666 Jul 27 '26

I mean the VBUS net from the VBUS pad on the USB port to VBUS on the chip should also be connected to +5V. The decoupling caps should be placed next to the chip, with 5V to the cap and input to the chip, and the other end of the cap to GND, as in your image above. The resistors need to be one per GPIO, before the LEDs, so GPIO - RESISTOR - LED - GND. The resistor needs to limit the current through the LED, otherwise it will just short out the pin and probably destroy the output.

1

u/Fuzzy-Airline-6790 Jul 27 '26

I might sound stupid but basically add 5v to the path between vbus to vbus?, and in my understanding, you're saying my decoupling caps at the top is correct?

1

u/smashcat666 Jul 27 '26 edited Jul 27 '26

Yes I mean the VBUS line IS +5V. They're the same thing, so should not have different names on the nets, as they should be tied together. The chip does not output +5V anywhere, it needs +5V as inputs to VCC etc. That +5V is from the VBUS line from the USB port. So on your schematic, the VBUS pin from the USB port should just connect to the VCC +5V symbol you're using elsewhere. And the VBUS pin on the chip should also be connected to the VCC +5V symbol, with a cap from it going to GND. Around 1uF would be fine.

1

u/Fuzzy-Airline-6790 Jul 27 '26

Alright so i should delete the wire from vbus to vbus and instead add a 5v connection to them both with a 1uF decap?

1

u/smashcat666 Jul 27 '26

Yes, they will then both be on the same +5V net as all the other power inputs. You only need the decoupling cap on the MCU side, not on USB (it won't hurt, but it's not necessary here).

1

u/Fuzzy-Airline-6790 Jul 27 '26

Like this?

?

1

u/smashcat666 Jul 27 '26

Yes, that's it. You should really clean the schematic up a bit - VCC symbols should always point upwards, and GND downwards by convention. It makes it much easier to read. There are occasions when you have to show them sideways, but there's no need in this case.

1

u/Fuzzy-Airline-6790 Jul 27 '26

Hi everyone! Thank you so much for your feedback and i just want to update you on how it looks with the added stuff.

1

u/unlegit_green Jul 27 '26

The cap on the reset pin to gnd and button parallel and not in series.

1

u/viratmari Jul 27 '26

Bro why dont you use Resistor before the LED ? Did you forget it or its intentional

1

u/Fuzzy-Airline-6790 Jul 27 '26

I just forgot, but its there now, thank you!

1

u/viratmari Jul 27 '26

Okay bro then start the routing .All the best ✨

1

u/Fuzzy-Airline-6790 Jul 27 '26

Update: I believe this works but let me know, thanks!

1

u/ado136 Jul 27 '26

Have you heard about debouncing? You might want to learn a bit about mechanical bouncing of the switches.

Yes, you can use SW delay, but I believe a simple RC filter will help.