Index

DIY Arduino

Construction

An Embedded Board

Construction



If you have used stripboard before construction is relatively straightforward. It helps to have a strip cutter, but a craft knife or even a small drill fitted into a suitable handle can be used instead.

images/2-1.png

The first step is to cut out a piece of stripboard 17 holes by 8 holes such that the copper tracks run parallel with the short sides. This can be done with a hacksaw or a small table saw if you have one. Tip: Place masking tape along the lines of the cuts to maintain clean edges.

Using a suitable tool cut the tracks as shown on the right below. The final board is shown on the left for comparison. This image is flipped horizontally compared with the top view shown above.

images/2-2.png

To save space, one of the 22pf capacitors, the 470 ohm current limiting resistor for the LED and the wire link interconnecting the two zero volt connections on pins 8 and pin 22, are placed on top of the board in the gap that runs the length of the DIL socket as shown below. These need to be soldered to the board before the socket is fitted. The 470 ohm resistor should have its leads insulated before it is fitted. Suitable insulation can be stripped from a short length of plastic covered connecting wire and threaded onto the leads of the resistor. These components should initially be placed through the board and their positions checked by loosely fitting the socket before any soldering takes place. If the socket does not fit, adjust the components before proceeding. Some DIL sockets have small plastic “fins” underneath which may get in the way. If this is the case, trim them back with a craft knife or small file. This is the only particularly fiddly part of the construction and it is worth spending a bit of time making sure everything fits snugly.

images/2-3.png

When the components which fit under the DIL socket are in place, the socket itself can be soldered in place (the pin 1 reference grove is on the left-hand side in the image above) followed by the four wire links, the 2nd 22pf capacitor, the crystal, reset line pull-up resistor, reset switch and LED. Make sure to get the LED the correct way round. Check its data sheet to identify the anode and cathode lead. In the picture below the cathode lead is on the left. If you can see inside the material surrounding the LED, the lead connected to the larger of the two structures inside it usually the cathode lead. If in doubt use the diode test facility on a multimeter or connect the LED to a battery via 1k resistor.

The wire link nearest the DIL socket needs to share a hole with the 22pf capacitor on the outside of the socket. Also the two wire links adjacent to the programming header plug share a hole next to the 5v pin on the programming plug. The holes in stripboard are usually 1mm in diameter which makes getting two wires in the same hole difficult unless you are using very fine wire. A 1.3mm drill, or similar, can be used to open up these shared holes. Alternatively use the end of a sharp bradawl or a very small circular file.

The very short wire link level with the programming plug is soldered normally at the end nearest the left-hand edge of the board. At the other end it goes though the board and is then soldered to the same copper track which takes the 0v pin of the programming plug. The crystal is fitted in a similar manner with one lead soldered normally and the other passing through its hole and being bent over to connect one track nearer to the first lead. See the above image of the rear of the board.

On the rear of the board a diagonal wire link is required to connect the two 0v pins on the chip, pins 8 and 22 (see picture above). If you have separated the tracks as shown above, it should be possible to solder a short link in place without it fouling any other tracks. Tip: There is a danger that while soldering one end of a short link, the other end gets heated up sufficiently to come unsoldered. To help avoid this, push one end of a piece of tinned copper wire a short way into the hole in the end of the track that connects to pin 8 and solder it in place. Then bend it over the connection to pin 22, cut it to length and solder it in place.

Also on the rear of the board pins 20 and 21 of the DIL socket need to be connected together. Because of the low currents involved, it is perfectly adequate to do this by forming a solder bridge between the two adjacent pins. Similarly, pin 1 of the DIL socket needs to be bridged to the adjacent track that connects to the reset switch and its pull-up resistor. Again, see the above image of the rear of the board.

Finally fit the programming header plug to which the programming cable will be connected. USB to TTL serial cables usually come fitted with individual connectors. A small piece of tape can be used to bind these together in the correct order to fit the header plug.

Now check the board with a continuity tester to make sure that pins 8 and 22 on the DIL socket are connected to each other and to the 0v connection on the programming plug. Also check that pins 7, 20 and 21 are connected together and to the 5v connection on the programming plug. Then check that the 0v and 5v connections on the programming plug are not connected together. Finally connect the continuity tester across each adjacent pair of pins on the DIL socket. None of them should be connected together except pins 20 and 21 as already check. This final check should discover any unintended solder bridges between pins. Such bridges are often not easily visible but can be fixed by running the tip of a sharp craft knife between the tracks causing the problem. If any of these checks reveal faults, work out what is causing them an fix them before proceeding.

Passing these checks will not prove that the board is perfect, but it will find all of the most obvious problems including those that might damage the chip or the programming lead when it is connected up. The board should now appear as in the picture below.

images/2-4.png

At this point the ATmega328 chip can be inserted into the socket making sure to align the pin 1 end with the grove on the left-hand side of the socket. Brand new chips generally have their leads splayed out for the benefit of automatic assembly machines so that once sprung into place directly though the holes in a PCB without a socket, the leads hold the chip in place. This can make plugging the chip into a DIL socket quite difficult as the pins bend easily and can often fatigue off if you have to straighten them out more than once (sometimes less!). To overcome this, place the press the chip sideways down onto a static free surface, such as wooden bench, and press gently to bend all the pins until they are no longer splayed out. Repeat the process for the pins on the other side. Check to see if the pins now align with the socket and repeat as required.

Once the chip is in place and you have check it is the right way round, connect the programming cable to the header plug making sure to get the connections in the correct sequence. Starting from the left, as shown in the image above, this should be 0v (usually black). Then 5v (usually red). Next comes Rx on the plug which needs to be connected to Tx on the cable (usually green). Finally comes Tx on the plug which should be connected to Rx on the cable (usually white).

Never connect or disconnect the cable and the board with the USB end plugged in. This can cause transients that damage the 328 chip and prevent it from being programmed.

Now plug the USB end of the cable into a USB socket on a computer running the Arduino IDE. Nothing on the board should get warm or smoke, and the computer should not complain about heavy power drain on one of its USB port. These things are unlikely, but not impossible!

If you can, use a chip that already has the standard Arduino “blink” program loaded into it. In this case, the LED on the board should now start blinking. If not, unplug the USB end of the cable and check your work again. If all was well, you can try uploading from the IDE remembering to the select the correct boot-loader type and serial port number before starting the upload. Also remember to press and release the reset button on the board as soon as the IDE status line changes to “Uploading...” as with a four wire cable there is no automatic reset. You need to be fairly quick off the mark with this, especially if you are using the Linux version of the IDE, or the upload will fail.

If the chip had a boot-loader but did not contain the blink program, now is the time to load it into the IDE and attempt to upload it to the chip, also remembering to select the correct boot-loader type and serial port number before starting the upload, and remembering to press and release the reset button on the board as soon as the IDE status line changes to “Uploading...”. Again, if things go wrong at this stage, you need to double check your work very carefully.

Once you have a working board, you can decide how you wish to make connections to it. One way is to add header sockets to the board as shown below. These will enable patch leads, or even small custom “shields” to be connected.

It is a good idea to unplug the chip before further soldering activity to avoid static damage. Lever the chip up very slightly at one end of the socket with a small screwdriver or thin bladed knife. Repeat the process a little bit at a time at either end until the chip comes completely loose. Trying to pull the chip out with your fingers when it is not completely loose often results in it coming out all of a sudden, flipping over in your grip and plugging itself into your finger as the pins are quite sharp!

images/2-5.png


Alternatively, you could add pins to the underside of the board to allow it to be plugged into a prototyping board. The left-hand image below shows a side view of a board fitted with header sockets. The right-hand image shows a board fitted with pins on the underside.

images/2-6.png

The final image shows the right-hand board plugged into a prototyping board.

images/2-7.png


Next: The board embedded in a more complex project