DIY Arduino Tutorial

Make your own Arduino using just the basic through-hole components - blank ATMEGA328 chip, caps, resistor, crystal and switch. If you can't be bothered, get a Pro Mini from ebay. Costs about the same but then there's no brag factor.

A bootloader needs to be burnt into the ATMEGA328 chip so that the IDE can talk to it and program the flash. You can either use a chip programmer like the AVR Dragon or another Arduino board to act as one. I used an Arduino Pro Mini since I have plenty of them lying around pretending to be useful. I use OptiLoader from Bill Westfield. It's a quarter of the size of the standard Arduino bootloader and starts up faster. It is also simpler to use.


1. Wire up a Arduino Pro Mini to a USB serial adapter like the Sparkfun FT231X breakout board.



2. Download Optiloader from here. Unzip into a directory structure below:



Run the Arduino IDE.

Tools -> Board -> Arduino Pro or Pro Mini
Set the Port to the USB serial adapter port.
File -> Open -> select optiLoader.ino
Upload sketch.

3. After the upload, unplug the USB adapter to power down the device. Connect the Arduino Pro Mini to the standalone ATMEGA328 chip. D10=Pro Mini pin, PIN1=ATMEGA328 physical pin.

VCC -> VCC
GND -> GND
SS(D10) -> RST(PIN1)
MOSI(D11) -> MOSI(PIN17)
MISO(D12) -> MISO(PIN18)
SCK(D13) -> SCK(PIN19)




4. Plug in the USB adapter now and open a Serial Monitor window.

Tools -> Serial Monitor
Select 19200 baud.
In the terminal window, enter G and click Send. OptiLoader will be burnt into the ATMEGA328 chip.

5. After the bootloader is burnt, disconnect the Arduino Pro Mini and wire the USB serial adapter to the circuit.





The DIY Arduino is now ready for programming. The standard blink test worked perfectly and comparing the max available flash after build,

Arduino bootloader
Sketch uses 1,030 bytes (3%) of program storage space. Maximum is 30,720 bytes.
OptiLoader
Sketch uses 1,030 bytes (3%) of program storage space. Maximum is 32,256 bytes.

We have a winner! Right, jolly good. Now...time to chuck it in the bin and order a real Pro Mini.