Hello everyone, The important aspect of every learning is to induce curiosity and doing something meaningful to satisfy that.With the help of that curiosity, I'm here making a volume adjuster program which resembles the same in most devices but not that much, Here the default volume will be 10.Maximum volume will be 20 as well as the minimum volume will be 5.

Well, here I'm using Proteus 8 Professional for stimulation and Mikro C Pro Plus 2012 as Embedded Compiler for programming the microcontroller because I've already ran out of hardware and money :).

Step 1: Things You will need

Since this is a fully software stimulated program, You will need not more than the following softwares:

1.Proteus 8 (Any build or Version). 2.Mikro C (Any build or Version).

Step 2: The Connections.

Open Proteus. In the Component Mode, select Pick from devices and search and double click the following components: 1.LM016L (16x2 AlphaNumeric Display LCD) 2.PIC16F877A Microcontroller (Here i am going with 16F877A as it is the most common PIC Microcontroller) 3.A Resistor or POT(Value = 10k Ohms). 4. SW_ROT_3 switch

Here we'll use the inbuilt crystal with the default frequency 8MHz.

I have used the SW_ROT_3 switch to avoid floating point errors.

I made a 4-bit connection to LCD as it is more than enough for this program.

Do the Following Connections: 1.Place the PIC16F877A 2.On the right side of it place the LCD Display. 3.In the LCD, connect VSS to gnd, VDD to +5V and RW , D0,D1,D2,D3 to ground(since its a 4 bit connection) . VEE is connected to +5V via a 10K ohms resistor. 4.We are going to use portB in PIC to control LCD. so, connect RB1,RB2,RB4,RB5,RB6,RB7 to RS,E,D4,D5,D6,D7 in the LCD respectively. 5.Connect the SW_ROT_3 switches as shown.

Step 3: The coding part(With Mikro C)

The most important part and the most frustrating part is the coding part. This code is no complex . This is a very simple code. Though it appears as more complex, appearances are deceptive:). Open MikroC. Create a new project and select P16F877A microcontroller with frequency 8Mhz. name the project as 'Volume Adjuster' and include all library files in it. If you don't wanna include all library files, then include and in your program.Just copy and paste the code in Mikro C

//Coding BEGIN //AN ARTICLE BY TheEffectiver. // specify what pins will be used as what. THis bit of code is necessary. sbit LCD_RS at RB1_bit; sbit LCD_EN at RB2_bit;

And build the project by pressing ctrl+F9 mikro c will produce the hex file for you. make sure you save the project and know the path of the hex file.

Volume Adjuster.c2 KB

Volume Adjuster.hex4 KB

Step 4: The Final Part

Thank god.. we have finished all the irritating parts and came to the end.Here is what you have to do 1.In proteus, double click or right click the PIC microcontroller and select edit properties. 2.In the program file text box, click the folder icon and select the .hex file that mikro c generated for you. 3.Click OK and start the stimulation. 4.To increase the volume, adjust the SW1 switch. 5.To decrease the volume, adjust the SW2 switch.