vbnet
Communicating with the Arduino in VB.NET (Serial Communication)
May 3, 2016
Show all

DIY: Build your own Breadboard Arduino

fi

This article will show you how to build an Arduino microcontroller using a breadboard and basic components. You will see how easy it is to build an Arduino from scratch. Once the build is finished we will upload the Arduino sketch using ICSP on the ATMega chip.

Components List

  • USBasp AVR Programmer
  • Breadboard
  • 10k Ohm Resistor
  • 2x 22 pF Capacitors
  • 16 MHz Clock Crystal
  • 5v Power Supply –we have a breadboard power supply (3.3v and 5.5v)
  • Atmel ATMega168
  • Wire/Wire Jumpers.

Assembling the components

Once you have all of the components you will need to assemble them on the breadboard. Below is a Fritzing example of a very basic Arduino layout, without the Reset button or LED that an Arduino normally has.

Arduino

You should connect up the components to the following pins on the ATMega chip:

  • Pin 1: 10k Ohm resistor connected to the power supply +5v. This is to pull up the reset function so the Arduino does not reset. On a normal Arduino, this would be a tactile button.
  • Pin 8 and Pin 22: These should be grounded.
  • Pin 7 and Pin 20: should also be connected to the power supply +5v.
  • Pin 9 and Pin 10: These pins should be connected to the 16 Mhz clock and two 22pF capacitors, connected to the ground rail (see diagram)

 

Connect your +5v power supply to the positive and ground rails on the breadboard. We are using a cheap breadboard power supply, they range from £1.50 – £5 on eBay and Amazon, alternatively you can use a battery, as we will be uploading the sketch via ICSP and there will be no need to use a USB connection.


Connecting ICSP

icsphsThe Arduino (ATMega Chip) uses the following pins for the ICSP connection RST, VCC, GND, MOSI, MISO and SCK. 

We will not be burning a bootloader on to the ATMega chip either, this has several advantages such as a faster start up time for the sketch (saving almost 5 seconds), freeing up 1k of available space and no requirement for a USB connection.

We will be using the USBasp ICSP Programmer, this was purchased from China, again very cheap at around £2.50. The downside is that the serial cable that came with it wasn’t labelled very good, below is a diagram of how it is wired up. (Note: Use continuity checking to make sure you have the right pins)

The pins on the diagram correspond to pins on the ATMega chip, the location of these may differ depending on which chip you are using. Below is a diagram for the ATMega328 (chip diagram from Atmel)

atmega328

Make sure that before connecting any of the pins together that you are doing so without power, do not connect up the +5v until everything is connected correctly, doing so may damage the chip and any connected components. Connect up all of the pins (the +5v lastly).


Uploading Sketches

To load the sketch on to the chip you can use the Arduino IDE, Launch the IDE and select the Tools -> Board -> ATMega168 Arduino Diecimila / Duemilanove from the menu. Now select the tools menu again and choose Programmer -> USBasp.

If everything is correctly connected, you should now be able to upload your Arduino sketches by using File -> Upload Using Programmer. If you want to expand the breadboard and add a USB connection to your Arduino build, you’ll need to burn the bootloader, after this is done you will upload your sketches as you would normally (not using Programmer)

We hooked up an LED to Pin 13 and used the Arduino LED Blink example to test that the sketch was working; the example code we used is below (or File > Examples > Basics > Blink)

// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin 13 as an output.
pinMode(13, OUTPUT);
}

// the loop function runs over and over again forever
void loop() {
digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(13, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}

That should be the first step in building your own Arduino.

1 Comment

  1. […] You can build your own Arduino PCB or on a circuit board using very basic components and an Atmel ATMega chip – As seen in our DIY Arduino Article. […]

Leave a Reply

Your email address will not be published. Required fields are marked *