This how-to takes you through all the steps of making your own arduino on a perfboard or perfduino! Arduino microcontrollers are great for learning about physical computing and are very useful for rapid prototyping. Arduino’s simple programming language makes it a favorite of hobbyists and diy-ers around the world. Because arduino boards range in price from 30 to 70 dollars, it can be very cost effective to make your own. This lets you customize the layout of the board and brings down the cost so you can embed your perfduino in a final iteration project without losing your precious professionally made arduino board you had to wait so long for by the mailbox. The perfduino in this tutorial is designed to closely mimic the original arduino functionality without any specific project layout in mind.
Step 1: Materials!
These are the materials you will need to make your perfduino:
2. green LED
3. 100 – 500 ohm resistor
4. Atmega 328 with arduino bootloader preloaded onto the chip
5. 22 gauge solid core wire
6. ftdi serial to usb break out board
7. 16 MHz crystal
8. (2) 22 pF (that’s picofarad not microfarad) capacitors
9. .47 uF capacitor
10. 10k resistor
11. female pin headers
12. male pin headers
13. also, breadboards never hurt
Check out the supply section of our Knowledge page for component suppliers.
Step 2: Breadboard Your Circuit First!
As with every electronics project you undertake, you should test your circuit on a breadboard before soldering anything. Desoldering components is a slow and painful process that is to be avoided whenever possible. For the breadboard circuit you will need the breadboard, the Atmega 328 chip, the 10k resistor, the green LED, the LED resistor (I used a 100 ohm resistor here), some bits of wire, and the ftdi breakout board (you can also use an official arduino board’s ftdi chip if you remove the atmega chip from the official arduino board first).
Connect up the atmega chip on the breadboard as shown in the schematic below. The gray component is the 16 MHz crystal. The two orange components are the 22pF capacitors. The striped component is the 10K resistor. Make sure you connect the 10K resistor to the power rail and not to the ground rail. In this image from the arduino website, an arduino board (WITH THE ATMEGA CHIP REMOVED!) is used as the ftdi interface. The ftdi breakout board acts in the same manner. Connect the power and ground from the breakout board to the power and ground rails running along the side of the breadboard. If you are using an arduino without the chip, connect RX and TX as shown in the picture. If you are using the breakout board, connect RX to the third pin (where the yellow wire connects in the picture) and TX to the second pin (where the green wire connects in the picture) of the atmega chip. Connect the DTR pin on the breakout board to an empty column on the breadboard. Then connect that column to the reset pin on the chip ( the same pin the 10k resistor is connected to) with the .47uF capacitor. If using the arduino board, instead connect the reset pin on the arduino board to the reset pin on the chip. No capacitor is necessary here. (note: this wire is not shown in the image below for some reason, but it it very necessary!)
After double checking your breadboard against the image, add a green LED to the pin directly to the right of the power pin on the upper part of the chip as shown in the photo below. Remember to connect the positive side of the led to the pin and the negative to our led resistor, then connect the remaining side of the resistor to ground.
If all the connections are correct, you should be able to plug the breakout board or chipless arduino board into your computer’s usb port, open the arduino software, and upload the blink program found in the example library. Is your LED blinking once a second? YAY! If not, check all your connections. Make sure your LED is oriented so that the positive end connects to the chip and the negative end connects to ground through the resistor. Check that your .47 uF capacitor connects the DTR pin on the breakout board to the reset pin on the chip if you are not using an empty arduino board as the interface.
Step 3: Setting Up The Perfboard
This drawing explains how the raw pins of the atmega chip correspond to the final input and output pins of the arduino. Wherever the directions refer to a specific pin number on the chip itself they are referring to the pins labeled in black lettering.
Get out your perfboard and set the atmega chip into the center of the board at whichever end pleases you. Make sure the side with the copper pads is facing down. Set the crystal and 22pF capacitors on an empty section of the board in the same relation to each other as on the breadboard. Set the 10k resistor into the board connecting pin 1 on the chip to an empty section of the board. This resistor will later connect to 5 volts.
Next cut and strip some of the 22 gauge solid core wire. Attach the crystal/ capacitor leads to pins 9 and 10 of the chip just like you did on the breadboard (as shown in the two topmost yellow wires). The third yellow wire and the blue wire connect to pins 2 and 3 on the chip (where the rx and tx connected in the breadboard layout). The area the wires are being brought out to on the right is the area where the breakout board will connect with male headers. Decide how you will want to orient the ftdi breakout board and arrange the order of the RX, TX, DTR, Power, and Ground wires accordingly. Remember that the RX of the chip connects to the TX of the breakout board and the TX of the chip connects to the RX of the breakout board. Double check the above pin map if you are unsure. Also remember the DTR pin on the breakout board will connect to the reset pin, or pin 1 of the chip through the .47 uF capacitor. The first power and ground wires in the bottom of the image below connect to pins 20 and 22 respectively.
Next add a resistor on pin 19 as shown below. Connect the positive end of the LED to the resistor and the negative end to an empty section of the board. The store bought arduino has an LED already embedded in it that allows for swift debugging. This LED will serve the same function. Now connect your power and ground wires on pins 20 and 22 to the power and ground pins ( pins 8 and 7) on the opposite side of the chip. both sides of the chip need to be connected to power and ground.
This is what the other side of the perfboard looks like at this point. Yours does not need to mirror this one exactly but it should at least resemble the image below.
Solder up the connections we have so far and clip the leads.
Step 4: USB And Power Rails
In the image below we have added a couple of components. On the bottom left you will notice a line of six male header pins (one is missing because we don’t need that connection on the breakout board). These pins are where we plug the breakout board into the perfduino in order to program it. Ground and power are brought from pins 7 and 8 to the appropriate male headers. RX and TX are also brought to the headers as shown at the start of step 3. The reset pin is brought out to a .47uF capacitor at the extreme bottom left of the board. The other end of this capacitor is the connection to the DTR pin all the way on the left of the male headers. Without this capacitor the computer will not be able to program the microcontroller.
In this picture we have also added two rows of female headers that will act as extra power and ground connections when we use the perfduino for prototyping. Power and ground are brought from pins 20 and 22. As long as the two rails are not electrically connected, you can situate them however you like.
Below you can see that the female headers we used for the power rails have very long leads. Take one lead at each end and bend it flat toward the center of the rail. These will give you a nice solid connection between all the pins. Make sure you then solder the ground or power wire to the soldered header.
Below both soldered power rails can be seen on the bottom left of the perfboard.
(Note: In the above image the extra leads of the 22pF capacitors are soldered to one of the main rails along the center of the board. This is connected to ground. The 10k resistor is soldered to the base of the 5 volt power rail you just connected)
At this point you should be able to plug in your perfduino to the computer via the ftdi breakout board. From the menu at the top of the arduino environment select tools, board, and duemilanove or nano with atmega 328. Try loading an example blink program onto it. Make sure you have the correct com port selected.
Step 5: Connect The Analog And Digital Pins
All that is left to do is to connect the analog and digital pins to female headers to provide all that adruino functionality that will make prototyping with your perfduino a breeze. Check the pin map and this time take note of the red-lettered labels. In this perfduino digital pins 2 through 13 have been brought out to female headers. You may also bring out digital pins 0 and 1 but I did not include them here because they also serve as the RX and TX pins for the breakout board interface. In the image below, red-lettered digital pins 2 through 8 are connected to the female headers at the bottom of the board.
Below, digital pins 9 through 13 are brought to the same row of female headers. It is important to note that digital pin 13 is not connected directly to the female header. Instead, the junction where the resistor meets the LED is brought out to the header. This will allow you to connect an LED to pin 13 without a resistor just like in a real arduino board!
Next connect analog pins 0 through 5 to a row of female headers on the other side of the board as shown at the top of the image below.
Finally, connect the black-lettered “AREF” pin to the last pin on the row of digital pins. This will be used for setting analog voltage levels when you are prototyping.
Step 6: Label The Headers
It is important to label your headers. This makes it easier to prototype and ensures your friends won’t get totally lost using your mysterious microcontroller. For labels I simply cut up some white stickers and applied them to the sides of the headers. Pen works fine for labeling the pins if you have a steady hand. You can also print out labels if you want a neater-looking board.
Step 7: Make Stuff!
That’s it! You are done! You now have a fully functional arduino microcontroller! Marvel at the fruits of your labor!
Here is a video of the perfduino loading a program to turn a servo and a program to blink the embedded LED.
The Perfduino made it onto the MAKE site in this video!