MakerLab
ArduinoArduino Duemilanove ATmega168

Arduino Duemilanove ATmega168: A Deep Dive into a Classic

Explore the features, capabilities, and legacy of the Arduino Duemilanove ATmega168, a foundational board for many makers.

Arduino Duemilanove ATmega168

The Arduino Duemilanove ATmega168, released around 2008, represents a significant step in the Arduino's evolution, building upon earlier designs with increased memory and improved power management. It features the Atmel ATmega168 microcontroller, a popular 8-bit AVR RISC processor, which provided a good balance of processing power, peripheral availability, and low cost for its time. This board was instrumental in bringing microcontroller programming to a wider audience, making it accessible to hobbyists, students, and artists.

At its core, the ATmega168 is an 8-bit AVR microcontroller based on the RISC architecture. It boasts 16KB of Flash memory for program storage, 1KB of SRAM for runtime variables, and 512 bytes of EEPROM for non-volatile data. With 23 general-purpose I/O (GPIO) pins, multiple timers, analog-to-digital converters (ADCs), and serial communication interfaces (UART, SPI, I2C), it offered a robust platform for a wide range of embedded projects. The Duemilanove specifically improved upon its predecessors by offering a more stable power supply and a clearer pin layout.

As part of the Arduino family, the Duemilanove ATmega168 shares the same open-source philosophy and easy-to-use development environment (the Arduino IDE). It sits between earlier boards like the Diecimila and later, more powerful boards like the Uno (which also uses an ATmega microcontroller but typically a larger one like the ATmega328P). The Duemilanove was designed for makers who needed more than the very basic capabilities of earlier Arduinos but didn't require the advanced features or higher processing power of more complex microcontrollers. Its 16MHz clock speed and ample I/O made it suitable for interactive projects, sensor reading, and basic control tasks.

The Duemilanove ATmega168 is an excellent choice for beginners taking their first steps into physical computing, as well as for intermediate makers looking for a reliable platform for projects that don't demand cutting-edge performance. Its straightforward programming model, extensive community support, and readily available libraries make it easy to learn and implement complex functionalities. It's particularly well-suited for educational purposes and for developing proof-of-concept prototypes where simplicity and cost-effectiveness are key considerations. Its legacy continues to influence modern microcontroller development boards.

Watch

Related video, embedded from YouTube.

Specifications

Microcontroller / SoCAtmel ATmega168
Architecture8-bit AVR RISC
Clock speed16 MHz
Flash / Storage16 KB (of which 2 KB used by bootloader)
RAM / SRAM1 KB
EEPROM512 Bytes
Operating voltage5V
Digital I/O pins23 (of which 13 can be used as PWM outputs)
Analog / ADC8 channels, 10-bit resolution
PWM6 channels (on pins 3, 5, 6, 9, 10, 11)
ConnectivityUART, SPI, I2C
USBATmega168 does not have native USB; FTDI FT232RL USB-to-Serial chip for programming and serial communication
Power input7-12V DC via barrel jack or VIN pin, or 5V via USB or 5V pin
Dimensions70mm x 53mm

Pinout & pin functions

PinFunction
GNDGround
GNDGround
5V5V Power Output
3.3V3.3V Power Output (regulated from onboard regulator)
AREFAnalog Reference Voltage
RESETReset Pin
D0 (RX)Digital I/O, UART Receive
D1 (TX)Digital I/O, UART Transmit
D2Digital I/O
D3Digital I/O, PWM
D4Digital I/O
D5Digital I/O, PWM
D6Digital I/O, PWM
D7Digital I/O
D8Digital I/O
D9Digital I/O, PWM
D10 (SS)Digital I/O, SPI Slave Select
D11 (MOSI)Digital I/O, SPI Master Out Slave In, PWM
D12 (MISO)Digital I/O, SPI Master In Slave Out
D13 (SCK)Digital I/O, SPI Serial Clock
A0Analog Input, Digital I/O
A1Analog Input, Digital I/O
A2Analog Input, Digital I/O
A3Analog Input, Digital I/O
A4 (SDA)Analog Input, Digital I/O, I2C Data
A5 (SCL)Analog Input, Digital I/O, I2C Clock
VINPower Input (7-12V recommended)
IOREFI/O Reference Voltage (typically 5V)

Wiring & circuit basics

Powering the Arduino Duemilanove ATmega168 requires careful consideration to avoid damage. The board can be powered via its DC barrel jack (7-12V recommended, with a current rating of at least 1A for most projects) or the VIN pin. An onboard voltage regulator steps this down to a stable 5V for the microcontroller and I/O pins. Alternatively, a regulated 5V supply can be connected directly to the 5V pin, or via the USB port when connected to a computer or USB power adapter. Avoid connecting voltages higher than 5V directly to the 5V pin, as this can damage the microcontroller.

The Duemilanove operates at a logic level of 5V. This means that when a digital pin is HIGH, it outputs approximately 5V, and when it reads a HIGH signal, it expects a voltage close to 5V. When interfacing with sensors or modules that operate at 3.3V, a logic level shifter is necessary to prevent damage to the 3.3V device. Conversely, if you are using a 5V-tolerant sensor that outputs a 3.3V signal, the Duemilanove will typically recognize it as HIGH, though it's good practice to check the specific sensor's datasheet.

A common beginner project is to blink an LED. Connect the longer leg (anode) of an LED to a digital pin that supports PWM, such as D9, through a current-limiting resistor (typically 220-330 ohms). Connect the shorter leg (cathode) of the LED to a GND pin. The resistor is crucial to prevent the LED from drawing too much current and burning out the microcontroller pin or the LED itself. The Arduino IDE code would then toggle this pin HIGH and LOW to make the LED blink.

Programming & getting started

The primary toolchain for the Arduino Duemilanove ATmega168 is the Arduino Integrated Development Environment (IDE). Download and install the latest version of the Arduino IDE from the official Arduino website. Once installed, connect the Duemilanove to your computer via a USB cable. In the Arduino IDE, select 'Arduino Duemilanove w/ ATmega168' from the Tools > Board menu and choose the correct COM port under Tools > Port. To upload your first program, you can use the 'Blink' example sketch (File > Examples > 01.Basics > Blink), modify the delay times if desired, and click the Upload button.

For more advanced development or alternative environments, PlatformIO is a popular choice, offering better project management and support for various frameworks. While the ATmega168 doesn't natively support MicroPython or CircuitPython, these environments are designed for more capable microcontrollers. The Arduino IDE's C/C++ based language, however, is well-documented and has a vast library ecosystem, making it the most practical and widely supported method for programming this board.

Project ideas

Simple LED ControlControl an LED to blink, fade, or react to button presses. This project uses digital output pins and potentially PWM for fading, teaching basic digital I/O and timing concepts.
Temperature and Humidity SensorInterface a DHT11 or DHT22 sensor to read environmental data. This uses digital I/O pins for communication and introduces working with external libraries for sensor data acquisition.
Basic Robot MovementControl two DC motors with an L298N motor driver module. This project utilizes PWM pins for speed control and digital pins for direction, teaching motor control and basic robotics.
I2C LCD DisplayConnect a 16x2 I2C LCD display to show sensor readings or status messages. This project uses the I2C interface (pins A4/SDA, A5/SCL) and demonstrates interfacing with character displays.
Simple Alarm SystemBuild a basic alarm using a PIR motion sensor and a buzzer. This project involves reading digital input from the sensor and controlling a digital output for the buzzer, illustrating event-driven programming.
MIDI ControllerCreate a simple MIDI controller using buttons and potentiometers connected to digital and analog pins. This project can involve serial communication to send MIDI data, teaching input processing and serial data formatting.

Buying tips & gotchas

When purchasing an Arduino Duemilanove ATmega168, be aware that it's an older model. Genuine boards are less common now, and many available are clones. Clones are often functionally identical but may use slightly different USB-to-serial chips (like CH340G instead of FTDI FT232RL), which might require installing specific drivers. Avoid boards with significantly lower prices than expected, as they might be counterfeit or of poor quality. Common pitfalls include connecting components with incorrect voltage levels (5V vs 3.3V) or forgetting the current-limiting resistor for LEDs. Ensure you have a reliable USB cable and a suitable power supply (7-12V adapter for the barrel jack) for projects requiring more power than USB can provide. Accessories like breadboards, jumper wires, and basic electronic components are essential for getting started.