Software apps and online services
Hand tools and fabrication machines
This is a great beginner soldering and prototyping board project. The ATtiny is a very capable microcontroller. This shield allows us to program it quickly and conveniently.
The ATtiny doesn't come in the modular package that the Arduino UNO does. As the microcontroller comes bare, there is no immediate means of programming it. A standard USB's data lines use a serial communication protocol that is not recognized by the ATtiny. Converting the serial communication to the UART protocol allows us to program the ATtiny via TX and RX pins. That is where the Arduino UNO comes into play. The UNO contains an ATmega16U2 (CH340 if it's a clone board) to act as a Serial to TTL chip. Tapping into the TX and RX pins allows us to program our ATtiny.
This isn't a full guide where I will walk you through every connection; instead, I show you my creation process as that part is often undocumented or left open to interpretation based on a user's skills/available tools. I assume you have basic electronics knowledge such as using a multimeter, checking for correct polarities on an electrolytic capacitor/LED, or how to follow pins on a schematic. You had to have some experience with microcontrollers to get here!
- Shield form
- On board LED
- Removable after programming
- Additional female headers for breakout & testing
This guide shows the physical connections quite well, and he used the same type of board that I did. I will effectively do the same as that guide with more detail in certain places. Use it as a reference whenever there's confusion. We'll be occupying only a few UNO pins, so we can get away with having a partial shield over a full shield. Here are the connections:
- ATtiny pin 1 (PB5) <--> Arduino pin D10
- ATtiny pin 2 (PB3) <--> x
- ATtiny pin 3 (PB4) <--> x
- ATtiny pin 4 (GND) <--> Arduino GND
- ATtiny pin 5 (PB0) <--> Arduino pin D11
- ATtiny pin 6 (PB1) <--> Arduino pin D12
- ATtiny pin 7 (PB2) <--> Arduino pin D13
- ATtiny pin 8 (Vcc) <--> Arduino +5V
Follow the pinout diagram below for additional reference. This is also useful to know later on when coding.
After determining the necessary pins, I marked the portion of the board I needed.
Some minutes later with the dremel and 100 grit sandpaper, and you get this:
Start off by soldering the DIP8 socket. Adding the rows of female headers is optional, but it has proven to be tremendously convenient as I can keep the UNO as a power source and not remove the ATtiny from its socket.
This is where it got awkward. Since my board was not double sided, I couldn't push the male headers all the way through or I wouldn't have a pad to solder them to. Instead, I had to leave some space between the plastic and the pads underneath to solder the pins. Refer to the image below.
I also went ahead and cut the connections that I did not need. This is a necessary step for strip board users. The pads are connected in parallel "strips, " and it's left to the designer to break the connection wherever he/she chooses. Perf board users don't need to do this, but you may have some extra wires.
Add a 10uF electrolytic capacitor between the Arduino's Reset pin and Ground. I folded down the capacitor so it didn't stick out as much.
*OPTIONAL* If you want to add an LED to use for testing purposes (similar to LED13 on the UNO), connect it to any available pin that's not ground or Vcc. I hooked mine up to pin 2 aka PB3/D3. Don't forget your current limiting resistor in series with the LED and find a route to ground that works for you. I used my multimeter liberally during this step to make sure that I didn't have any unwanted connections.
Your fully soldered shield should look something similar to the one below. Refer to the connections made in case you're having trouble figuring out how to route the wires.
I actually had some difficulty in figuring out how to flash code onto the ATtiny. Using the Arduino as an ISP is not the issue; it takes some extra effort to install the necessary hardware packages. This link helped me out. Follow the steps below to upload a Blink sketch to see if your board works.
1. Arduino as ISP
- Plug in the UNO on it own, select the correct COM port and board.
Arduino IDE >
2. ATtiny Hardware Package Installation
Additional Boards Manager URL> Paste:
Boards Manager> Find "DIY ATtiny" >
3. Configure Settings
- Make sure your settings match the image below. I used an ATtiny13a instead of an ATtiny13.
4. Test Code
- Download the "ATtiny Blink" sketch provided at the bottom of the guide and upload it.
- Observe if LED toggles every second
Congratulations! The shield is complete. I may create a 3D-printable enclosure for the shield. If you wish to print the enclosure used on the UNO, you can find it here (Note that it was designed around genuine boards without multiple rows of header pins). You can now integrate your newly programmed ATtiny into various projects! Happy tinkering.