After the success of my Arduino Uno I2C Master board, I started thinking that I could improve the board. Well ... make it more extensible for one thing, and allow me to use the board for other stuff as well. I figured if I could break out the pinouts of the ATMEGA328P-PU, that I could have a board that I could use for more than just the I2C Master, but that I could use for that purpose too. Also, I could add and ICSP header to the board so that I would have less juggling of chips and boards.
That became my goal for another breakout board/Arduino Uno self-build.
Step 1: Bill of Materials
The BOM for this instructable are as follows:
- 1 x ATMEGA328P-PU
- 2 x 100nF Electrolytic Capacitors
- 2 x 22pF Ceramic Capacitors
- 1 x 0.1 uF Ceramic Capacitor
- 1 x female 6 pin header (90 degree)
- 1 x female 6 pin header
- 1 x female 5 pin header
- 2 x female 4 pin header
- 1 x female 3 pin header
- 1 x female 2 pin header
- 2 x male 3 pin header
- 1 x power plug
- 1 x 10k ohm Resistor
- 1 x 5V Voltage Regulator
- 1 x 16 Mhz crystal
- 1 x 80x50mm single sided PCB
- 4 x 15mm M3 bolts
- 4 x 12mm threaded nylon spacers
- 1 x 80x50mm 2mm acrylic sheet
- 4 x rubber feet
Like the bulk of my breakout circuits, I'll be mounting the board on an acrylic prototype board.
Pretty much all of the parts for this instructable were bought from eBay with the following exceptions:
- Acrylic sheet - bought from the hardware store
- M3 bolts and nylon spacers - bought from Jaycar
- Rubber feet - bought from the supermarket
Step 2: Design Process
Starting with the solderless breadboard design, I followed the design that I made previously for the I2C Master circuit and added in the breakout pins for the ATMEGA328P pins, ICSP and I added in a Vin power output.
The left-most section of the board is dedicated to the 5V Voltage Regulator components. I've arranged the components on the solderless breadboard so that you can see just how this circuit works. The power goes in to the LM7805 leftmost (voltage input) leg. There is a smoothing capacitor connected between the voltage input leg and the common Ground leg (the middle leg). The rightmost leg (voltage output) also has a smoothing capacitor between it and the Ground leg. There is a 2 Pin female header attached to the Input Voltage and Ground to provide an Vout.
The Output Voltage and Ground are connected to the Positive and Negative rails of the solderless breadboard, giving 5V regulated voltage to the board (jumpered bottom to top).
The ATMEGA328P sits in the middle of the board with Pin 1 (RESET) in the left-bottom position. There is a 10k ohm resistor connecting the reset with the output voltage of the power. The RESET pin also connects to the USB Serial connector Pin 1 via a 0.1 nF ceramic capacitor.
Vcc (pin 7) is jumpered to AVcc (pin 20) on the ATMEGA328P.
XLAT1 (pin 9) and XLAT2 (pin 10) are connected to the 16 Mhz crystal and to GND with a 22 pF ceramic capacitor on each of the 2 legs of the crystal.
Pretty much everything else is breakout ...
Connects (left to right) RESET (pin 1), RX (pin 3), TX (pin 2), 5V Power, Nothing, and GND. Note that the 5th pin of the USB Serial connection does not connect to anything. I'm connecting a Freetronics USB Serial Adapter to the board so that I can connect the board to the PC via a USB cable for serial monitoring and also for uploading sketches to the (bootloaded) ATMEGA328P.
Connects Analog 5 (pin 28), Analog 4 (pin 27), GND and 5V.
I've added an ICSP header to the board so that I can burn the bootloader to the board via my USBTinyISP. You'll note that only the 5V and GND are connected to the ICSP in the design. The intention is to use jumpers to connect the RESET, SCK, MISO and MOSI pins from the ATMEGA328P to the header. This is one of the most significant compromises of a single-sided PCB. You will see the jumpers (white) in the copper side photos.
I've included the Fritzing design files in this instructable so that you can build the circuit, should you wish to, or take the design forward ... should you wish to.
Step 3: PCB Build
Once the design is finished, it's time to build the circuit board.
I've done this using the laser printer toner transfer method. In short, print on laser printer, cut out design, iron design onto the copper, rinse paper from board.
I've used Peroxide and hydrochloric Acid as my etchant.
Once the PCB is etched, it's important to go over the board with a magnifying glass/microscope/good eye sight, to find any bridges or gaps in the traces. You should also be going over the traces with a continuity tester to make sure that your traces are electrically sound. After going over the board with a scope and after I had soldered the components onto the board, I still found that A4 and A5 were bridging. It took me a little while to find the problem ... it turns out that there was a hairline bridge between the pads of the jumpers for those lines on the board. I was able to fix the problem with a sharp probe.
Drill the board and solder all of the components into their respective positions.
I never enjoy soldering in long jumpers, but sometimes it's unavoidable. I take extra care when doing this because it is very easy to bridge in a tight space. I had to wick off a fair blob of solder that insisted on forming between the SCK and MOSI pins of the ICSP ... what a pain in the butt. After wicking the offending bridge, I went over the header with the metal probe and then tested the pins and traces until I was happy that the circuit was free from error.
If there is one thing that I have learned in this hobby, it is that you can never really test your circuits enough. As soon as you get complacent, you will get a bridge or a gap and fry a chip. It can be humbling indeed.
Step 4: Good to Go
Of course, when you have finished your circuit and inserted you ATMEGA328P, you'll want to burn the bootloader. Connect the ICSP to your bootloader and go right ahead and do that (however you want to do it ... don't let me oppress you).
If you are lucky enough to have an ATMEGA328P that has already been bootloaded, you can go right ahead and upload sketches.
In my design, the USB Serial header is reversed, this means that if you connect the USB Serial Adapter, connect it upside down.
The above image is of the Arduino Breakout Board running the blink sketch that was loaded onto the ATMEGA328P via the USB Serial adapter. GND is connected from the I2C GND female pin header while the other end of the LED is connected to D13 (as per the standard sketch).
If you liked this instructable, please feel free to vote ;)
Participated in the