Introduction: $1 Smallest Arduino DIY

Picture of $1 Smallest Arduino DIY

Arduino is a excellent platform for prototyping and making cool and creative projects. But when it comes to embedding them into small projects it becomes difficult as they are quite big in size. The other alternative is to go and buy some smd chips and program them via Arduino IDE. But soldering the smd chips manually is not an easy task and you may end up in a whole mess.

But Hopefully There are other alternatives such as Attiny45/85 .But They are priced around $2 - $3 which is kind of expensive as compared to the Chinese arduino clones.

Luckily there exits an another microcontroller from ATMEL named as Attiny13/13A.

Which is cheap and have all the basic functionalities.

Because sometimes you just want to have a pwm output from a microcontroller or any other stuff involving just 1 or 2 pins.

If you don't have the microcontroller in Hand go ahead and buy from here:- Attiny13

Also Check my blog For more :- http://hardiqv.blogspot.com/

Step 1: Specifications and Hardware

Picture of Specifications and Hardware

Attiny13 is based on RISC Architecture and is manufactured by ATMEL.

It has 32 X 8 General Purpose Working Registers.

1 KB of Flash Memory ( program memory).

64 Bytes of EEPROM Storage.

64 Bytes of RAM or SRAM.

Over 10,000 Flash Write and Erase Cycles.

4 Channel 10 bit ADC with Internal Voltage Reference.

Internal Calibrated Oscillator. ( You don't need any external crystal oscillator).

In circuit Serial Programming ( ICSP ) For programming the microcontroller.

Upto 6 I/O's pins are available in DIP package.

Upto 4 channel ADC in built.

Upto 2 PWM channel and 1 External Interrupt.

Support For SPI Protocol.

I have also attached the datasheet if you need an kind of reference.

Step 2: Setting UP Arduino IDE

Picture of Setting UP Arduino IDE

For programming the Attiny13 microcontroller we will use MicroCore developed by MCUdude.

Here is the Official GitHub link :- MicroCore

Follow These steps very carefully and in this order only

  • Open the Arduino IDE.
  • Open the File > Preferences menu item.
  • Enter the following URL in Additional Boards Manager URLs:

I have attached the photos for the steps , You can refer to them if necessary.

Step 3: Uploading Bootloader

Picture of Uploading Bootloader

Just like any other Arduino Board this Micro controller also needs Bootloader so that it can understand the arduino Functions and the necessary fuses can be programmed.

For this You need a USBASP AVR Programmer or you can also use ARDUINO AS ISP .

But for this I will be using USBASP programmer.

The connections from the ATTINY13 to the USBASP Programmer is simple.
I have attached the pinout diagram of the Attiny13 .

Connect the MOSI, MISO , SCK, VCC (5v) , RST, GND pins from the microcontroller to the respective pins to the USBASP Programmer.

Next Connect USBASP Programmer to The Computer and Open ARDUINO IDE.

THEN set the parameters as shown in the picture.

Once set then click on Burn Bootloader and after few Seconds The Microcontroller will be Bootloaded.

Step 4: Upload Your First Program

Picture of Upload Your First Program

Now we will upload the program to the Microcontroller.

Go ahead and Paste the following code in Arduino IDE and click Upload.

After Uploading the Program Connect a Led's anode on the pin 2 of the microcontroller and cathode to round through a resistor.

Provide Power to the board (5v).

You will see LED light Flashing .

Now you can change delay timing for different effects.

Here is the Code :-

void setup()

{
pinMode(3, OUTPUT); }

void loop()

{

digitalWrite(3, HIGH);

delay(1000);

digitalWrite(3, LOW);

delay(1000);

}

Step 5: Another Example Program

Picture of Another Example Program

In this example we Will read a Potentiometer and convert it's values to drive a led through Pulse Width Modulation (PWM).

Go ahead and upload This Code to the Microcontroller:

#define LED 1

int data;

void setup() {

pinMode( 1, OUTPUT);

}

void loop() {

data = analogRead(A3);

analogWrite( LED, data/4);

}

attach a potentiometer of value 10K to the 2 pin of the microcontroller.

and attach a LED on the 5 pin of the microcontroller.

You will see that the LED brightness changes as You change the value of Potentiometer.

Step 6: FINISH

Picture of FINISH

Of Course This is just a start and this microcontroller is lot more capable of doing other things . After playing around this microcontroller you will find that the program space is quite low. This space can be improved my using PIN manipulation and getting rid of digitalWrite and digitalRead Commands.

I will make future instructables on this board so that you can understand better.

Hope You liked this instructable.

If so please vote for me in the contest.

Also check my blog for more :- http://hardiqv.blogspot.com/

Comments

chunkysteveo (author)2017-07-11

Isn't the ATTiny10 smaller...?! ;-)

HardiqV (author)chunkysteveo2017-07-23

Yes you are right. Attiny 10 is even smaller than attiny13.

MakersBox (author)2017-07-08

Any time I try to optimize something with the "cheapest" option, I run up against the limits. Unless you are going to make something with 100+ of these, I'd just bust out the extra $0.50 and start with an Attiny85.

Tiny85 is where the fun is at. Lots of very cheap development boards based on it as well.

tutdude98 (author)MakersBox2017-07-09

its not bad if you need to do something simple, like a fan controller that has custom curve (temperature - rpm), or simple led blink, strobe light etc.

Eric Brouwer (author)2017-07-04

If only I could find these chis locally for les than the ATMEGA328p....

HardiqV (author)Eric Brouwer2017-07-05

You can source from China. As I iam Indian and I cannot buy these chips locally

So, I usually a 10 piece pack so that I can never run out

Eric Brouwer (author)HardiqV2017-07-05

Thanks. I will add some on my next eBay order.

nqtronix (author)Eric Brouwer2017-07-04

"Locally" is the problem, on aliexpress you get ATTINY13A starting at 0.34€ (x20), 0.51€ (x5) or 0.59€ (x2). The SMD version even starts at 0.24€.

The most common concern is the quality, yet I've never encountered any issues.

About This Instructable

13,874views

194favorites

License:

Bio: I love to design new things and make products. i do design things in fusion 360 and love 3d printing. i have a keen interest ... More »
More by HardiqV:Awesome 3D Printed Bluetooth SpeakerAwesome SpiderMan FIdget SpinnerAwesome SpiderMan Fidget Spinner
Add instructable to: