Making your own Arduino clone board can help you save money. Or if you want to create a board specifically for your purposes, then this project is for you! Create an Arduino board using low-cost electrical components purchased from Amazon. Simply follow these simple, step-by-step instructions. Have fun with this DIY hacking tutorial!
Connecting the Components Together to Make an Arduino Clone Board
You can either etch a PCB to make your custom components, use a prototyping dot board to solder the components on it, or arrange the components on a breadboard. Connect the components as shown in the image below. To make your own custom Arduino board, just a few components are required.
A voltage regulator supplies the Arduino with 5V, its supporting circuitry filters the voltage, and finally, a 16Mhz crystal and its parallelly connected 22pF capacitors serve as the clock.
For testing reasons, an LED is connected to pin 19 of the ATmega. If you wish to etch your PCB, use the schematic. Change the schematic to make your Arduino board suitable for your ideas. If you wish to make a custom PCB, use this EAGLE schematic file: DIY Arduino Clone PCB.
Uploading the Bootloader to the Blank ATmega Chip (Optional)
If you have a blank ATmega chip and wish to upload the Arduino bootloader to it, follow this step. Those who already own an Arduino bootloader chip may skip this step and just install their chip according to the schematic in the previous step. With an AVR pocket programmer or another Arduino, you may bootload the blank chip. Here, I'll go through both approaches.
AVR Pocket Programmer Use
I prefer uploading the bootloader using this technique since it works most of the time. You only need to purchase an AVR pocket programmer. After you have that, you will be able to burn the bootloader to several types of ATmega chips. The blank chip should be inserted into the Arduino board's socket. As shown in the diagram above, connect the programmer to the Arduino.
Navigate to hardware > Arduino > board s.txt in the Arduino installation folder. If you're using blank ATmega328P chips, skip this step and check the page for the name of your chip and the bootloader (Duemilanove or Uno). Check the values of the following parameters: eFuse, hFuse, and lFuse. Now we'll set the fuse bits for the blank chip. Paste the following commands into the terminal (for Linux users) or command prompt (for Windows users):
NOTE: Substitute the values for the efuse, hfuse, and lfuse parameters after checking the boards.txt file, and edit “m328p” in the below command to your chip's name only if it is not an ATmega328 IC.
avrdude -b 19200 -c usbtiny -p m328p -v -e -U efuse:w:0x05:m -U hfuse:w:0xD6:m -U lfuse:w:0xFF:m
Next, use the command below to upload the bootloader or your hex program file. Go to the path of your program file or bootloader (/hardware/arduino/bootloaders/atmega) from the command prompt or terminal, and instead of “hexfilename.hex”, substitute the name of your file.
avrdude -b19200 -c usbtiny -p m328p -v -e -U flash:w:hexfilename.hex -U lock:w:0x0F:m
Now the file will be successfully uploaded to the ATmega chip.
use a second Arduino as an ISP
If you're using another Arduino to bootload the chip, then make connections as per the diagram above. You will also need two Arduino boards for this: one will be a working Arduino board, and in the other, a blank ATmega chip needs to be inserted. We will be using the ICSP (In Circuit Serial Programmer) pins on the Arduino for this.
After making the connections shown, connect the working Arduino to your PC. Next, open the Arduino IDE and go to the tools menu; select burn bootloader, and from its options, click on Arduino as the ISP. Now, the chip will be boot-loaded with Arduino. This method only works if you have the correct chip specified in the boards.txt file and works only rarely. That's why I always prefer the first method.
Uploading the Code and Using the Board
Now you have an Arduino board with an Arduino bootloader ATmega chip. use the Rx, Tx, and Gnd pins to connect to a USB-UART TTL converter, which can be used to connect to your PC. Or just insert a chip that has been uploaded with the program (from an Arduino board) into this board's socket.