Sunday, April 5, 2015

Building a DIY Arduino Clone (2): Choosing Parts

Table of contents
  1. Building a DIY Arduino Clone (1): Introduction
  2. Building a DIY Arduino Clone (2): Choosing Parts
  3. Building a DIY Arduino Clone (3): Burning the Bootloader
  4. Building a DIY Arduino Clone (4): Assembly to Completion


Last time I explained that a DIY Arduino clone comes in two flavours: internal clock and external clock.
The parts list is nearly the same for both, so I'll cover everything together.

Here's what the finished board looks like with the parts introduced in this post.
This photo shows the external-clock variant.
DIY Arduino clone board

The Arduino UNO is 140 mm × 90 mm. This DIY version is 45 mm × 35 mm — about one-third the size.
With smarter component placement you could probably shrink it further.

The trade-off is that there are no USB or external power connectors, and commercial shields won't fit.

Here's what you need to build one.
I'll split this into tools you only need once, and per-unit materials.

【Tools (needed once)】

FTDI USB-Serial Adapter


Check on Amazon An essential item for any DIY Arduino build.
Since there's no onboard USB connector, you connect this module to the microcontroller chip and use it to upload sketches from the Arduino IDE.

There are several variants — ones with cables attached, etc. — but the small dongle-style adapter linked above is cheap and compact, so that's what I recommend.

Normally you'd use jumper wires into the sockets, but for this build I'm planning to add pin headers matching the adapter's pinout so it plugs directly into the board.

Side note: if you wire it backwards, it applies reverse voltage and dies instantly. That may just be me, but I've killed enough of these through carelessness that I deliberately buy the cheapest option available.

Arduino UNO


Check on Amazon Yes, you need an Arduino to make an Arduino. The trap.
It's used to burn the bootloader onto the ATmega328P chip.
Any Arduino board will do — doesn't have to be a UNO.

If you're happy with the internal clock, Switch Science sells pre-bootloaded ATmega328P chips, so you can skip the Arduino entirely.

10 µF Electrolytic Capacitor


Check on Amazon Supposedly required when burning the bootloader.
…That said, I managed without one. Don't blame me if you try the same and break something.

Soldering Iron


Any will do, but one with a fine tip for precision work is recommended.

You'll obviously need solder too. If you're new to soldering, a desoldering pump is worth having — fixing a solder bridge without one is seriously painful. Basically impossible.

Breadboard


Check on Amazon A small one is fine.
Used for a test assembly before committing anything to solder.

The 85 mm board linked above can fit two ATmega328P chips side by side.
With one acting as the programmer and one as the target, you can build a compact bootloader-burning setup on a single breadboard.

【Materials (per board)】

ATmega328P-PU


Check on Amazon The main chip. The DIP package (with legs) is the "-PU" variant;
there's also a "-AU" surface-mount version.
Order the wrong one and you'll have a very bad time soldering.

The linked listing comes pre-loaded with a bootloader configured for the internal clock.
You can overwrite it for external-clock operation, but if you're burning a bootloader yourself, the bare chip from Akizuki Denshi is cheaper.

Either way, buying chips one at a time makes shipping costs disproportionate.
This is true of electronic components in general — unit prices are low enough that small orders rarely make sense.
Buy in bulk, or pick them up in person at Akihabara when you can.

Universal PCB (Perfboard)


Check on Amazon The linked listing is a pack of 25.
"I don't need 25" — you might think that, but buying them individually is expensive and silly.
If you plan to build a lot, this is the sensible choice.

That said, at this price point the quality can be inconsistent — edge cracking and delamination are not uncommon.
If you're making something as a gift, you might want to buy from a seller known for consistent quality.

Pin Headers or Pin Sockets


Check on Amazon Breakable pin headers.
Amazon is great for buying from sketchy-looking suppliers with a little confidence.
If you're near Akihabara, Akizuki Denshi is cheaper.

Check on Amazon If you want to use shields, Arduino UNO-compatible pin sockets are available.
Though if you're going to all that trouble replicating the exact pin layout… just buy a UNO. (I'll stop there.)

16 MHz Crystal Oscillator


Check on Amazon Only needed for the external clock variant. Skip it if you're using the internal clock.

A blazing-fast 16 MHz. Not 16 GHz.

LED


Check on Amazon Hardware stores carry these, but they often charge around ¥300 each.

Online you can get 100 for about ¥200.
Yes, 100. That's online shopping for you.

The LEDs at the link have a small dome and short legs, which makes them quite easy to work with.

0.1 µF Ceramic Capacitor


Check on Amazon Two per board.

The seller at the link offers hard-to-find low-unit-price components in small packs at very reasonable prices — worth knowing about.

Shipping costs add up, so consider ordering resistors, capacitors, piezo buzzers, and other high-consumption items all at once.

22 pF Ceramic Capacitor


Doesn't seem to be available on Amazon — get it from Akizuki Denshi.
Two per board. Not needed for the internal clock variant.

10 kΩ Resistor


Check on Amazon Expensive at hardware stores, but ¥42 for 20 online.
Shipping is ¥230 though.

So again — buy in bulk or head to Akihabara.

1 kΩ Resistor


Check on Amazon


I've left out a few optional convenience items like a tactile button, but nothing strictly necessary.

Unit prices are so low that shipping always stings when ordering online.
If you're in the Greater Tokyo area but Akihabara is a stretch, there's a quirky little shop called Edison Plaza in Ishikawachō (Yokohama), or STC Fuchu in Bubaigawara (Tama area) — both have a character all their own.
I'll introduce them properly someday if I feel like it.

Next time: we finally start building.

No comments:

Post a Comment