AVR Tutorials

AVR TUTORIALS

Free for all tutorials on AVR microcontrollers, presented by Sincgrid. A series of experiments on Atmega328P based MCU. Arduino Nano based AVR motherboard was used to perform a variety of experiments. Additionally, for ease of component connections peripheral boards Mini Voyager 1 and Mini Voyager 2 were used.

Let’s start our journey in the field of embedded electronics. We hope to see more and more students, learners and hobbyists continue to grow their expertise in the field of embedded electronics.

LIST OF EXPERIMENTS

EXPERIMENT NUMBER EXPERIMENT BOARD REQUIRED
1 Flash LED at an observable rate. MV1
2 Hello LED – Flash LED at a rate such that the LED appears always on. Estimate the onset of the rate when the LED appears to stay on MV1
3 Controlling ON/OFF of an LED using switch MV1 OR MV2
4 Use LFSR based random number generator to generate a random number and display it MV1 OR MV2
5 Toggle the LED every second using Timer interrupt MV1
6 Use the potentiometer to change the red LED intensity from 0 to maximum in 256 steps MV1
7 Use the switch to select the LED (from RGB led) and then the potentiometer to set the intensity of that LED and thus create your own color from amongst 16million colors MV1
8 Read the ADC value of the voltage divider involving the LDR. Print the value on the serial monitor MV1
9 Use the LDR and estimate a threshold for the LDR value and use that to turn the RGB LED on, to simulate an ‘automatic porch light’ MV1
10 Use the thermistor to estimate the temperature and print the raw value on the serial monitor MV1
11 Connect the LCD I/O Board and print ‘Hello World’ on the LCD. Scroll display from left to right MV2
12 Use the on-board EEPROM to store the temperature min and max values together with a time stamp MV2
13 Speed control of D.C. motor MV3
14 Speed control of Stepper motor MV3
Prerequisite software setup for experiments are as follows :-
  1. Atmel Studio ( latest version) , it can be downloaded from https://www.microchip.com/avr-support/atmel-studio-7 . The installation setup video is available here (google drive link).
  2. Arduino IDE, it can be downloaded from https://www.arduino.cc/en/Main/Software.
  3. CH340 drivers, it may be required in some cases. It may be downloaded from here (google drive link).
  4. Setup for a given hardware (AVR kit) is done using following steps, these steps were also provided in the installation video. For a given hardware setup and PC, these are required to be done only once.
Hardware setup provided consists of the following :-
  1. AVR motherboard – The main controller board, consisting of Arduino Nano.
  2. Mini Voyager 1 – Peripheral board for experimentation, consisting of digital, analog inputs and outputs.

AVR Motherboard pinouts :-

PORT MAP FOR ARDUINO NANO AND ATMEGA328P (anticlockwise, from left to right)
ARDUINO NANO PIN ATMEGA 328P PORT MAPPING
D13 PB5
A0 PC0
A1 PC1
A2 PC2
A3 PC3
A4 PC4
A5 PC5
A6 ADC6
A7 ADC7
TX1 PD1
RX0 PD0
D2 PD2
D3 PD3
D4 PD4
D5 PD5
D6 PD6
D7 PD7
D8 PB0
D9 PB1
D10 PB2
D11 PB3
D12 PB4
Mini Voyager 1

Mini Voyager 1, Schematic -> Link
Mini Voyager Board File -> Link