I'm not sure if this is the place where I should ask this type of question or not but please if anyone could give me guidance. I have just completed an arduino prototype and I would like to move it to a fixed PCB.
To do this I am assuming I would need the ATmega328P chip soldered so as to not have the whole arduino. My queston is to be able to upload the code would it be as simple as swapping the chip into an arduino uno board, uploading the code, removing the chip and soldering it on the pcb? Does this work like this and the code is kept permanent?
Also since I won't be having the arduino's USB B port, how will I supply the board power, I mean like through which pins? I am thinking of using a rechargeable battery and a charge port. Would I need to conncet the power supply (battery) to the VCC pin?
I will also be attaching the schematic below and if anyone could tell me if for this project it is fine to connect directly a 5V power supply/battery to the chip without any other component it would be fine. (with this I mean that if I just need the 5V battery + charging port and not any intermediates like a transistor, resistor...).
The following and final question is specific to kiCad, which is probably not appropriate for this forum but if anyone knows, I would really appreciate if anyone could guide me with this. When footprinting, how do I know the diameters and sizes are correct for my components? because I get like multiple buzzer options with different names:
buzzer_12.9.5RM7.6
buzzer_15.7.5RM7.6
but I don't really know what the difference is or if it actually is useful for my buzzer in terms of diameter and separation of the gnd and power pins,
It probably is something stupid I have not realised but if anyone knows please let me know, I will greatly appreciate it.
Thank you a lot in advance for all contribution and all guidance.
It sounds link you are not yet ready to make this PCB.
Instead, your next stage of prototyping should be to use the standalone ATMEGA328 chip on a breadboard to make your circuit work.
You can keep the circuit simple by omitting the crystal and associated capacitors and running the standalone ATMEGA328 at 8MHz, which is more than fast enough for most projects.
If you are moving a chip from an Arduino Uno to a PCB then use a socket on the PCB. Don't directly solder the chip.
How are you going to program it ? Unless you are removing the chip to program it you will need to break out some header pins.
If you want to lift a chip from a Uno and install it on a PCB then the PCB has to match the Uno configuration with respect to the 16MHz crystal and the load capacitors. For any chip to be functional on a Uno it has to have a bootloader.
You start with the data sheet and should find an engineering drawing of the component. There you'll find measurements like pin pitch etc. In Kicad, you can view the footprint and measure the essential details. If you've just buy the components from Aliexpress etc. you have to have a way to accurately measure component dimensions and know how to create your own footprints.
There are some issues with your schematic such as a missing flyback diode on the buzzer and no external pullup resistor on the reset pin. Have a look at the schematic for a Uno or classic Nano or 5v Pro Mini to see what else you might be missing.
Ok wait, let me get this right, the arduino has a power of 16 MHz right, but the ATMEGA328 on its own is 8MHz but crystal and capacitors can make it sort of overclock and double the speed? So i could essentially use the ATMEGA328 as I have mentioned so on its own but for future projects that would require more power I would benefit from crystal and capacitors? Just confirm if what I am saying is correct and I will make sure to investigate further how the Arduino works and how I would implement the crystal and capacitors
Not quite true. A Uno with or without a bootloader can be programmed using ICSP. In fact, once you have programmed it that way it will definitely not have a bootloader
I am using an active buzzer, I think it is piezoelectric, it is the traditional one that comes with arduino starter kits but what is a flyback diode anyway and why would i need it specifically for a buzzer?
You don't need to build a board from scratch the first time out. With the product shown you can add sockets for ICs, etc. and solder small stuff like resistors and wiring directly to the board.
Many devices like relays, speakers, motors and solenoids contain wire coils. When a current flows through the coil, a magnetic field forms around the coil. When that current is then turned off, the magnetic field collapses, and that collapsing generates a voltage in the coil. This voltage is in the opposite direction to the rest of the circuit and that can damage other components such as an Arduino pin.
A flyback diode, if placed in the right place in the circuit, can allow that negative voltage to harmlessly flow through it and so protect the other components.
Why not keep it simple, if you are using a UNO then use a Nano and put header pins on your PCB so you can plug and unplug the whole PCB.
That way you already have 90% of the design done, with a proven circuit.
Here is an example, using strip board and Nano and headers.
by what I have researched, the buzzers are distinguishable between active and passive depending on if you can see the green pcb or if it is covered in like the black plastic and mine is covered in that black plastic hiding the pcb and thanks on the explanation of the flyback diode
Depending on where you live, clone nanos can be had for between $3.00 and $5.00 USD from Amazon or AliExpress, etc. It runs at 16Mhz, and has the programming port.
Yes the same code, just change the board in the IDE.
As @MarshaJ847 has pointed out the low cost and the fact you don't have to do all that design work.
This is why I asked the question. You don't understand the difference at all.
An active buzzer will make a sound, a tone, if connected to a power source. It contains it's own oscillator circuit which has a single, fixed note, which can be switched on or off by connecting or disconnecting it from the power source.
A passive buzzer won't make a sound when connected to a power source. Maybe a click at the moment you connect it, but no tone. It doesn't contain an oscillator circuit and needs an external oscillator. An Arduino pin can be that oscillator, and an Arduino pin can change it's note and play a tune.
The part of a buzzer that actually makes the sound can be one of several designs. The two most common types are piezoelectric and magnetic.
Piezoelectric types contain a small crystal which changes shape slightly when a voltage is applied to it. The crystal is fixed to a sounding plate (usually metal) which amplifies the sound. Only a small current is required and this type can be connected directly to an Arduino pin without damaging it.
The magnetic type has a wire coil which is suspended inside the magnet's field. A current flowing through the coil makes it move inside the magnetic field. A cone (usually paper) attached to the coil amplifies the sound. This type cannot be directly connected to an Arduino pin because it would damage the pin. Too much current is required for the pin to supply, and there are those negative voltages I mentioned before.
You need to check them against the datasheets. That goes for all components you use. Yes even the resistor and LED and that is true for all CAD softwares, not just KiCAD
The MEGA328 can work at 8MHz or less using its internal oscilator. It can work at lower voltages than 5V at lower speeds (useful trick). To work at 16MHz it needs 5V and the external crystal with its capacitors.
You can define the speed by setting the fuses of the chip (something else to take a look later).