Sunday, October 20, 2013

USART with ATmega32

Introduction

The Universal Synchronous and Asynchronous serial Receiver and Transmitter (USART) is a highly flexible serial communication device. It is the easiest way to communicate with a computer. Many softwares such as MATLAB, Scilab, Mathmatica, etc., provide libraries that support serial communication. Real time data logging can be easily done due to its speed and flexibility in features. The USART uses two lines Tx and Rx, the data is transmitted through the Tx line and received through the Rx line. Let's see how to make ATmega32 communicate with a laptop.

ADXL345 Accelerometer using ATmega32

The ADXL345 is a tiny, low cost and ultra-low power 3-axis accelerometer which works on both SPI and TWI interfaces. It has use selectable sensitivity and give quite reliable readings considering its cost. The ADLX345 circuit in the IMU has TWI interface. I will be using ATmega32 in the following project clocked at 8MHz using the internal oscillator.
Here is the circuit diagram of how the ADXL345 accelerometer is connected, also you can see that the slave address is given as 0x53. The address can also be found out from the I2C scanner as shown here.
The ADX345 supports the standard (100 kHz) and the fast (400 kHz) data transfer modes. For more info see datasheet.

Tuesday, October 15, 2013

I2C Scanner

The fast and easy way to find out the i2c devices connected to arduino. It also helps to find out whether the wiring is correct or not, usually people tend to interchange the SCL and SDA wire and waste a lot of time.

Wednesday, September 18, 2013

Souce Code formatter for blogger

Here are some sites that help you to convert your code snippets into html format. The code is converted into a tabular format.

Interfacing HC-SR04 Ultrasonic Module with Arduino Pro Mini

SR04 is a module that can detect distance between 2cm to 400cm by sending out ultrasonic waves and calculating the time between the sent signal and echo received.


Steps:
  1. Send the trigger signal - a TTL 10us signal
  2. Wait for the echo pin to get high.
  3. Calculate the time for which the echo pin is high using a timer.
  4. Calculate the distance using 
Distance = high level time * velocity (340M/S) / 2

Saturday, May 11, 2013

V-USB



V-USB is a software-only implementation of a low-speed USB device for Atmel’s AVR® microcontrollers, making it possible to build USB hardware with almost any AVR® microcontroller, not requiring any additional chip.

More Info can be found out here