Tag Archives: ATMega

Adafruit Metro 328 – An Arduino Uno Compatible Development Board

The Adafruit Metro 328 development board is an alternative to the Arduino Uno with an equivalent and compatible board design. It’s designed and manufactured by Adafruit. The Metro 328 just like other Arduino Uno clones is also based on the famous Atmega 328P that has been used in various development boards and projects.

Adafruit Metro 328

The Metro 328 offers an ATmega328 microcontroller with Optiboot (UNO) Bootloader and a ton of other features you won’t find on the Arduino Uno board. The Metro board is equipped with 19 GPIO pins unlike the Arduino Uno 14, analog inputs, UART, SPI, I2C, timers, and PWM. Six of its GPIO pins are for Analog input with two reserved for the USB to Serial Converter. Just like the standard Arduino Uno, it also includes 6 PWM pins on 2x 8bit timers and 1x 16bit timers.

Another significant distinction between the Metro and the Arduino Uno is the USB to Serial converter. The Arduino Uno is based on the Atmega USB-UART bridge (ATMEGA16U2), but the Metro 328 is based on the FTDI FT231X that provides excellent driver support in all operating systems with a more reliable data transfer unlike the former. It comes with four indicator LEDs, on the front edge of the PCB, for easy debugging. One green power LED, two RX/TX LEDs for the UART, and a red LED connected to pin PB5.

The Metro board has an on and off switch for the DC jack so you can turn off your setup easily. It also uses the conventional micro USB connector found around. Even though the Logic level of the Metro is 5V, it can be converted to 3.3v logic by cutting and soldering a closed jumper.

The following are the Metro 328P specifications:

  • ATmega328 microcontroller with Optiboot (UNO) Bootloader
  • USB Programming and debugging via the well-supported genuine FTDI FT231X
  • Input voltage: 7-9V (a 9VDC power supply is recommended)
  • 5V regulator can supply peak ~800mA as long as the die temp of the regulator does not exceed 150*C
  • 3.3V regulator can supply peak ~150mA as long as the die temp of the regulator does not exceed 150*C
  • 5V logic with 3.3V compatible inputs can be converted to 3.3V logic operation
  • 20 Digital I/O Pins: 6 are also PWM outputs, and 6 are also Analog Inputs
  • 6-pin ICSP Header for reprogramming
  • 32KB Flash Memory – 0.5K for bootloader, 31.5KB available after bootloading
  • 16MHz Clock Speed
  • Compatible with “Classic” and “R3” Shields
  • Adafruit Black PCB with gold plate on pads
  • 53mm x 71mm / 2.1″ x 2.8″
  • Height (w/ barrel jack): 13mm / 0.5″
  • Weight: 19g

The Metro 328 board is now available with headers already in place for $19.50 directly from the online Adafruit store. If you don’t want a Metro with the headers attached for super-slimness, check out the Metro without Headers.

Three Ways to Make Arduino Works As A USB/TTL Converter

Even if you have years working with electronics, you will still find some simple hacks that you never thought about before. Personally and to save money, when I was a student with a very limited budget I knew that my Arduino UNO can work as a USB/TTL(serial) converter. I used to remove the Atmega328P from my Arduino UNO R3 board in order to use the board as a converter not as a development board.

Why we need to do some tweaking to Arduino in order to use 0 and 1 pins for direct USB <-> UART conversion? This is because of what’s called fan-out (fan-out of a logic gate output is the number of gate inputs it can drive). In Arduino UNO case, the RX & TX lines (pins 0 and 1) are connected to FT232RL/Atmega8U2 USB to TTL bridge and to the Atmega328P MCU (check the schematic). So using the same pins with an external connections without doing any changes to Arduino UNO board probably won’t work.

Patel Darshil over Hackster.io listed three ways to make Arduino works as a USB/TTL converter:

Hack #1: Set Pin 0&1 Mode to Input Mode

This is done using code:

Pin Mode Set Arduino

But why this solves the problem? Well, GPIO can operate in two modes, input and output. In the input mode the equivalent impedance of the pin is too high; therefore, the Arduino/Atmega328P’s pins will have almost no electrical effect to the converter RX/TX pins.

Hack #2: Keep Atmega in Reset Mode

Just connect the RES pin with GND (the bold red wire in the image bellow)

Arduino Reset
Image Courtesy of Patel Darshil

GPIOs are configured using special registers. For example, Atmega has GPIO port data direction register (DDR) to set the GPIO as an input or an output for each port. The value of this register is cleared during reset. Therefore, the MCU’s GPIOs mode will be input. This means high impedance, subsequently.

Hack #3: Remove The MCU

This is the common way used by most Arduino UNO users, but it’s not applicable when it comes to new versions of Arduino; where, the MCU is SMD and can’t be removed.

Getting Started With the ATMega328P


Here is a detailed guide on how to get started with ATMega328P microcontroller. The guide goes in details on how to setup it on a breadboard and how to upload your first code on it. and blink a led.

The real benefit of using this microcontroller is that it’s only $4 US, whereas many other micro-controllers are 10X that price. It can also be easily programmed in the universal programming language, C++. The ATMega is also equipped with a decent amount of memory for any project.

Getting Started With the ATMega328P – [Link]

ATmega Alarm Clock & Thermometer Humidity meter


nitram147 @ instructables.com has build a ATmega based alarm clock with temperature and humidity reading. Sensor used is DHT11.

First, let me introduce you my project. I made an Alarm clock with extended functionality & thermometer and humiditymeter. Everything started when my friend (who used to bring me some old electronic rubbish and I used to check if there’s not something useful) brought me some cashing register display similar like that. When I first see them I knew that I will made from it alarm clock.

ATmega Alarm Clock & Thermometer Humidity meter – [Link]

Wireless Nixie Thermometer


by christian.ich.7 @ instructables.com:

The Target of this Project was to learn how to use different functions of the atmega:

• Connecting two Atmegas with a wireless connection
• Each Atmega has a Thermometer (DS1621) to read the actual temperature
• Use the sleep Mode of an Atmega
• Controlling a Nixie bargraph In-13

Wireless Nixie Thermometer – [Link]