Today we will learn how to build a standalone ATmega328p board. The same chip used in the Arduino UNO board. It’s Arduino UNO compatible which means that you can program it from the Arduino IDE without any hustle.

Used Components

ComponentQuantity
ATmega328p microcontroller1
L7805 voltage regulator1
PCB DC Socket1
Slide switch1
Push button1
5mm LED2
16MHz crystal oscillator1
100n ceramic capacitor1
22PF ceramic capacitor2
10uf polarized capacitor1
330 ohm resistor2
10 kohm resistor1
2.54mm Female pin header2

ATmega328P Bare minimum configuration


Before building our standalone ATmega328P chip Arduino compatible board, let’s take a look at the awesome Arduino UNO board and see the main components that used to build that beautiful thing.

Arduino UNO board
Arduino UNO

The first main component is the ATmega328P chip which is the brain of the board. A Voltage regulator that regulates the input voltage to a 5V clean output which gets used mainly by the ATmega320p chip. The 16MHz crystal oscillator, that creates an electric signal with a given frequency. Simply it counts the seconds so you don’t have to. Some LEDs to make you sure that the board is running smoothly and still alive. DC Plug allows you to connect the board to a DC power source. USB Port allows you to connect the board to your computer. Some pin headers to interface it with the external world(sensors, motors, LEDs, ..) through some jumper wires.

After knowing the main components used in the Arduino UNO board, we can make one using the same main components that we stated before which is called the ATmega328P bare minimum configuration.

Schematic


Bare Minimum Configuration
Bare Minimum Configuration

Wiring Diagram


Bare Minimum Configuration On Breadboard
Bare Minimum Configuration On Breadboard

As you can see, the bare minimum configuration means using the smallest possible quantity of components that makes that thing runs without problems. but later on, we will add some more components like LEDs, buttons, pin headers, .. to spice things up.

the ATmega328P works at 5V that must be well regulated without any spikes that’s why we are using a 10microfarad capacitor between the 5V power line. in order to make the ATmega328p runs, you have to apply a HIGH logic value “5V” on the “reset” pin.

The “Reset” pin is an active low pin, which means if you applied a LOW logic value “0V” on it, it will restart the chip. So we keep it HIGH to make it disabled.

Usually, the ATmega328P chip works on a 16MHz crystal oscillator placed on the pins 9 and 10 but in order to make it oscillate it needs two 22Picofarad capacitors connected to the GND.

But we want to spice things up, let us add some more components to give the board more features and make it more user-friendly.

Schematic


Final Schematic
Final Schematic

Cairoduino V1.0 Board


Cairoduino board
Cairoduino board

We added some new components to the bare minimum configuration that we discussed before to add more features to the board and make it more simple to use like a very normal Arduino UNO board.

  1. DC Power plug to make connecting the board to a power source easy and fast.
  2. L7805 voltage regulator, so you can plug it to any power source ranged between 7V-12V and the L7805 chip will regulate that voltage and give the ATmega328p chip a well-regulated 5V. The difference between the input voltage and the output voltage will go in a form of heat.
  3. Reset button, to be able to reset the board easily in case of any misbehaving.
  4. power LED as an indicator that tells the user if the board is connected to the power source or not.
  5. On&Off switch.
  6. pin headers to allow the user to connect any electronic components like sensors, LEDs, switches, … to the board easily using some jumpers, like any Arduino board.
  7. FTDI breakout board, to be able to connect the board to the laptop so you can program and upload the code to it easily without removing the ATmega chip itself.
Components Value
Components Value

PCB Manufacturing


This board is designed on Eagle from Autodesk. You don’t have to be a PCB design expert to make or own this board because it’s fully open-source you can download the whole project from this link.

If you need this eagle project as a template so you can customize it according to your needs, you are very welcome to do anything you want to the project.

Cairoduino PCB Board
Cairoduino PCB Board

You can order your own Cairoduino board from PCBWay in just Two clicks. from this link.

PCBWay project page
PCBWay project page

From my point of view, PCBWay has the most user-friendly web-based interaction design in the industry! You can instantly get the quotation of your PCB, you can also check the order fabrication and processing status online in your account panel, After your PCBs are sent out to your address, you can track your order shipping status online and a lot more.

Uploading the bootloader to the chip


To be able to use the Arduino IDE to program the chip, we need to burn the bootloader to the Atmega chip. At this step, we need an Arduino UNO board we will use it as a programmer by connecting the MOSI, MISO, SCK pins between the ATmega328p chip and the Arduino UNO board.

If you already have an ATmega chip with the Arduino bootloader pre-loaded you don’t need to do these steps.

Uploading bootloader wiring
Uploading bootloader wiring

After connecting the ATmega chip with the Arduino board, we need to open the Arduino IDE –> File –> Examples –> ArduinoISP –> ArduinoISP

ArduinoISP Code
ArduinoISP Code

Then, set the Programmer to Arduino as ISP. Tools –> Programmer –> Arduino as ISP.

Setting the programmer
Setting the programmer

Now, it’s the time to burn the bootloader, Tools –> Burn Bootloader.

Burn the bootloader
Burn the bootloader

FTDI breakout board


FTDI breakout board
FTDI breakout board

As we stated before, we are using the FTDI module to connect the Cairoduino board to the laptop so we can program and upload the code to it, also you can send, read some stuff back and forth to the serial monitor through the established serial communication.

connecting the FTDI breakout board
connecting the FTDI breakout board
Connecting to the laptop
Connecting to the laptop
Don’t connect a DC Power source to the board while you’re connecting it to the laptop. connecting the board to two power sources at the same time is too heavy on it to handle.

LED Blinking


Let’s try to upload a hello world code to the board to see if it behaving as expected or not. open Arduino IDE –> Examples –> Basics –> Blink

after connecting the board to your laptop and hitting the upload button, you should see the built-in LED which is connected to pin 13 blinking every 1 second. if you want to know more details about how LED blinking works you can check this tutorial which we published before.

Author

junky Egyptian hardcore maker passionate about making some cool electronics random stuff, software and meme addict.

Write A Comment