ATTinies (like the ATTiny 85) are super awesome! They are super cheap, low power, and they do what most Arduino projects accomplish anyway (give a simple output or take in a simple input).

One difficulty can be quickly seeing what's going on with their internals for easy debugging. The ATTInies can't use the hardware serial built in to many larger arduinos, and so you need to use the SoftwareSerial library. This can be a bit tricky or confusing. Other people use software serial for directly programming their Tinies in the first place with all kinds of crazy hookups, and maybe capacitors, and USB to serial devices. You might even have to put special software on the arduino talking to the hardware serial, and the one just using software serial.

Some of us who have only used Dave Mellis's tinyAVR programmer get a bit confused, or are just too lazy to try that all out. It can be confusing for beginners, and I wanted the simplest way to teach my animal interaction design students how to use these great little microcontrollers.

So thanks to help from Paul O'Neil, I wanted to describe really quickly a simple method for talking with your ATTiny and the only extra necessary material is an Arduino Uno or Duemillanove (or Seeeduino that acts like one).

If you are new to programming ATTinies go check out the nice tutorial over at HLT and then come back here after you get your environment setup. 

  • ATTINY 85
  • TinyAVR Programmer (it's on sparkfun)
  • 2 wires
  • "Slave" Arduino Uno or Duemillanove (or Seeeduino that acts like one).

++Photo of Pinouts

++Photo of 

Special Extra Learning Notes
  • We'll find out that your
  • We'll find out that analog input 2 is a bit tricky on the ATTiny

Step 1: Program the ATTINY With Software Serial Commands

Check out this example code where you invoke SoftwareSerial, and then use it like you normally use it in your sketches. Program your ATTiny with this:


(BTW Anyone know how to embed github code in an instructable? I tried gists, and gist-it)
<p>I was getting garbage output until I changed the Baud rate from (9600) to (</p><p>38400). works great now.</p>
<p>Hi,</p><p>I followed your instruction but I am not getting clean data. Also I am using Arduino as ISP. Could you let me know what I am doing wrong?</p>
<p>Hi blorgggg:</p><p>I followed your instructable step by step for my Atiny85 and I got like garbage on the serial monitor:</p><p>Input Val: 500</p><p>&aacute;R&Otilde;&Ntilde;Val: 301</p><p>Inpu&sup2;…&plusmn;&eacute; 255</p><p>Input Val: 256</p><p>Input Val: 437</p><p>Input Val: 667</p><p>Input Val: 62&brvbar;H&cedil;&Ecirc;&Otilde;&Ntilde;Val: 375</p><p>Input Val: 252</p><p>Input Val: 257</p><p>I&Otilde;t Val: 363</p><p>Input U&plusmn;&eacute; 598</p><p>Input Val: 664</p><p>Input Val: 438</p><p>Input Val: 250</p><p>Input Val: 246</p><p>Input Val: 289</p><p>Do you know why is that? I changed my microcontroller to 8 MHz (using the hlt instrucctions), with arduino UNO and arduino 1.0.5-r2 version.</p><p>One more question. The sketch uses a sensorPin variable with number 7. Is that correct? what pin number should I use for Attiny85</p><p>Thanks in advance</p>
<p>For more clear about how to load a hex file in microcontroller you can browse this video.<br>https://www.youtube.com/watch?v=4rHWzO7tqQc</p>
I forget one thing Configuring the ATtiny to run at 8 MHz (for SoftwareSerial support) on the hlt (http://hlt.media.mit.edu/?p=1695) website. <br>I got al garbage on the screen, after setting de fuse bits correct as mentioned it works but i have one exception i only get &quot;input value :0&quot; also if i put 5v on input port. <br>Am i missing something? i'm using a attiny45 but this is the same pinout as a attiny85.
Ahh yes, you def need to make sure it is 8MHz for Software serial. Good trouble shooting! As for the input value 0, there is probably just a pin mapping problem. For example, maybe the input pin you are touching has a different number than on the 85, and when you are plugging in 5V, it is just not talking to the right port. You could use the serial to discover the port, by turning on all the inputs and see what gets affected. maybe!

About This Instructable




Bio: I want computers to be wilder. https://www.instagram.com/hikinghack/ https://twitter.com/HikingHack https://www.youtube.com/user/blorgggggg https://github.com/quitmeyer
More by blorgggg:360 Virtual Reality Camera Trap Transparent Wood Bamboo BOAT Lab 
Add instructable to: