There are many different kinds of Arduino boards out there. Most of the time you will find one that fulfill all your needs but, sometime, you may want to build your own Arduino based board. Why would someone build its own Arduino board? Well, I can see two reasons to do that.
Reason #1: Size and space
The size of an Arduino board will fit most applications but, sometime, size and space really matter. The minimum hardware requirement to deploy an Arduino based application is an Atmega328 microcontroller with the Arduino boot loader and a 16Mhz crystal.
Reason #2: Price
The price of an Arduino board ranges from 20$ to 60$ depending on the features you want. This is OK for prototyping but way too expensive for large scale production. You can get an Atmega328 micro-controller and a 16Mhx clock for about 5$ or less if ordered in large quantity.
The micro-controller can be programmed using an USB-TTL adapter. Here I am using the Mini USB Adapter. Some of these adapters are designed to fit on a breadboard and match the Rx/Tx pins without the need of jumper wires. An other solution is to use an Arduino board (like the Arduino Uno) to program the micro-controller and then move it to your final product.
Build it
To build your Arduino clone you only need two components:
- An Atmega328 or Atmega168 micro-controller with the Arduino bool loader.
- A 16Mhz crystal oscillator
Connect the crystal between pin #9 and pin #10. Connect pin #8 to ground and pin #7 to 5V regulated power. The power can be provided by the USB-TTL adapter if you use one.
That’s it. If you want to program your micro-controller you must connect the Rx/Tx pins of the USB-TTL adapter to the Rx/Tx pins #2 and #3 of the Atmega328 micro-controller.
Program it
Once your program is ready to upload, connect the USB cable to your Arduino clone board and click the Upload button of the Arduino IDE. Some USB-TTL adapters are connected to the reset pin of the micro-controller and will reset it before to upload the new code. The Mini USB Adapter doesn’t have the reset pin so you have to manually reset the micro-controller immediately after you clicked the Upload button in the IDE.
You can reset the micro-controller by connecting the pin #1 to the ground. The upload will start when you disconnect the reset pin #1 from the ground. You don’t have to connect it to the 5V since there is an internal pull-up resistor on the reset pin.
In this example the program simply toggles the output pin #13 to which a green LED is attached. The value of a byte counter is incremented every time the LED is toggled and its value sent to the serial port.
byte pin13Value = LOW; byte count = 0; void setup() { pinMode(13,OUTPUT); Serial.begin(19200); } void loop() { pin13Value = !pin13Value; digitalWrite(13, pin13Value) Serial.println(count++, DEC); delay(100); }
You have made an Arduino custom board? Share your project in the Comment section below.
October 12, 2011
“…pin #6 to 5V regulated power…” Shouldn’t it be pin#7 according to datasheet? Or I am missing something…
October 12, 2011
Mmmm … you’r damned right. But then, how in hell this circuit works? Do I have a short in my breadboard? I don’t think so, I would have noticed that on my previous projects. Would that be possible power the Arduino by the pin #6 … that I would not be able to explain. Any idea? Thanks for the update, I’ll update the post.
August 9, 2012
I’ve seen a similar thing on a PIC – the chip has built-in protection diodes on almost all pins, and it turned out that it got powered through one of those diodes.
I wonder if you have a similar case – the USB-to-TTL device (likely powered by the USB port) provides enough power through the Tx pin to power the chip…