diy arduino schematic

Build Your Own Arduino & Bootload an ATmega Microcontroller – part 1

There are many reasons to build your own Arduino circuit on a protoboard or a custom-designed printed circuit board. At the heart of the Arduino platform is an AVR microcontroller, in usual way you need a special hardware programmer and suitable hex files to program the Atmel AVR chip. Fortunately, Arduino is a beginner-friendly platform because a bootloader is included in the AVR chip which allows you to program the board over the serial port without any dedicated AVR programmer.

The bootloader is basically a small hex file that runs when you turn on the Arduino board. At first looks around to see if the computer (at the serial port) is trying to program it. If so, it absorbs the program code from the computer and transfers it into the AVR chip, in a specific location so as not to overwrite the bootloader. If the computer isn’t trying to upload any code, it instructs the microcontroller to run the code that’s already stored inside.

arduino uno r3 schematic

Original Circuit Diagram: Arduino UNO R3

Now, have a look at our favorite Arduino UNO to find out the AVR chip inside. It is ATMega328P-PU, a low-power version of the traditional ATMega328-PU. The P indicates pico for pico-power which is a technology ATMEL has developed that allows the microcontroller to run with less power. This ATMega328 chip holds a pre-burned bootloader, allows you to upload code without using any additional hardware. So if you are in a plan to make your own open source microcontroller platform – Arduino, no doubt, you need an AVR chip with pre-charged bootloader!

This part of AVR tutorial will teach you how to make your own Arduino chip, ie Atmega328P with Arduino Bootloader. First we need one blank Atmega328P-PU microcontroller with a few supproting components:

  • Atmega328-PU/ Atmega328P-PU – 1
  • 16Mhz Xstal – 1
  • 22pF Ceramic Capacitor – 2
  • Small Breadboard / Protoboard & 28-Pin (PDIP) IC socket – 1
  • Your Arduino UNO board (here used as a programmer)

If you go through the Arduino IDE you can see an example sketch called “Arduino as ISP”. If you upload this code to your Arduino, it will basically act as an AVR programmer. Next, set-up your Arduino as an ISP. Here is the procedure:

  • Plug in your Arduino UNO (through USB) to your computer
  • Open the Arduino IDE
  • Open → Examples → ArduinoISP
  • Select → Arduino UNOfrom Tools Board →
  • Select your Serial Portfrom Tools Board →
  • Upload the Sketch (When finished, close the IDE and disconnect your Arduino)

arduino software interface

It is probably easier to just install the bootloader from the Arduino IDE. Arduino takes care of all the messy details for you when you burn bootloaders through it. Finally, prepare the hardware by following the wiring diagram shown here. Keep an eye on the pins MISO, MOSI, SCK, Power, Ground, and Reset. These are the pins you’ll need to flash the firmware on your chip.

atmega328p programmable pins

As stated, the easy way to upload the bootloader involves using the Arduino IDE. Open your IDE select the board you want to program. Then select the programmer (since you are using the Arduino as ISP you will also need to select the COM port that the Arduino as ISP is connected to). Then select Burn Bootloader. This will take the board you selected and look up the associated bootloader in the board.txt file. Next, it will find the bootloader in the bootloader folder and install it.

P21- 4

Yes,now you have an Arduino Chip! You can use this for your next standalone Arduino Project, or to make your own little Arduino board. However, keep it in mind that this is not the one and only proven method for making an independent Arduino chip. You can find numerous ideas, tips and tricks everywhere in internet. Next is the complete schematic diagram of a little Arduino board for your everyday projects. Use the Atmega328P chip, with Arduino bootloader loaded by you, as the brain of this economical circuit.

diy arduino schematic

There are many circuit diagrams available online for building an Arduino on a protoboard, but after an extensive research and after some little tweaks, I’ve come up with this tried and tested circuit. I hope this will help those who want to play in the Arduino world but can’t afford a full fledged, luxurious Arduino Uno board.

Where is the USB?

Yes, you are right! The USB port for interfacing Arduino with your PC is missed here. In Arduino Uno boards, there is an smd chip (IC) which works as a USB to serial converter, allows us to program the Arduino using our computer (Uno R3 uses an ATmega 16U2). Fortunately, this is not a serious problem for you because you can buy a ready-made USB to Serial Converter Module as a powerful and economical alternative resolution!

Part 22: Bootload an ATmega Microcontroller & Build Your Own Arduino – 2
← Part 20: Working With Bootloaders & Build Your Own Bootloader – 2


Join the conversation!

Error! Please fill all fields.
  • airton-migueljuniorgmail-com

    Hi, your explanation is awesome! I´m professor too!
    If I mount an Atmega328 on breadboard and use a FTDI to the serial/usb communication between my circuit and the computer, using Arduino IDE to program the Atmega, a program like “led blink”, it will not work? Is the bootloader indispensable? Thank´s a lot!

    • T.K.Hareendran

      Thank You!

      Yes, bootloader is significant here because normally you need a special device to perform the programming task. However, with the bootloader, programming of the standalone AVR chip through the USB interface is possible.

  • u-duttahotmail-com

    can we make bootloaded atmega32, how it can be, and how will be the ardino pins,
    please reply.

    • T.K.Hareendran

      Atmega32? I have not yet worked on it, but when I do get it working I will certainly share!

  • John

    Are you calling this poortin of the code?:spheres = new GameObject[x, y];for (int a = 0; a < x; a++){for (int b = 0; b < y; b++){spheres[a, b] = GameObject.CreatePrimitive(PrimitiveType.Sphere);spheres[a, b].transform.localScale = new Vector3(0.025f, 0.025f, 0.05f);spheres[a, b].transform.position = new Vector3((float)a * 0.05f – 4.0f, (float)b * 0.05f – 2.0f, 0.0f);}}It would appear that the object doesn't exist or have a transform yet.The callstack is definitely helpful, do you have the Exception that's being thrown, though? Feel free to drop me an e-mail at richardpianka at gmail dot com if you want quicker responses.

  • Eric Jan

    Yes, it’s nice to build your own Arduino, in your own projects you don’t allways need the USB interface, and for some projects you only need 3.3 volt for logic levels, you use a 3.3 v regulator, so you don’t need level shifters.

Looking for the latest from TI?