Upload a sketch to Arduino Mini 5 through Arduino UNO rev.3

Introduction

Microcontrollers and programming might not be the most common cosplay materials, but sometimes they are useful to have. There are several different kinds of microcontrollers, but I use Arduino because they are easy to get in Sweden (Kjell o Co sells them and they have a starter kit I recommend).

For a cosplay I wanted to control some lights, but instead of using the big Arduino UNO rev.3 that comes with the starter kit, I wanted my microcontrollers to be small so I could fit them inside the cosplay. I chose to get some Arduino Mini 5 because Kjell o Co carries them and supposedly could be programmed through an UNO.

Size comparison: UNO, Mini, and 1 SEK coin

When I sat down to start program my Mini I had some major trouble even uploading a single sketch, all I got was the error message “avrdude: stk500_getsync(): not in sync: resp=0x00”. After a lot of searches on google, and asking for help on the Arduino subreddit I finally got it to work. Because I had so much trouble I decided to make a tutorial on how I did it, so I have something to refer to when I try this again in the future.


Requirement

I assume you have a working Arduino UNO, the Arduino IDE, and have managed to successfully upload sketches to the UNO. If not, follow the guide on the Arduino home page.


Hardware

1 Arduino UNO rev.3
1 Arduino Mini 5
USB cable
1 Breadboard
1 LED
Solid core wires of various colors


Step 1

Carefully remove the ATmega chip from the UNO; you can use a flat screwdriver for this.


Step 2

Attach wires to these pins on the Mini:

TX (I used a green wire)
RX (yellow)
GND (black)
R (gray)
5V (red)

Optional:
13 (green)
9V (orange)

(The other wires in the picture are PWM pins, and were used in my project; they are not relevant to this tutorial)


Step 3

Connect the Mini and the UNO in this way:

UNO GND -> Breadboard -
UNO 5V -> Breadboard +
UNO Reset -> Mini R
UNO RX -> Mini RX
UNO TX -> Mini TX
Mini GND -> Breadboard -
Mini 5V -> Breadboard +


Step 4

You are ready to upload your sketch to the Mini, but to make sure it works we want to do some more wiring first. (Pin 13 has a 1k resistor built into it, so we don’t need to add one to the board)

Mini 13 -> LED Anode
LED Cathode -> Breadboard -


Step 5

Connect the USB to the UNO; you should see these lights light up:

UNO ON
UNO L
A light on the Mini
The LED on pin 13 should blink a couple of times


Step 6

Setup the Arduino IDE:
Tools -> Board -> “Arduino Mini w/ ATmega328”
Tools -> Serial Port -> [The port with the USB]
Tools -> Programmer -> “AVR ISP”


Step 7

Write this example code:

const int pin = 13;

void setup()
{
     pinMode(pin, OUTPUT);
}

void loop()
{
     digitalWrite(pin, HIGH);
     delay(1000);
     digitalWrite(pin, LOW);
     delay(1000);
}

Step 8

Right before you press Upload, press the Reset button on either the UNO or the Mini (both work). If everything is set up correctly the LED on pin 13 should flash on and off each second.


Next

Part 2: Power the Arduino Mini 5 from a 9v battery