Sunday, 09 December 2012 13:56
Simplest and Cheapest Arduino
Here we use a ATTiny85 (can be ATTiny45, ATTiny44) to make an Arduino just for US3.00, so we name it as Tiny Arduino.
Tiny Arduino have only eight pins as shown in figure above, Pin4 is ground (Gnd), Pin8 is 5V (Vcc), Pin1 is Reset, Pin2 and Pin3 originally used to connecting the Crystal. In order to utilize all the IO, the internal oscillator (RC Oscillator) is used to replace the external clock which require a crystal. Therefore the Tiny Arduino is now come with five IO. Below shows the Arduino IO functions.
- There are five IO, each IO can be Input or Output
- Among the five IO, two of the IO can perform as PWM
- Among the five IO, three of the IO can perform as Analog Input
I2C may require to extend the features of Tiny Arduino.
Using an Arduino Duemilanove as an ISP
An ISP (in-system programmer) is required to upload sketch to the ATtiny85 since ATtiny85 does not come with serial interface. Here we use an Arduino Duemilanove as an ISP to upload sketch to the ATtiny85.
- Connect the Arduino Duemilanove to the computer
- Open the Arduino software , I'm using arduino-0023
- Select File> Examples> ArduinoISP from menu as shown in figure below
- Select Tools> Board> Arduino Duemilanove or Nano w/ATmega328 or Arduino UNO from menu
- Click on the Upload icon to begin upload Sketch to Arduino Duemilanove
- Now the Arduino Duemilanove is becoming an ISP
Plugin to support ATtiny85
- Download ATtiny85 Plugin
- Identify the Arduino sketchbook folder, press File> Preferences from menu, figure below shows my sketchbook location in D:\ My Documents\Arduino
- Make a Hardware sub folder inside the sketchbook folder if it is not exist.
- Extract the downloaded ATtiny85 Plugin to the Hardware folder as shown in figure below
You will see Tools>Board>ATtiny85 (w / Arduino as ISP) from the menu upon completing of the above procedures.
Picture below shows the connection between Arduino Duemilanove and ATTiny85
Here we make a simple running light.
Uploading sektch to ATtiny85
- File>New from menu
- Copy the running light source code as below to your Arduino work space.
- Click on Tools>Board>ATtiny85 (w / Arduino as ISP) as shown in figure below
- Click the Upload icon to begin upload Sketch to ATtiny85
Source code for 5 channel running light, it occupied 804Byte of Flash Memory.
This is a more complicated Sketch, occupied 1508Byte of Flash Memory
Arduino Tiny supports the following command
- pinMode ()
- digitalWrite ()
- digitalRead ()
- analogRead ()
- analogWrite ()
- shiftOut ()
- pulseIn ()
- millis ()
- micros ()
- delay ()
- delayMicroseconds ()
- SoftwareSerial (Arduino 1.0 support only)
Picture below shows my Tiny Arduino connecting to the Arduino ISP. My Arduino ISP is very simple too.
You may want to read this article for faster clock speed.