The arduino’s great features like powering via the USB port, serial programming, and easy-to-access headers make it indispensable while developing your project. However, there are times when you may want to make your project more permanent without sacrificing your arduino.
It’s actually quite easy to create a somewhat-less-feature-rich version of an arduino on a prototyping board that you can safely leave embedded in your projects. You could also develop and etch your own PCB for this but due to the simple design, it is just as easy to create on a perf board or a prototyping board.
The Required Parts
- The Proto Board – Radio Shack #276-150 – This is a 417 hole board that is just perfect for simple IC projects like this.
- Voltage regulator – LM7805 – 5V regulator can handle an input as high as 35V but a 9V battery works great with very little heat.
- Single Row Headers – Male or Female – Female headers work well for connecting to another arduino. Male headers work well for connecting to other components such as servos, proximity detectors, or LCD’s.
- Dual Row Headers – Male – This is for the ISP header.
- 16Mhz crystal oscillator
- 2 X 22pf or 18pf Ceramic Capacitors
- Jumper Wire – 22 Ga single strand wire.
- 28 pin IC Socket – This is useful for the rare occasion when you need to replace your microcontroller.
- Electrolytic Capacitor – A 10uF capacitor helps to stabilize the power source.
- LED – A generic LED will let you know when there is power to the board. As trivial as this sounds, it could save precious time when troubleshooting connections and code when the issue may actually be a dying battery.
- Power Connector – 2 Position Terminal Block – You could always solder the power wires directly to the board but there is something to be said about having the flexibility to just connect/disconnect when needed.
The diagram below shows the basic connections needed to get the Atmega328 operational. If you don’t need in-system programming capabilities, your project may be OK to just use these.
There are numerous great resources on the web for basic connections needed for a standalone arduino.
Communicating With Your Embedded Arduino
You may have noticed that on Arduino boards there is a 6 pin header labelled “ICSP”. This is the In-Circuit System Programming header. This is wired to the following pins on the Atmega328P:
- MISO – Connected to pin 18
- VCC – Connected to +5V
- SCK – Connected to pin 19
- MOSI – Connected to Pin 17
- RESET – Connected to Pin 1
- GND – Connected to Ground
It is not required, but it is suggested to create a 6 pin header to match the Arduino’s. This will make programming connections easier and universal between programmers.
Programming the Embedded Arduino
The Arduino boot loader is described here fully, but it is essentially a small program that has been loaded on to the microcontroller. It allows you to upload code without using any additional hardware.
The Arduino IDE makes burning the boot loader easy. It’s as simple as selecting it in the Tools menu. This works in Linux as well as Windows. Prior to burning, you’ll want to make sure you have the correct board chosen. This is also in the tools menu (Tools -> Board).
One of the main purposes of the bootloader is to allow you to program your microcontroller via the serial port. This convenience is nice when you have a built-in serial chip like in the Arduino board. However, if space is at a premium in your project, you can still program the microcontroller in-circuit without having to add the hardware necessary for serial communication.
If you already have an AVR programmer like the AVR-ISP mkII, then burning the bootloader is as simple as connecting to the header on your project and selecting the following from the Arduino menu:
Tools -> Burn Bootloader
Once this is complete, you essentially have your embedded arduino ready for action! The next step is to upload a sketch. Again, if you have an AVR programmer, this is as simple as the following:
File -> Upload Using Programmer
If you don’t have a programmer, never fear…you can use your Arduino board as one! This excellent tutorial walks you through the steps. Note that the wiring is essentially the same as connecting the ISP headers between the arduino and the target (embedded) arduino.
Thanks and Happy Building!