Tag Archives: AVR

LED Moving Message Display using AVR ATmega8

An interesting project that can be done using Microcontroller is a LED message scroll er. It teaches you a quite lot of things. So I decided to make one. I made the hardware design modular and cascadeble That means the whole display is made up of several 15×7 modules. Each module has everything to drive 15×7 led matrix which includes a ULN2003 row driver IC and two shift register IC to drive the 15 columns. Data is loaded serially into the 15 columns. and multiplexing is done along the row. Video Demo The 15×7 Smart LED Board. The 15×7 Smart LED Board.   Schematic. The Controller Board. Any cheap AVR MCU like a ATmega8 can be used to control this board (also up to 4 such boards which give a total of 60px by 7px display). We are using our low cost development board as the controller to the LED matrix board. This board can be purchased at a price as low as Rs. 249 including the MCU ! So wiring this project is a matter of ten minutes ! Low Cost AVR Board   Whole Setup. Connecting The Display Module with Devboard. PIN Diagram.   PIN No PIN Name Devboard PIN 1 GND GND 2 N/C   3 +5V IN +5V out 4 N/C   5 Serial Data In […]

DS1307 Based RTC Module

An RTC Module or a Real Time Clock Module helps a system keep track of current time (hour, minutes and seconds). It automatically increments the time without any help from the host (microcontroller). Other benefit is that it has a backup power supply from a small coin cell that help it maintain the time in absence of power. It needs very small power in backup mode so that the coin cell last for years! One such RTC IC is DS1307. It communicates with the host using I2C serial interface. We have put all the required components in one PCB to make a neat module that we can hook up to our MCUs like PIC or AVR. After the experiment you can put the module safely in your drawer, bring it out after an year and still it will give you the correct time! DS1307 Module Schematic DS1307 Based RTC Module Schematic DS1307 Module Fabricated ! DS1307 Based RTC Module   Professional DS1307 RTC module     Connection with MCU The SCL line of RTC Module will be connected to SCL line of MCU similarly the SDA line will be connected to the MCU’s SDA line. The RTC Module should be powered from the microcontroller development board. Most of our boards have extra 5v output points. Please see their documentation for […]

PC Controlled Robot

In this tutorial we will discuss a simple PC controlled robot. The Robot PC link will be a RS232 serial line. The robot will have only five commands. Move forward (RS232 char ‘F’ or ‘f’) Move backward (RS232 char ‘B’ or ‘b’) Turn Left (RS232 char ‘L’ or ‘l’) Turn Right (RS232 char ‘R’ or ‘r’) Stop (RS232 char ‘S’ or ‘s’) To keep things as simple as possible, in this example we will use terminal software RealTerm for sending commands to the robot. Later on a dedicated software can be written on PC end to control the robot. The Robot’s Hardware The robot’s hardware will be a simple differential drive using two 200RPM DC Gear motor mounted on a HQ Metal Chassis with a front castor wheel. On the back motors we have mounted plastic wheels. More about differential drive is explained in this tutorial. Gear Motors   Wheels   Metal Chassis   Remove motor’s nut   Insert the motor   Fasten the nuts again   Both motors installed   Front Castor wheel   Installing the front castor   Mounting hole for wheels screw   Mounting the wheels   Chassis is ready! The Electronics The robot is controlled using xBoard v2.0 which has ATmega32 as main CPU and integrated motor drivers. We have connected xBoard v2.0 with PC using […]

Time Input Dialog for Graphic LCD

GUI Frameworks of all modern OS like Windows, Linux (Qt & GTK+), MAC etc have a concept of standard dialogs. For example all applications running under Windows shows the same file open dialog for selecting a file. Similarly their are standard dialogs for folder selection, colour selection, font selection etc. This concept has several advantages, and the most important is a easy user interface. Since the user is already familiar with file selection in one application, he/she can use file open dialog of any application. Building on the same concept our GUI framework for ProGFX (avr glcd driver) will too have many standard dialogs for common user interface. In this tutorial we will build the "Time Input Dialog" that helps programmer ask the user to input time. The time could be anything like :- "On" or "Off" time for a relay in a timer application. Alarm time in an alarm clock application. Period start time in a school bell application. And many others. The programmer just need to call the function. void ShowGetTimeDlg(uint8_t *h,uint8_t *m,uint8_t *s,uint8_t *am_pm) It takes four parameters hour, minutes, second and am_pm. All parameters are passed by reference(pointer actually), this is because the function modifies the value of those variables. It shows a dialog as shown below :- Time Input Dialog The user can use the […]

DS1307 I2C RTCC Interface using SoftI2C lib

In the last tutorial, I explained you how to use our SoftI2C library to read and write a 24CXX series I2C EEPROM. Now I will continue our exploration and write a register access layer for the DS1307 chip. The DS1307 chip is a real time clock and calendar IC. The register access layer that we will develop provides the application programmer with function that reads and write the registers of DS1307. Remember that any piece of hardware appears to the CPU as a set of registers only. DS1307 has :- Seven Registers (from 0x00 to 0x06) that are used for timekeeping functions. One CONTROL register(0x07) for square wave generation setting (we don’t use this for simplicity). 56 bytes of battery backup RAM (from 0x08 to 0x3F) Fig. : A Simple DS1307 RTC Module.   Once the application programmer has access to functions that reads and writes to any register (specified by its address) inside DS1307 ic, he/she can easily get and set the time infos like sec,min,hour, am/pm, date,month,year etc. The register access layer is built over the core Soft I2C layer. The register access layer consists of the following three functions. void DS1307Init(void) { SoftI2CInit(); } /*************************************************** Function To Read Internal Registers of DS1307 ——————————————— address : Address of the register data: value of register is copied to this. […]

AVR RGB LED and Sound Show

Here is a nice and entertaining project created by http://www.ermicro.com . The author has a very good programming, teaching, drawing and artistic skills. The tutorial is well planned and executed. I really liked the RGB LED and Sound show given at the end. I will try it and tell how it works. Till then you can read the rest of the article here. Working with Atmel AVR Microcontroller Basic Pulse Width Modulation (PWM) Peripheral AVR RGB LED and Sound Show. The article also explain various PWM techniques like Fast PWM, Phase correct pwm, phase and frequency correct pwm. You will also learn tone generation using PWM technique. Here is a Video for Various PWM Experiments

AVR Graphic LCD and Accelerometer Demo

Hello All!, Accelerometer applications are hot these days. So today I will show you how you can easily make a accelerometer add on for your AVR GLCD Board. Once you make this you can plug it into the AVR GLCD Board any time you wish to run a accelerometer based application on it. I will also provide a simple Open Source App for the AVR GLCD Board that can be used to test the accelerometer in no time. Developers can use this demo as a base for any accelerometer based app. Things you will need are A Veroboard or general purpose prototyping PCB (dotted one, not the line one). Female Burg Strips Female Burg Strip R/A MMA7260 Accelerometer Board Fig.: A Veroboard Marked for Cutting   Fig.: Veroboard Cut to Size   Fig.: Burg Strip Female   Fig.: Burg Strip Female Soldered to Veroboard.   Fig.: Burg Strip Female Soldered to Veroboard.   Fig.: 5 PIN Burg Strip Female Right Angle   Fig.: R/A Burg Strip Soldered.   Fig.: Just Ready!   Fig.: AVR GLD Dev Board   Fig.: Accelerometer Expansion Board Connected   Fig.: Accelerometer Connected.   Fig.: Accelerometer Connected with AVR GLCD Board   Fig.: AVR Accelerometer Ready! Connections     CONNECT TO GND Ground Supply Ground (EXP Port) VDD 3.3 V OUT SLEEP Sel2 G Select Pin2 […]

AVR Project – ATmega8 Based Smart Code Lock

Here is a project for beginners using Atmel AVR ATmega8. The project uses some techniques that are very useful for designers to learn and utilize. Alphanumeric LCD Module Interfacing. 4×4 Keypad interfacing. PWM Control of LED (Used to dim the back-light of LCD, like in some Nokia Phones) Basic Circuit design for AVR MCUs Connecting relays and other current demanding devices. AVR Studio and project management. compiling using free avr-gcc compiler. Using eXtreme Burner – AVR to burn hex code to AVR MCU. NOTE: Don’t waste time finding each part running from shop to shop. Get all the parts with exact specification in a ready to use kit! Purchase ATmega8 based smart code lock KIT.   Fig.: ATmega8 Based Code Lock Fig.: ATmega8 Based Code Lock Project     Functions of the Project. This device can be used to code protect any electrical device (like an electronic door, lock or safe). The user must enter a correct password to gain access. The password is entered using the built in 4×4 keypad matrix. The main LCD Module is used to display messages to the user. As soon as correct password is entered the relay is activated. This is indicated by a LED which is placed near the relay. The relay remains on as long as the user wishes. You just need […]

AVR Project – ATmega8 based RPM Meter

Hello All, Today I will show you how you can make a simple RPM Meter using AVR ATmega8. The RPM meter we will be making is a contact less type, i.e. it measures the RPM of a rotating object without actually making any contact with it. An IR reflectance sensor will be used to sense the speed. You have to attach a white reflective object (like a white paper sticker) at one point in the periphery of rotation . Then you need to place the reflectance sensor such that the white reflector comes just above it once per rotation. In this way the sensor will give one falling edge to the MCU per rotation, we will measure number of such pulse in one second to get the revolution per second, multiplying this with 60 we get RPM. For this project I will use a ATmega8 MCU connected to a 16×2 LCD Module for showing the RPM. Design of AVR based RPM Meter. The sensor part is made up of TCRT5000 IR Reflectance sensor. It it wired as shown below. The sensor will give a LOW output whenever it detects a white reflective surface just above it. This output is feed to the INT0 pin of MCU. INT0 is a general purpose external interrupt source. It can be adjusted to interrupt […]

RF Communication Between Microcontrollers – Part III

Welcome to the 3rd part of RF Communication tutorial. In the last two parts I have introduced the basics of RF Communication. RF Communication Between Microcontrollers – Part I : Introduction to RF Communication and Modules. RF Communication Between Microcontrollers – Part II : Algorithm and general description of data transfer. Part III will be covering mostly the practical part, i.e. we will build a complete & working data transfer system. Here you will get circuit and program to implement the solution. The application is very simple in this case, just to transfer a byte of data from Tx station to the Rx station. Once you implement it and get it working you will have enough information and experience to make other RF based projects. I request all users to follows the instruction exactly as given (unless they are smart enough to know what they are doing). The most important thing in this article is timing of the MCU, so Use the exact frequency crystals as used in the designs. Write High Fuse = C9 (HEX Value) and Low Fuse FF (HEX Value) to enable external crystal. Hardware We will have two units. One is Tx (Transmitter) and Other is Rx (Receiver). Both units are based around ATmega16 MCU(you can use ATmega32 also) on external 16MHz crystal. On the Tx […]