Tag Archives: ATMega

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

F4YN9I5ILWLBJ0D.MEDIUM

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

FIIBDT7IHAYI0TK.LARGE

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

FI251XKICRXVI4O.MEDIUM

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]

RELATED POSTS