Your own Arduino using Atmega328P
- What will you make/learn?
You will learn how to program Atmega328P as a standalone Arduino chip.
Difficulty level: Medium
- What you need for this? (Components + skill level)
- How will you do it with these components?
We will first burn the bootloader of Arduino in Atmega328P to make it work like standalone Arduino and then we will program Atmega328P with Arduino IDE.
- What is schematic?
Burning Bootloader to Atmega328P:
Put Atmega328P on breadboard and connect it to Arduino as shown in circuit schematic below.Also connect 10K resistor, 16MHz crystal oscillator and 22Pf capacitor with Atmega328P.
- How to Burn Bootloader?
- Connect Arduino UNO to PC and open Arduino IDE.
- Go to File->Examples->11.ArduinoISP->ArduinoISP.
- Upload the sketch to Arduino.
- The go to Tools->Programmer->Arduino as ISP
- Then got Tools->Burn Bootloader
- Wait until bootloader is burned into your Atmega328P
- Uploading Code to Atmega328P
- Now disconnect wires from pin 10,11,12,13 of Arduino UNO.
- Connect the reset push button as show in schematic.
- Remove ATMEGA328P of Arduino UNO
- Open Arduino IDE and go to Tools->Programmer->AVR ISP
- Select appropriate port of your Arduino UNO and upload blink code from File->Examples->01.Basics->Blink
- Now connect LED to digital pin 13 of Atmega328P
- Pin mapping of Atmega328P is:
- Now you can also disconnect Arduino UNO and can connect VCC to 5v power supply and GND to ground of power supply to get a Standalone Atmega328P.
- Reference to previous tutorial
To learn how to upload code to Arduino see Tutorial#1