I love my Arduinos. At any point, I have quite a few projects on the go – prototyping is just so easy with them. But sometimes, I want to keep the project functional without buying another Arduino. Spending $30 each time for a fairly simple microcontroller than I only need some of the functionality for is just silly. It’s at that point that building an Arduino clone becomes a viable option.
The Truth: You Can’t Build a Full Arduino Clone For Cheaper
The Arduino itself consists of simple electronics, but it’s the package and the layout you’re really paying for. In this article I’ll outline how to replicate some of the functionality for a lot cheaper – in the case of “permifying” your Arduino projects – but it’s impossible to build a full DIY Arduino clone without having mass-purchasing power and production facilities.
The beauty of building your own is that you can exclude bits you don’t need to keep costs down, and avoid the Arduino package with all the unused headers and wasted space – if you really need the Arduino shape and headers for use with other shields, then building your own isn’t really going to save you any money.
In my case, I wanted to permanently display the LED cube I made somewhere, with an external power supply and not the added cost of using a full Arduino board; there was space left on the protoboard after all, so I’d rather put everything there. Here’s my finished DIY Arduino in breadboard stage, alongside the LED cube and an actual Arduino used for programming. The next step is to put all the bits on the protoboard, but that’s out of the scope of this article today.
Anyway, on with the project. I’ve broken it down by section with individual component lists, but it’s easier to just buy a bundle (Oomlout.co.uk, £7.50).
Power Supply Regulator & Indicator LED
- 100 uF capacitors (2) – careful of the silver line which faces the negative side
- 7805 5V voltage regulator (1)
- RED led and 560 Ohm resistor
The purpose of this section is to take a 7-12v power supply (typically a 9V DC plug) and regulate it down to 5V needed by the microcontroller chip. The red and blue leads coming off left should be connected to whatever input power you’re using, but absolutely do not use more than 12v or you’ll fry things. Also, connect the top and bottom rails together at this point.
If you’re piggybacking off an existing Arduino to program the chip (described later on) you can also connect the power rails directly to the +5V and GND.
Microcontroller & Timing Circuit
- ATMega328P-PU – preloaded with Arduino bootloader.
- 22pf Capacitors (2) (in the diagram they’re blue, but the component I bought were actually orange – no difference. There is no positive or negative to these).
- 16 MHZ crystal.
For brevity, I haven’t shown the power regulator in the diagram below, but you should of course already have that bit finished.
This part is the core of an Arduino – the microcontroller. The 16mHz crystal provides a constant timing signal which pushes each cycle of the circuit.
Also to make things easier on yourself, either purchase some of these Adafruit pinout labels ($2.95 for 10):
Or make your own. Here’s a PDF I made if you have sticky label sheets.
Finally, we just need a reset switch – luckily this bit is pretty easy; but note that in some tutorials you will find a pull down resistor added. I believe this is needed for ATMega168 and not 368.
Here’s the finished diagram.
The Dx’s and Ax’s are then your regular Digital and Analog I/O pins. If you choose not to make life easier on yourself with a printout, please be very careful not to confuse anything says D13 or pin 13 on the Arduino, with pin 13 of the ATMega328. They are different – D13 is actually pin 19 on the chip. RX is also functionally D0, and TX is D1.
Programming The Chip
Before you can test this out, you’re going to need some way of programming the ATMega chip – this is where the complication comes in. On an Arduino board, one of the most expensive parts is the USB interface.
Here’s your options:
1. Take The Chip Out Of Another Arduino.
This is the easiest route for quick testing; just use an existing Arduino board with your working sketch already on it, and pull out the chip from the Arduino. If your project is finalised and working, just swap them around. You can throw another unprogrammed chip into the Arduino to use again – there’s nothing special there.
The only downside here is that it’s very easy to damage the pins, so be VERY careful when removing them.
2. Use A Passthrough Cable From An Existing Arduino.
Before attempting this, you must also remove the existing chip from your Arduino; it will interfere with the process. Essentially we’re just going to use the USB interface of the Arduino. Connect power and GND to the standard Arduino pins; Reset; and the most important part – RX to RX (D0), and TX to TX (D1) – these are the send and receive serial pins then you should be able to use the USB port on your original Arduino.
3. Buy An FTDI USB To Serial Interface Cable.
This is basically a replacement of the interface included in all Arduino’s, but pretty pricey at around $15 – and is the main reason why you can’t cheaply build an exact replica of an Arduino. If you plan on doing this a lot though, getting one of these that you can just keep on the end of a USB cable is probably the easiest route to go.
For instruction on adding this, follow the diagram provided by Oomlout, only taking note of the USB programming interface shaded area. Use the 6 pin header to connect the actual interface.
Note that all these methods assume you have an Arduino bootloader already burnt onto the chip; if you buy as a component bundle, for example, they will be provided ready to simply swap out. If you buy the chips on their own or not specifically for an Arduino purpose, you’ll need to use something else to burn the bootloader first. There’s a good tutorial here on piggybacking an existing Arduino and an application called OptiLoader for that purpose. The difference is about $2.
So, before buying another Arduino for the next project, ask yourself: do you need the USB connection, and do you need to connect Arduino shields? If the answer to both of those is yes, then go ahead and buy another Arduino – it won’t work out any cheaper by building your own. Otherwise, just build one yourself! And don’t forget to check out all the rest of ourand articles.