DC Motor Direction Control with Arduino in Proteus

Hello friends, hope you all are fine and having fun with life. Today, I am going to share DC Motor Direction Control with Arduino. I have designed a complete simulation in Proteus, which will help you in understanding the controlling of DC motor. I would recommend you to first read How to Control relay in Proteus ISIS which will help you in understanding the functionality of relays because in today's tutorial, I have used relays to do the DC Motor Direction Control. I have already posted a tutorial on DC Motor Drive Circuit in Proteus ISIS.

So, for DC Motor Direction Control, I have used Arduino UNO baord, so you should also download this Arduino Library for Proteus so that you can use Arduino boards in Proteus software. I have also provide the simulation and the code for DC Motor Direction Control but I would recommend you to design it on your own so that you learn from it. If you have any problem then ask in comments and I will try to resolve them. In this project, I have used Serial Terminal. So, whenever someone, sends character "C" on serial terminal then the motor will move in Clockwise Direction and when someone sends character "A" then it will move in Anti-clockwise Direction and will stop on character "S". Anyways, lets get started with DC Motor Direction Control with Arduino in Proteus ISIS.

DC Motor Direction Control with Arduino in Proteus ISIS

  • You can download the Proteus simulation for DC Motor Direction Control by clicking the below button:
Download Proteus Simulation for DC Motor

  • So, now let's move on with designing it, first of all get the below components from Proteus and place them in your workspace:
  • Now, design a circuit in Proteus software, as shown in below figure:
  • You can see in the above figure that I have used two relays which I have used for DC Motor Direction Control.
  • Moreover, there's a Virtual Terminal through which I am sending the commands.
  • I have used Arduino UNO board for DC Motor Direction Control through Virtual Terminal. You should download the Arduino Library for Proteus so that you can use it in Proteus.
  • Now upload the below code in your Arduino software and get the hex file. You should read how to get the Hex file from Arduino.
int Motor1 = 2;
int Motor2 = 3;

void setup() {
  pinMode(Motor1, OUTPUT);
  pinMode(Motor2, OUTPUT);
  Serial.begin(9600);
}

void loop() {
  if(Serial.available())
  {
    char data = Serial.read();
    Serial.println(data);
    if(data == 'C'){MotorClockwise();}
    if(data == 'A'){MotorAntiClockwise();}
    if(data == 'S'){MotorStop();}
  }
}

void MotorAntiClockwise()
{
  digitalWrite(Motor1, HIGH);
  digitalWrite(Motor2, LOW);
}

void MotorClockwise()
{
  digitalWrite(Motor1, LOW);
  digitalWrite(Motor2, HIGH);
}

void MotorStop()
{
  digitalWrite(Motor1, HIGH);
  digitalWrite(Motor2, HIGH);
}
  • In the above code, I have designed three functions which I am calling on Serial receive.
  • The code is quite self explanatory but if you got problem then ask in comments and I will resolve them.
  • Once everything's done then run your simulation and if you have done fine then it will start working as shown in below figure:
  • Obviously, you can't see a moving DC motor in an image but you can get the idea from Relays position in above figure. :)
  • The below video will give you the better idea of How it works.

So, that's all for today. Hopefully now you have got the idea of How to do DC Motor Direction Control with Arduino in Proteus ISIS. In the next tutorial, I am gonna add speed control of DC Motor. So, till then take care and have fun. :)

Genuino Library for Proteus

Hello friends, hope you all are fine and having fun with your lives. Today, I am going to share a new Genuino Library for Proteus. Genuino boards are just the same as Arduino boards but with slight difference of color and shape. I have already posted a tutorial on Arduino Library for Proteus in which I have explained how to download the Arduino Library and use it in Proteus. Today, I am going to post a similar library but for Genuino boards. Their functionality is exactly the same as the Arduino Library but they have better look and Genuino Color.

II hope you are gonna like this library as well. Other bloggers are welcome to share this library with their reader but do mention our link in creator section, we will be really obliged. Now, let's start with the Genuino Library for Proteus.

Genuino Library for Proteus

  • First of all, download the Genuino Library for Proteus from the below button:
Genuino Library for Proteus

  • In the above link, you will get an rar file which will have two files, named as:
    • GenuinoTEP.LIB
    • GenuinoTEP.IDX
  • Now place these two files in the Library folder of your Proteus software.
Note:
  • Now start your Proteus software and go to Component searching section and search for GenuinoTEP as shown in the below figure:
  • Now place them in your Proteus work space and they will look like as shown in below figure:
  • In the above figure, five of these genuino boards are visible. The sixth board is Arduino Mega1280, which is similar to Arduino Mega 2560 in shape so that's why I have omitted it in the above image.
  • Now you can design any of your project on Genuino board quite easily in Proteus using this Genuino Library for Proteus.
  • In order to upload the code in any of these boards you need to double click it to open its properties.
  • For example I double click the Arduino UNO baord then the Properties panel will look like as shown in below figure:
  • In the above figure, you can see a section named Program file, that's where you are gonna browse your hex file.
  • You should read How to get Hex file from Arduino, if you don't know already.
  • So, get the hex file and upload here and your Genuino board will get active.
  • In the below video, I have explained in detail How to use this Genuino board in Proteus and have already tested the blink example.

That's all for today, I hope you will enjoy this Genuino Library for Proteus. Let me know your suggestions about this library. Have fun !!! :)

How to Install Android Studio ???

Hello Friends, welcome back to the second tutorial of ‘Android Application Development’ by ‘The Engineering Projects’. I hope you guys are fine and enjoying your lives. In the previous tutorial, we have seen How to Get started with android studio. Today, we are going to have a look at How to install Android studio on your computers. Its a beginner level tutorial and is quite essential for beginners. Because when you plan to start learning some new software then its correct installation and environment setup is the main key. When you are going to start with the installation of any platform, first of all, what you need to do is to set up the environment in proper way. So that's why, today we are going to cover the installations of all the software required to start with Android application development.

It is very important for you guys to follow each and every step carefully. But sometimes even by adopting the right methodology, you are not being able to set up the right environment for the development. This happens because of your product version or system configuration unexpected results. Before stepping up the installing phase, I would like to mention one important thing that Android Studio is a very strong development tool. So that's why, I would recommend you guys to use at least i3 with 4GB but preferable is 8GB RAM, otherwise your laptop or computer will struck again and again and takes a lot of time. Let’s start without wasting anymore time. As I recall, in the end of our previous tutorial, I mentioned all the software we required to start our first project. So let’s install Android studio and all of the related software one by one.

Installation of Java Development Kit (JDK)

In order to install Android studio, first what we need to install is Java Development Kit which is known as JDK. Java Development kit is essential to install before the installation of Android studio because our Android studio works on Java so that's why its essential to install JDK first. JDK contains libraries, compiler, Debugger, java virtual machine, user interface toolkit and all the other basic components required for Android Application and Applets Development. Let’s move to the Java Development Kit (JDK) installment, as I mentioned in my previous tutorial that all the software required for Android Application Development are free of cost, so you guys can simple download JDK from their official site, just by clicking on JDK and I will recommend you to install the latest version of it. After the installation of JDK, now we are ready to install Android Studio. So, let's get started with it.

How to install Android Studio ???

  • Android Studio is the actual development software we are going to use for the Android application development. We will do designing and will write all the codes in Android Studio.
  • Android Studio is also free of cost, so you guys should download it from the official site of Android.
  • The site would have the display as shown in below figure, click on the green button on the left bottom to download Android Studio.

  • Once you click the download button, Google will ask you to accept their ‘Term and Conditions’.
  • After reading all the ‘Terms and Conditions’ go to the end of the page, you will see the check box.
  • Click on the check box to accept all the Terms and Conditions of Google and then click on the button under the check box to download Android Studio.
  • Now the downloading will be started.
Installation of Android Studio
  • Once the downloading completes, double click on the downloaded file and execute it. Installation will start like the one given below:
  • It will take a few seconds and then it will move to the next step, as shown below:
  • Click on the ‘Next’ Button and then check the box for “Standard” and click ‘Next’.
  • And finally click on the ‘Finish’ as shown in below figure:
  • After clicking on ‘Finish’, it will take some time to complete the installment. You will also need to be connected with the internet.
  • Once everything done, then you will get to the below screen and simply click finish to complete the installation.
  • You will see the Welcome Screen after the installment would be completed. So now friends, you guys are ready to develop your first Android Application.
  • Here's the welcome screen of Android studio:

Software Development Kit (SDK)

In the previous section, we have seen How to Install Android Studio. Now, we are gonna install the SDK. Basically SDK is a set of tools which allows you to make applications, games, Applets for certain software package, computer system, software framework, video game console, hardware platform, operating system, or similar development platform. So it is pretty much important to install required SDK before developing your first application. So, let's get started with installation of software development kit (SDK).

  • First of all, click on the ‘Configure’ and it will take you to the window as shown in below figure:
  • Click on the SDK Manager. It will take a few seconds to check all the online SDK available right now and then it will show you all the installed, not installed, update available and partially installed SDK as shown in below figure:
  • Click on the pointed ‘Launch Standalone SDK Manager’ as shown in above figure.
  • Now when you click, it will open the window, where you can select the SDK, you want to install, as shown in below figure:
  • I will suggest you to install at least 3 of them which are very important and plays important role:
  1. Tools
  2. Android 4.4.2 (API 19)
  3. Extras

Unexpected Results or Errors:

Several users have to face some difficulties after completion of the Android Studio Installation on Windows 7 and windows 8. When they try to open Android Studio after installing it, they get errors.

  1. Fail to load JVM.DLL
  2. dll is missing
So here is the solution to these problems.
Fail to load JVM.DLL
When you open the Android studio, this error will pop up like the window given below:
  1. Go to the Control Panel and selectSystem.
  2. Click on “Advanced system settings” from the column on the left side and go to the “Advanced” tab.
  3. Click the “Environment Variables” button at the bottom. On the next screen, you will see two sections, User Variables and System Variables.
  4. Now add a system variable with the following values. Variable name:JAVA_HOME Variable Value: c:\program Files\Java\jdk1.7.0_21

May be you have different jdk version as compare to the one given in Variable Value. So before adding the value check your jdk version in this directory c:\program Files\Java\

MSVCR100.dll is missing

If this window comes up after adding the System Variable, then you need to install Visual Studio 32 or 64 bit.

This is it for now. I hope you now have got the idea about How to install Android studio in windows. In the next tutorial we’ll develop our first Android Application and discuss some of the basics of Android Studio. If you guys have any questions or suggestions, feel free to comment about them. So Stay tuned and have fun. See you guys later.

Getting Started with Android

Hello Friends, My name is Syed Daniyal Nasir. I hope you guys are fine and enjoying your lives with passion. Today, we are going to start the new series of tutorials related to Android Development and here's my first tutorial in thie series which is, Getting Started with Android. This is gonna be my first tutorial of Android Development for “The Engineering Projects”. As we all know, Android Development is enhancing vigorously day by day, Google Play Store is flooded with tons of new mobile applications each day. So a lot of people want to understand the basics of Android Development, so that they could develop their own applications. But some people find it very difficult due to certain reasons. That’s why we are going to make these tutorials as simple as possible, so that most of the people can find it useful. Now let’s get started with today's tutorial which is Getting started with Android.

In today's tutorial, we are not gonna cover anything technical. Instead, we are gonna stick to the basics of Android, like why we need Android and why we need to getting started with android. I will also share some useful theoretical knowledge in this post. So, my suggestion is to must read it once. Anyways, let's have a look on Android. :)

Note:

  • This tutorial is written by my brother SyedDaniyal Nasir, as he mentioned above, I am just posting it here on my blog as he was not free to do it on his own.
  • Welcome bro to my blog. :)

Getting Started with Android

Android Platform was developed by Open Handset Alliance which is then led by Google and they gave it a very attractive look and now a days, Android has been the most selling OS on Smart Phones and Tablets. Android is basically a touch screen mobile open source operating system based on Linux Kernel. In 2007, Google released the first beta version of the Android Software Development kit (SDK) and later in the next year, first commercial version by the name “Android 1.0” was finally released in September, 2008 by Google.

Android Programming

Android Programming style is based on Java Language. So for Android Development, you need to have a little bit knowledge of Java Language. Sun Microsystems released the first version of Java language in 1995. Most of the devices support Java language like, smart phones, Tablets, Raspberry Pi, laptops, desktop computer and many more. There is a little complication, to run Java code on any platform, needs to have a Virtual Machine implementation. But you don’t need to worry about it right now, we’ll cover this in our upcoming tutorials. So if you have some knowledge of Java Language then I am sure that you will find it very interesting.

Why Android?

If you are taking your first step towards the Mobile Application Development. You should definitely start with Android. Some of the key points are shown in the following figure.

Android Versions
Android versions were named in alphabetical order. This first android version was named as Aestro while the latest one is Marshmallow. So, we have Android versions from A to M, which are shown as follows:
  • Aestro.
  • Blender.
  • Cupcake.
  • Donut.
  • Eclair.
  • Froyo.
  • Gingerbread.
  • Honeycomb.
  • Ice Cream.
  • Sandwitch.
  • Jelly Bean.
  • KitKat.
  • Lollipop.
  • Marshmallow.
What is API?
API stands for Application Programming Interface and API is used to interact with different systems, libraries and applications. API level is a value which shows the API version. Here's a small table for different versions of Android with respect to their API versions.
Android Applications

As of July, 2015, more than 1.6 million applications have been published on Google play store and the number are increasing day by day. If we categorized the Android Applications, the top categories will be:

Operating System Requirement for Android Development

This is one of the beauties of Android that you have a lot choices for Operating Systems. Some of the commonly used operating systems are:
  • Microsoft Windows XP or later version.
  • Mac OS X 10.5.8 or later version with Intel chip.
  • Linux including GNU C Library 2.7 or later.

Development Tools

Second beauty of Android is that all the development tools are free of cost. You just simple go to their website and download them as requirement. Some the important tools you will probably be needed for the Android Development are:
  • Java JDK5 or later version
  • Android SDK
  • Java Runtime Environment (JRE) 6
  • Android Studio
  • Eclipse IDE for Java Developers (optional)
  • Android Development Tools (ADT) Eclipse Plug-in (optional)
This is it for now. In the next tutorial we’ll discuss about the Development Tools qualities and their installation process. If you guys have any questions or suggestions, feel free to comment about them. So Stay tuned and have fun. See you later guys.

Bluetooth Library for Proteus

Hello friends, hope you all are fine. Today, I am going to share a new Bluetooth Library for Proteus. Using this Library, now you can quite easily use Bluetooth modules in Proteus ISIS. I have designed two Bluetooth modules which are HC-05 and HC-06. We all know about these modules. We use these modules for sending data through Bluetooth. Till now, there's no such Bluetooth Library designed for Proteus and we are the first developers of this awesome Bluetooth Library for Proteus. I hope you guys are gonna like it. I have also posted a tutorial in which I have done Arduino Bluetooth Communication using HC05 in hardware. I hope that one will also be interesting to read, if you have planned to start working on Bluetooth Module.

Other bloggers are welcome to share this Bluetooth Library for Proteus on their blogs but do mention our link as a respect to our efforts. These Bluetooth modules are not gonna accept AT Commands rite now as we haven't added much functionality in it but we are gonna add more soon. I will also add more Bluetooth modules in this library and will update it with time. Rite now, it just has two Bluetooth modules in it, which are:

You can do serial communication with these modules quite easily. So, let's get started with Bluetooth Library for Proteus an see How to install it and how to use it in Proteus.

Note: Other Proteus Libraries are as follows:

Bluetooth Library for Proteus

  • So, first of all, download this Bluetooth Library for Proteus by clicking the below button:
Bluetooth Library for Proteus

  • In this rar file, you will find two files which are named as:
    • BluetoothTEP.IDX
    • BluetoothTEP.LIB
  • So, download these two files and place them in the library folder of your Proteus ISIS software.
Note:
  • Now open your Proteus software or restart it if its already open and search for Bluetooth and you will get something as shown in below figure:
  • Now select both of these modules and place them in your workspace and it will look like something as shown in below figure:
  • As, I told earlier, we have just used the basic TX and RX pins of these Bluetooth modules.
  • That's why you can see in the above figure that only TXD and RXD are working while all others are not working.
  • Let's have a look at it working, so let's design a simple circuit and do the communication between these two Bluetooth modules.
  • If you haven't worked on Virtual Terminals then you should read How to use Virtual Terminal in Proteus.
  • So, design a simple circuit as shown in below figure:
  • Now click any HC-05 module and you will get a pop up window.
  • In this window, select COM1 for first HC05 module and COM2 for second HC05 module.
  • Now your COM1 and COM2 should be virtually connected, I have shown how to connect the COM ports virtually in the below video.
  • Now, run your simulation and whatever you send in first terminal will show in second terminal and vice versa.
That's all for today, hope you have liked this post and are gonna enjoy it. Let me know about your remarks for this Bluetooth Library for Proteus. Have fun !!! :)

Arduino Bluetooth Communication using HC05

Hello friends, hope you all are fine and having fun with your lives. Today, I am going to share a new project in which we are gonna do Arduino Bluetooth communication. The Bluetooth module I have used for this project is HC-05, which is a serial Bluetooth module. We can quite easily perform the Bluetooth communication with this module using Arduino board. I have worked on many projects in which I have to send the data from sensors to my computer via Bluetooth. So, in such projects I normally use this Bluetooth module which is connected with the sensors and then Arduino gets the data from these sensors and then send this data to computer via Bluetooth module. In this project, I have used Arduino board but you can use PIC Microcontroller or 8051 Microcontroller as well. Because they both have the Serial pins on them.

Note:

Before reading any further, I think you must have a look at the below post from where you can download the Bluetooth Library for Proteus, using this library you can easily simulate HC-05 or , HC-06 in Proteus software:

I have also done Bluetooth communication with Android mobiles. In these projects I have sent the data from this Bluetooth module to Android mobiles but in such projects I have also designed Bluetooth app on which this data is received. Anyways, that's a topic of another tutorial. Today, I am gonna connect this Bluetooth module with Arduino board and then will send some data to my computer using Bluetooth. So, let's get started with Arduino Bluetooth communication using HC-05 module.

Arduino Bluetooth Communication using HC-05

  • First of all, what you need to do is to buy the Arduino board. I have designed this project using Arduino UNO board but you can buy any of the Arduino Microcontroller board.
  • Next thing you are gonna need is Bluetooth module which is HC-05. But this tutorial will also work for HC-06 or HC-07.
  • Now if you have seen HC-05 then the pins are written on it so connect them with your Arduino board as shown below:
  • This pin configuration is also shown in the below figure:
  • Now that you have connected your Arduino board with the Bluetooth module HC-05 so you are ready to do the Arduino Bluetooth communication.
  • Now upload the below code in your Arduino board:
#include <SoftwareSerial.h>

SoftwareSerial mySerial(2, 3);

void setup()
{
  Serial.begin(9600);
  mySerial.begin(9600);
}

void loop() 
{
  if (mySerial.available())
    Serial.write(mySerial.read());
  if (Serial.available())
    mySerial.write(Serial.read());
}
  • Its a simple software serial code in which we are sending data from our Serial terminal to Bluetooth means whatever you write in your serial terminal will be sent over to Bluetooth and whatever you receive on your Bluetooth will be shown in serial terminal.
  • Now, download this Serial monitor software, I have designed this software and its quite simple one. You can use any other serial monitor like Virtual Terminal in Proteus or Hyper Terminal in Windows XP.
  • We are gonna use this software to get the data on our computer via Bluetooth and you computer must have the Bluetooth in your computer. :P
  • So, download this software by clicking the below button and you can read more about it Microsoft Visual Basic 2010 - Com Port Tutorial.

Download Serial Terminal

  • Now turn on your Arduino and search for the Bluetooth device in your Bluetooth settings and paired with it as shown in below figure.
  • The default pin code for HC-05 is 1234.
  • Now you can see I have paired the HC-05 device.
  • Now, open this software and connect with the COM port of your Bluetooth device.
  • The Bluetooth device generates two COM ports in my case it generated COM11 and COM12 but COM11 worked.
  • So, I connected with COM11 and then whatever I entered in my software is shown on the serial monitor of my Arduino and whatever I entered in the Serial monitor of Arduino is shown in the serial terminal software.
  • Its quite simple and you can do it quite easily.

So, that's all for today and I hope you are gonna make it work in the single attempt. If still having problems then ask in comments and I will resolve them. So, today we have done Arduino Bluetooth communication using HC-05 module.

Electronic Door Locks using PIC Microcontroller

Hello friends, hope you are having fun. Today, I am going to share two types of Electronic Door Locks design using PIC Microcontroller and simulated in Proteus ISIS software. We all know about Electronic Door Locks as we have seen them in many homes. In electronic door locks, there's some password that is only known to some persons. Now if you enter the wrong password then the door won't open up and will ask for the password again. And if you keep on trying the wrong password then it will start the buzzer or can alert the concerned person via SMS etc. So, such electronic door locks are quite common in our society and are considered among the best electronic door locks.

Today, I am going to share a similar project in which I have simulated an Electronic Door lock using PIC Microcontroller. I have used PIC18F452 Microcontroller and the compiler I have used for designing the code in MikroC Pro For PIC and the simulation is designed in Proteus ISIS. The code and the Proteus simulation are given for download below. You can also design this project using Arduino or any other microcontroller like 8051 Microcontroller. Let's start with this project.

Note:

Electronic Door Locks using PIC Microcontroller

I have divided this Electronic Door Locks Project into few parts, and I have explained them separately. You can download the complete project along with the Proteus simulation by clicking the below button. But as I always suggest don't just download it, also design it on your own so that you learn more from it:

Electronic Door Locks using PIC Microcontroller

Project Overview of Smart Door Lock

  • In this smart door lock project, I have used a solenoid along with a relay.
  • We all know that in order to lock a door we have to use either a DC Motor or some solenoid, which should be connected with the manual lock of the door.
  • Now, all we need to do is to move that motor according to our needs automatically. Like if I move the motor in one direction, the door goes locked and if I move it in opposite direction then it got unlocked.
  • So, in my simulation, I have used a solenoid valve for locking purposes and I have represented it using Inductors in my simulation.
  • Moreover, I have used Serial Terminal as a communication medium, means we are gonna input for password etc in the serial monitor.
  • I have also used EEPROM in this project to save the current password.
  • There's an option in this project to change the password, so if the user changed the current password then the new password will be saved in EEPROM.
  • So, even if the device restarts, the newly changed password will remain active as it's saved in EEPROM.
  • If the user entered the wrong password then the system will for the password again.
  • But if the user entered the wrong password three consecutive times, the system will shut down and will start blinking the RGD lights, which I have used as an indication.

Schematics Diagram of Smart Door Lock

  • Let's first design the schematics diagram of the Electronic Smart Door Lock using a PIC Microcontroller.
  • I have designed the schematic in Proteus ISIS software as it's the best simulating software.
  • The schematic diagram is shown in the below figure:
  • It's quite clear from the above figure that I have used a PIC Microcontroller as the brain of the system.
  • I have a serial terminal, which is used to take inputs from the users.
  • I have used two relays and in order to drive those relays, I have used transistors.
  • Transistors are converting 5V coming from Microcontroller into 12V which are driving relays.
  • Moreover, I have also used optocouplers, which are just used for protection.
  • Finally, I have used three LEDs that are acting as RGB and will just indicate the wrong password.
  • These two relays are actually actuating the solenoid which will lock or unlock the door.
  • There's no active solenoid component available in Proteus that's why I have used a simple inductor.
  • Now, let's have a look at the programming code for this project.

Programming Code of Electronic Door Lock

  • I have designed the programming code for PIC Microcontroller in MkiroC Pro for PIC compiler.
  • You should have a look at these Top 3 PIC C Compilers and can select the one you like.
  • The PIC Microcontroller used in this Electronic door locks project is PIC18F4520. You can also use other PIC Microcontrollers like PIC16F877a etc.
  • You can use any other PIC Microcontroller if you want. You just need to change it in simulation and in code settings.
  • Now here's the complete programming code for Electronic Door Locks using PIC Microcontroller:
 char Indata;
 char P1 = '1';
 char P2 = '2';
 char P3 = '3';
 int PassCheck = 0;
 int WrongCheck = 0;
 int CPassCheck = 0;
 

void Initialization()
{
      UART1_Init(9600);
      TRISD = 0;
      PortD = 0;
      P1 = EEPROM_Read(0x01);
      P2 = EEPROM_Read(0x02);
      P3 = EEPROM_Read(0x03);
}

void PassChange()
{
            while(1)
            {
                  if (UART1_Data_Ready())
                  {
                        Indata = UART1_Read();

                        if(CPassCheck == 2){
                             CPassCheck = 3; 
                             EEPROM_Write(0x03, Indata); 
                             P3 = EEPROM_Read(0x03);}
                        if(CPassCheck == 1){
                             CPassCheck = 2; 
                             EEPROM_Write(0x02, Indata); 
                             P2 = EEPROM_Read(0x02);}
                        if(CPassCheck == 0){
                             CPassCheck = 1; 
                             EEPROM_Write(0x01, Indata); 
                             P1 = EEPROM_Read(0x01);}
                        UART1_Write_Text("*");
                        if(CPassCheck == 3){break;}
                  }
            }
            
            UART1_Write(10);
            UART1_Write(13);
            UART1_Write(10);
            UART1_Write(13);
}

void CorrectPass()
{
            UART1_Write(10);
            UART1_Write(13);
            UART1_Write(10);
            UART1_Write(13);
            UART1_Write_Text("Select one of the below Options: ");
            UART1_Write(10);
            UART1_Write(13);
            UART1_Write(10);
            UART1_Write(13);
            UART1_Write_Text("1) Press Y to Lock.");
            UART1_Write(10);
            UART1_Write(13);
            UART1_Write_Text("2) Press N to Unlock.");
            UART1_Write(10);
            UART1_Write(13);
            UART1_Write_Text("3) Press C to Change Password.");
            UART1_Write(10);
            UART1_Write(13);
            UART1_Write(10);
            UART1_Write(13);
            UART1_Write_Text("Waiting for Response: ");
            
            while(1)
            {
                  if (UART1_Data_Ready())
                  {
                        Indata = UART1_Read();

                        if((Indata == 'Y') || (Indata == 'y')){
UART1_Write_Text("Y"); 
PortD.F0 = 1; 
PortD.F1 = 0; 
UART1_Write(10); 
UART1_Write(13); 
UART1_Write(10); 
UART1_Write(13); break;}
                        if((Indata == 'N') || (Indata == 'n')){
UART1_Write_Text("N"); 
PortD.F0 = 0; 
PortD.F1 = 1; 
UART1_Write(10); 
UART1_Write(13); 
UART1_Write(10); 
UART1_Write(13); break;}
                        if((Indata == 'C') || (Indata == 'c')){
UART1_Write_Text("C"); 
UART1_Write(10); 
UART1_Write(13); 
UART1_Write(10); 
UART1_Write(13); 
UART1_Write_Text("Enter New Password: "); 
PassChange();break;}


                  }
            }
}

void WrongPass()
{
         int x = 0;
         PortD.F5 = 1;
         while(1)
         {

             PortD.F2 = 1;
             Delay_ms(100);
             PortD.F2 = 0;
             PortD.F3 = 1;
             Delay_ms(100);
             PortD.F3 = 0;
             PortD.F4 = 1;
             Delay_ms(100);
             PortD.F4 = 0;
             x = x + 1;
             if(x > 30){break;}
         }
         PortD.F5 = 0;
}


void main() {
      Initialization();

      do
      {
          UART1_Write_Text("Enter Password: ");
          while(1)
          {
                if (UART1_Data_Ready())
                {
                      Indata = UART1_Read();

                      if((Indata == P1) && (PassCheck == 0)){PassCheck = 1;}
                      if((Indata == P2) && (PassCheck == 1)){PassCheck = 2;}
                      if((Indata == P3) && (PassCheck == 2)){PassCheck = 3;}

                      if((Indata == 13) && (PassCheck == 3)){
PassCheck = 0; 
WrongCheck = 0; 
UART1_Write(10); 
UART1_Write(13); 
UART1_Write_Text("Correct Password.");
CorrectPass();break;}
                      if((Indata == 13) && (PassCheck != 3)){
PassCheck = 0; 
UART1_Write(10); 
UART1_Write(13); 
UART1_Write_Text("Wrong Password."); 
WrongCheck = WrongCheck + 1; 
if(WrongCheck == 3){WrongPass();}
UART1_Write(10); UART1_Write(13); 
UART1_Write(10); UART1_Write(13);break;}
                      UART1_Write_Text("*");
                }
          }

      } while(1);
}
  • I have placed checks on the Enter button like when the user presses Enter button then it will check either password is correct or wrong and then will decide and on or off the respective relays.
  • Moreover, the third option is to change the password and you can see right after the change password, I have used EEPROM commands to save the password for later use.
  • Let's now start the simulation and test our project.
Note: If you are not much familiar with relays, then you should read these tutorials on relays:

Electronic Door Lock Simulation Result

  • We have seen all the details about the project and I am quite confident that now you can quite easily design this project on your own.
  • So, now let's start the simulation and have a look at the results.
  • When you start your simulation then you will have such a screen:
  • Now you can see, it's asking for a password in the Virtual Terminal.
  • The default password set is "123". So, I am gonna give it 123.
  • Now, when I gave it the correct password, it asked for the correct option.
  • I have added a total of 3 options to it, which are shown in the above figure.
  • So, if the user presses Y then it will lock the door and if he presses N then it will unlock the door and last option is to change the password which is set for C.
  • So, that's how this project is working.
  • Similarly, if I gave it the wrong password the nit will ask for try again for 3 times and then will set off the RGB lights to warn.
  • Complete demonstration and working of this project is given in the below video:

That's all for the electronic smart door lock project using PIC Microcontroller. I hope you have enjoyed it. Will meet you guys in the next tutorial soon. Till then take care and have fun. :)

Electronics Projects

Hello friends, hope you all are fine and having fun with your lives. Today, I am going to share a complete list of Electronics Projects which I have posted on our blog. I hope you are gonna enjoy these electronics projects. Most of these electronics projects are designed using Proteus simulation software. I have also uploaded these simulations in the respective project tutorial. So, you can download those projects and can learn from them a lot. If you ask me then I suggest that instead of downloading these electronics projects simulations, you should design them on you own so that you learn from them. I know you are gonna do mistakes but you won't learn unless you do mistakes. :)

All these projects are completely designed by our team so other bloggers are welcome to share them on their blogs to share the knowledge but do mention our blog link as a favor. Moreover, if you guys got into any trouble in any of these tutorials then ask in comments and I will try my best to resolve them as fast as I could. I will keep on updating this list. Whenever I post some new electronics project on my blog, I will share the link here. So, its like we are having all electronics projects in one place. I hope you are gonna like it. I have divided these electronics projects in sections depecding upon the microcontroller used for designing them. I have used Arduino , PIC Microcontroller and 8051 Microcontroller usually for designing electronics projects so I have divided it in the same category. Let's get started with it:

Electronics Projects

I have divided these projects in separate sections as posting them all at once will make them a mess. So, I have divided them according to their types and I think it will be easy to read them out that way. So, first of there's Arduino based Electronics Proejcts and after that I have posted electronics projects on PIC Microcontroller and finally on 8051 Microcontroller. I have also added few projects on 555 Timer at the end. So, let's start with it:

Arduino based Electronics Projects

All these below electronics projects are designed using Arduino board. If you are interested in Arduino then you should check Arduino Projects where I have posted all about Arduino and have posted many tutorials on it. Here I am posting only those Arduino links where's electronics is involved. On the Arduino main page you will also find Arduino Library for Proteus which is designed by our team and will be really helpful to you if you wanna design the simulation of Arduino based projects in Proteus.

PIC based Electronics Projects

Here's a list of PIC Microcontroller based electronics projects. These are not much but I am gonna add more soon. Most of these PIC Microcontroller projects are designed in Proteus software. Their simulations and programming code are also given in these projects which you can download and use. But as I always say don't just copy paste them. Instead design them on your own so that you learn from them.

8051 based Electronics Projects

Here's a list of 8051 Microcontroller based Electronics Projects. These are all design in Proteus software and their simulations are also given in the respective project to download. I am gonna add more soon in this section as I am working on many projects which involves 8051 Microcontroller. I will update the list soon.

555 Timer based Electronics Projects

These are 555 Timer based Electronics Projects. These are also designed in Proteus software. You can download the simulations as well in these links. Its kind of a bonus here :) but you 555 Timer is used quite a lot in simple projects because microcontroller become costly for simple projects and also there's no need of programming 555 Timer.

So, that's all for today. I hope you are gonna enjoy these Electronics Projects. Actually I am compiling things on my blog and giving them a proper arrangement. :) If you have any suggestion please post in the comments. So, take care and have fun !!! :)

   

Top 3 PIC C Compiler

Hello friends, hope you all are fine and having fun in your lives. Today, I am going to share Top 3 PIC C Compiler. We all know about PIC Microcontrollers because of which now we can quite easily add complex automation in our projects. So, today, I am going to share C compilers for PIC Microcontrollers. When an engineer starts working on some engineering project then he must have to choose a microcontroller. PIC is most commonly used Microcontroller in engineering projects. So, now when you have selected that you are gonna use PIC Microcontroller in your project then there comes a need which compiler to use for designing programming code for PIC Microcontroller.

It's quite a difficult as well as important decision because I have seen that once you started working on some compiler then its quite difficult to switch from that compiler to any other compiler. The reason is, you have to first learn that compiler and then you start designing your codes on it and after learning one compiler you don't want to learn any other compiler. So, today I am going to share a List of PIC C compiler which are quite useful and I consider them the best compilers for PIC Microcontroller. Before going into details, lets first have a look at what is compiler.

What is Compiler ???

  • In the start when microcontrollers were newly introduced, they were programmed in Machine language which is in the form of 0 and 1. We can also call it binary language. So, programming a microcontroller in machine language was quite difficult so designers did some research and they cme up with the idea of assembler.
  • In assembler we write programming codes for Microcontrollers in assembly language then function of assembler is to convert that assembly language code into machine language and create the hex file and then we upload that hex file in our Microcontroller. But, if you have worked on assembly language then you must have the idea that assembly language is also not much easy and you have to write a lot of code just to perform a simple task and then researchers did some more work and finally they invented compilers. (Thanks a lot to them :D )
  • Now in those compilers, we write our code in C Language and then these compilers convert those C Language codes into machine language and we get our hex file which is then uploaded in any microcontroller like PIC, Atmel, 8051 Microcontroller etc.
  • Using compilers, the programming has become quite easy, we have ready to use libraries in these compilers using which we can do complex to complex tasks in just 2 to 3 lines.
  • Now in different compilers the back end generated machine code is almost same but the front end C coding syntax is quite different. For example if you are working on LCD then it has different commands for printing in different compilers. So, that's why I mentioned earlier that if you are working in one compiler then switching to another compiler is quite difficult as in that case you first have to learn the syntax of that second compiler.
  • There are lots of C Compilers available in market using which we can quite easily write our programming code. For different microcontrollers there are different compilers and today, I am going to share compilers for PIC Microcontroller. So let's get started with it.
Here's the list of PIC C Compiler,which we are gonna discuss in detail below:
  1. MPLAB C18 Compiler
  2. MikroC Pro for PIC
  3. CCS Compiler

Top 3 PIC C Compiler

As the topic indicates, today I am going to share top 3 PIC C Compiler. These compilers are best compilers for PIC Microcontroller. I have worked on all 3 of them and that's why I have quite an idea that all of them are best compilers. They have their pros and cons but still you can work on any of them. You can say this list is a result of my 5 years hard work. :) So, let's get started with them:

1) MPLAB C18 Compiler
  • MPLAB C18 compiler comes at top in the list of top 3 PIC C Compiler as its the best one in the series. MPLAB is an official software developed by Microchip for PIC Microcontroller.
  • It is free to use and you can download it from official site of Microchip.
  • First of all, you need to install the MPLAB software so you should read How to install MPLAB software in Windows.
  • Once you installed the MPLAB software, then you should install the MPLAB C18 Compiler so you should read How to Install MPLAB C18 Compiler in Windows.
  • In MPLAB you can work on assembly language as well but using the C18 compiler you can write your code in C Language.
  • MPLAB is the most flexible compiler for PIC Microcontroller as you can do anything in it with you PIC Microcontroller. But its a bit difficult to learn and program as in MPLAB you have to set every bit on your own.
  • When I started my programming career, then I first started working on this compiler as I like it the most.
  • So, if you want complete grip on your project then this is the compiler for you.
  • If you are interested in working on this compiler then you should also read Getting started with MPLAB software.
2) MikroC Pro for PIC
  • MikroC Pro for PIC comes at second place in my list of top 3 PIC C Compiler.
  • Its not free but has a student version using which you can compile your up to some limit. If the size of you code exceeds that limit then you can't compile your code using it.
  • Its also one of my favorite compiler because of its easiness and user friendly environment.
  • MikroC has a long list of built in libraries using which you can quite easily perform your tasks.
  • Its not much flexible but is very user friendly, it gives you all the setting in hand and you can set them just by clicking some combo boxes.
  • These days, I am working on this compiler because its easy to use and you have a great team at its back which gives you great support. So, if you ask me then I will recommend this PIC C Compiler.
Note: Here are few projects designed in MikroC Pro for PIC Compiler:
3) CCS Compiler
  • CCS Compiler comes at third place in PIC C Compiler list.
  • I have used it in some projects where there was a restriction to use this compiler.
  • Its a bit difficult to learn and program because of its pure C style syntax but also has a great list of libraries with it.
  • If you have already worked on C Compiler for windows then I think this one is best for you as the syntax is almost similar and you can learn it easily.
That's all for top 3 PIC C Compiler. I hope you have learn something out of it. Let me know if you have any comments and I will reply you.

Top 10 PCB Design Software

Hello friends, hope you all are fine and having fun with your lives. Today, I am going to share an informational tutorial about top 10 PCB design Software. These PCB design software are used for designing PCBs. In all engineering projects especially related to electronics, PCB designing is an important task and in order to design the PCB we have to use some software. There are many software available in market and today, I am gonna give a complete list of PCB Design software.

Few of these software and free to use and few have limited versions available but in order to get their advanced features you have to buy them. I have also mentioned their features below. If you have read my blog in detail then must have the idea that I use Proteus software for designing my PCB boards. So, if you ask me then I will recommend Proteus software as you can simulate your circuit design in it as well along with PCB designing. I have also used Eagle software for PCB designing and its also quite easy and rich with features. Anyways let's get started with top 10 PCB Design Software

PCB Design Software - Basics

There are few things, which you must remember before starting your PCB design. When you start your project, never jump directly to PCB designing. Instead, you must first design your circuit on wero board or bread board and then test it out. Once you confirmed that all features of your project are working perfectly, then you should move to designing part. If you started the PCB design at first then there's a chance that you miss something in your hardware and then your PCB boards will simply go to waste. So, first design your hardware temporarily adn then test its working and then design your PCB board. You can also simulate your circuit design on some software before designing its PCB. Anyways its up to you. When I design any project then I first design hardware on wero board and then once its perfect then I design its PCB board. Anyways, now let's have a look at top 10 PCB Designing software.

1 Altium

Altium is at first rank in my list of PCB Design software. You can get this software from their official site. Altium is used for designing PCB boards, you can design PCB of any layer in this software. Its very powerful and has a long list of tools for editing or designing your PCB board. Its a paid software and you can buy ti easily from their official site, whose link I have posted above. You can also create the component list, BOM file etc in this software. You can also design flexible PCB designs in it and can also check their 3D simulator to know about the final shape of your PCB baord.

2 Eagle

Eagle is another great PCB design software which comes after Altium software. Its also quite powerful and has great list of tools for designing your PCB board. Eagle is the most commonly used PCB Design software as its easy and quite flexible in its features. Eagle has quite a lot of support available online in forums as its quite an old software. It also provides the component list and the BOM file etc.

3 Proteus

This one is my favorite PCB Design software and if you have read my blog then you must have the idea how much i like this software. In Proteus you not only design your PCB boards but also can simulate your complete circuit design. When I design a PCB board then I first design its simulation in Proteus and then I move on to designing its PCB board. It also has quite flexible tools using which you can design your PCB board and then can also check its 3D design.

So, if you ask me then I will recommend you Proteus software for PCB designing. If you wanna start working in this software then you must read How to do PCB designing in Proteus ARES. I have also shared a the PCB design of Arduino UNO baord which you can also download from this link.

4 Fritzing

Fritzing is another tool used for designing PCB boards. I like its interface. It has quite attractive and user friendly interface and you can design your PCB layout in it quite easily. But drawback of fritzing is that its not professional software, it has quite small list of components available in it so I never thought of using this software for PCB Designing. But if you have simple designing then give ti a try, you are gonna like it.

5 TinyCAD
TinyCAD is also used for PCB Designing. and is quite famous. It also has a long list of tools for designing your PCB boards. Its quite similar to Eagle software and is easy to learn and operate.
6 ZenitPCB
When discussing PCB Design software, then how can we forget ZenitPCB. It also a great PCB Design software which is used for PCB designing in quite efficient way. Its easy to use and has a user friendly interface.
7 ExpressPCB
ExpressPCB is also a cool tool for design your PCB boards. Its good for new users as its easy to use and learn. You can  learn this software just by watching its single video. Its too easy to get started with and have a cool and user friendly interface.
8 KiCAD
KiCAD is an open source software which you can easily download online and is also free to use. Using this software you can design PCB boards up to 16 layer quite easily. It is rich with PCB designing features and can handle complex designs quite easily.
9 DesignSpark PCB
DesignSpark PCB software is also another great tool in the list of free PCB Design software. Its also a flexible software with a lot of tools and options for PCB designing. You are gonna like this one if you need quick and easy PCB designing.
10 EasyEDA
EasyEDA is also used for design PCB boards. It also has a user friendly interface and is good for first time user as it has everything in front and one can design PCB boards quite easily in it. You can also design multi layer PCB boards in it. It has small database of components that's why you have to design your components on your own while using this PCB design software. That's a long list of PCB Design software. These all software are quite easy to use and anyone can work on them just after a little training. So, you can select any of them for designing your PCB boards. If you ask me then I will recommend Proteus and Eagle software as I use the for designing my PCB boards.
Syed Zain Nasir

I am Syed Zain Nasir, the founder of <a href=https://www.TheEngineeringProjects.com/>The Engineering Projects</a> (TEP). I am a programmer since 2009 before that I just search things, make small projects and now I am sharing my knowledge through this platform.I also work as a freelancer and did many projects related to programming and electrical circuitry. <a href=https://plus.google.com/+SyedZainNasir/>My Google Profile+</a>

Share
Published by
Syed Zain Nasir