Note: this was going to be one post but it’s ballooned into a huge thing so this is one of several which will be posted over the next few days. Stay tuned!
So you’ve got a nice Arduino board for experimentation and you’ve built a circuit on a breadboard which you’d like to make permanent.
It’s expensive (and overkill) to use a new arduino each time you build a new circuit you want to keep. Here’s how you can easily build an arduino-compatible board, from complete scratch, for a few pounds/dollars/euros so you can keep your real arduino for experimenting with…
I assume you already have an arduino (we’ll need it to program the arduino bootloader on the ATMega chip). You can get ATMega chips with the arduino boot loader burned in already, but I’ve even saved that expense and used a stock Atmel ATMega168-20PU (available in the UK for about £3, I got mine from http://www.bitsbox.co.uk/), and we’ll cover burning the boot loader in a later post.
We start with the vero board (AKA stripboard). Stripboard is simply a board with copper tracks running across it, with pre-drilled holes in it. It’s simply a permanent version of a breadboard.
The stripboard we’re going to use should be a MINIMUM of 23 holes long (across the tracks) and 14 wide (along the tracks). This will make the board around 37mm wide and 58mm long – quite a bit smaller than a regular arduino. If you have space for it in your project, make the board bigger than this to avoid running out of space, particularly if you know you are going to need to add a lot of other components.
Cut the tracks on the board where indicated in the image below (click to zoom in) – you can use a “spot face cutter” or just a large-ish drill bit (which is practically all a spot face cutter is) for this. Use a magnifying glass or other aid to look closely to ensure that the track is completely severed. Brush away any little shreds of copper track.
First we’ll build the power supply for the board. By building in sections, this allows us to test as we go along.
Like the real arduino, we want to be able to run the board from a battery or other input with a voltage of something between 7V to 12V (we’ll also be able to run it from USB’s 5V, this won’t be via the power supply though, it’ll be via the connection to the computer — see later posts for more details).
The component that allows us to generate regulated 5V (which all our circuitry requires) from the input is an LM7805 (see http://en.wikipedia.org/wiki/78xx). The full list of components we’ll need are:
- 1 × LM7805
- 2 × 100 µF, 25V electrolytic capacitors
- 1 × 100 nF ceramic capacitor
Solder them on to the board as shown in the image below (click on it to zoom in). Note that the 7805′s heatsink should be on the right. Also note the electrolytic capacitors have a polarity so need to be connected the right way around. Usually there’s a stripe down the side of the barrel showing the negative and the positive lead is longer. The ceramic capacitor (100nF) can go either way round. Position of these components can be anywhere along the strips – I’ve opted to put them in the middle.
We now already have a board that we can test. The input voltage will go to rows one and two – the top row is positive, and row two is negative. If all is working correctly, the regulated output voltage will be on rows 2 (negative) and three (positive, 5V). So to test this, I’ve temporarily soldered a 9V battery connector to rows 1 and 2. Position along the row is not important – but NOTE that if you get the polarity wrong you will fry the voltage regulator. You might want to consider incorporating a diode for reverse polarity protection, and maybe a PTC (resettable thermal fuse) for overload protection in case of short circuits. Both of these are outside the scope of this basic circuit.
Also you could consider putting an LED (with suitable resistor) across rows 2 & 3 to show that the circuit is powered on. If this is going inside a box this may not be useful!
With 9V applied to rows 1 & 2, my multimeter shows 5.04V across rows 2 & 3 as expected, and 9V (from the battery) across 1 & 2.
Stay tuned for part 2 of several, I promise they’ll be no more than a day or two apart!
Edit: Part two is now available; you can find it at http://martyndavis.com/?p=133