Button Control in VB Database

Hello everyone, I hope you all are fine and having fun. In today's tutorial, we are gonna have a look at How to add Button Control in VB database 2010. I have posted the first part of this tutorial few days ago in which I have shown that How to Create a Database in Microsoft Visual basic 2010. If you have missed that part then you can't understand the today's lecture. Today we will continue with the same application which we created in the last part and will add few new features in it. Creating database is difficult but adding features in it is very easy job and its also a must requirement of the application because user wants an easy control of application. So in order to make the application user friendly its necessary to add few features in it. In the next post, I have discussed How to Update Database Table with Programming in VB 2010. I have divided this project or tutorial into few parts, as covering the whole database topic in one tutorial is not possible. If any of you have any problem in any part,ask in comments. So let's get started with Button Control in VB Database.
  • In the last part of this tutorial, we have created a database application shown in the below figure:
  • In today's lecture we will add few new features in the above application and at the end of today's lecture, the above application will looks like this.
  • You can see in the below figure that now we have Button Control in VB Database.

Step 1 : Add, Save & Remove Buttons

  • First of all open the application which we created in the previous part of this tutorial.
  • Now add three buttons on it as shown in the below figure :
  •  Now click the button 1 and change its name from properties to Add, button 2 to Save and button 3 to Remove as shown in figure below.
  •  We have added buttons and also changed their names according to our requirement, now we are gonna add functionality in these buttons i.e. what function they perform when someone click them.
  • Double click Add button and put this code in its function.
 Try Me.Contact_FormBindingSource.AddNew() Catch ex As Exception End Try
  • Now double click Save button and add this code in its function.
  Try Me.ValidateChildren() Me.Contact_FormBindingSource.EndEdit() Me.TableAdapterManager.UpdateAll(Me.ContactsDataSet) Catch ex As Exception End Try
  • Now double click the Remove button and add the following code in its function.
Try Me.Contact_FormBindingSource.RemoveCurrent() Catch ex As Exception End Try
  • Now run your application and if everything's fine then when you click Add button, a new line will appear in the database where you can enter the next contact. After adding the contact, when you click on the Save button software will automatically save the contact in database and if you click the Remove button then the selected entry in database will be deleted.

Step 2 : Next & Previous Buttons

  • Now add two more buttons from toolbar, just under these three buttons as shown in the figure below:
 
  • Change their names to Previous and Next as shown in image below:
  • Now double click the Previous button and add the below code in it.
Contact_FormBindingSource.MovePrevious()
  • After that double click the Next button and add the below code in its function.
Contact_FormBindingSource.MoveNext()
  • Now run your application and when you click the Next button the selection in database will move downward i.e towards the next entry and when you press previous it will move upward i.e towards the previous entry.

Step 3 : Move To Top & Move To End Buttons

  • Now again add two more buttons as shown in the figure below:
  •  Remove Button1 to Move To End and Button2 to Move To Top as shown in below figure:
  •  Now double click on Move To End Button and insert the below code in it.
Contact_FormBindingSource.MoveLast()
  • After that double click on Move To Top button and add the below code in its function.
Contact_FormBindingSource.MoveFirst()
  • Now run your application, and check the working of these two buttons. When you click Move To Top button the database will rolled up and you will reached the first line and vice versa for second button.
Okay friends that's all about Button control in VB Database, and I really got tired. Level of today's post is intermediate but its really important as in the next chapter of this tutorial we are gonna move into pro level so if you don't practice it you wont get the next chapter. Okay I gotta go. Stay Blessed. Take care. Note :
  •  This software along with code has already been emailed to all the subscribed members. If someone didn't received it then post your email in the comments and i will send it to you.
  • if someone wants this software along with the code then subscribe to our email newsletter and it will be automatically emailed to you.

Roots of Quadratic Equations in MATLAB

Hello friends, hope you all are fine and enjoying good health. In today's tutorial, I am going to share How to find Roots of Quadratic Equations in MATLAB. It's quite a quick tutorial in which I will give you the code and will explain it a little. Benefit of this project is that when you are learning MATLAB then you must design such small codes so that you know more about the behavior of MATLAB.

Today two of my juniors came to me for a simple MATLAB term project. It's quite an easy project but i thought to share it for those students who are dealing with basics of MATLAB. Mostly such projects are offered to students in first or second semester when they have very basic knowledge of MATLAB coding and they feel helpless while solving such problems as is the case with those two students. So, let's get started with How to find Roots of Quadratic Equations in MATLAB.

Roots of Quadratic Equations in MATLAB

  • This finding Roots of Quadratic Equations in MATLAB takes three inputs from user.
    • Variables of Quadratic Equation.
    • Domain limit.
    • Variable to choose whether to show roots of the equation or minimum of function or both.
  • After taking these inputs the function calculates the roots of the quadratic equations.
  • After that finds the minimum of the function within the domain limit.
  • And finally show both of them on the graph.

Code of the Project

MATLAB is  a really amazing tool and I really love to do coding in it.The code for this project is given below. I didn't give description of the code because its a simple project and second thing I want the young students to search these commands themselves so that they could learn something. Second thing MATLAB has a very strong help section, if you are having problem with any command simply enter doc [Command] or help [Command] in the main window and MATLAB will give you everything you need related to that command. Here's the code :
%==== Code Starts Here(www.TheEngineeringProjects.com) ==== clc clf % ============ Taking Inputs From User ============== handle = input('Enter the handle of the function : '); limit = input('Enter the domain limits : '); initial = input('Enter the initial solution estimate : '); k = input('Enter 1 for min, 2 for roots & 3 for both  : '); syms x; a1 = 100000; %====== Calculating Roots of the Quadratic Equation ========= func = @(x)handle(1,1)*x^2 + handle(1,2)*x + handle(1,3); root1 = (-handle(1,2) + sqrt((handle(1,2)^2)-(4*handle(1,1)*handle(1,3))))/(2*handle(1,1)); root2 = (-handle(1,2) - sqrt((handle(1,2)^2)-(4*handle(1,1)*handle(1,3))))/(2*handle(1,1)); roots=[root1,root2]; %====== Calculating Minimum Value Within Domain Limits ========= for x = limit(1,1):0.1:limit(1,2) a = func(x); if (a < a1) a1 = a; x1 = x; end if(k==1 || k==3) plot(x,a,'--rs','LineWidth',2,... 'MarkerEdgeColor','k',... 'MarkerFaceColor','g',... 'MarkerSize',10) hold on; end end min = a1; %====== Displaying Roots & Minimum Values ========= if ( k == 1) min end if ( k == 2) roots plot(x,root1,'--rs','LineWidth',2,... 'MarkerEdgeColor','k',... 'MarkerFaceColor','r',... 'MarkerSize',10) hold on; plot(x,root2,'--rs','LineWidth',2,... 'MarkerEdgeColor','k',... 'MarkerFaceColor','r',... 'MarkerSize',10) end if ( k == 3) min roots plot(x,root1,'--rs','LineWidth',2,... 'MarkerEdgeColor','k',... 'MarkerFaceColor','r',... 'MarkerSize',10) hold on; plot(x,root2,'--rs','LineWidth',2,... 'MarkerEdgeColor','k',... 'MarkerFaceColor','r',... 'MarkerSize',10) end %==== Code Ends Here(www.TheEngineeringProjects.com) =======

Test Input

  • For the testing purposes, use the below values as a testing input :
  • First input  = [1 5 6]
  • Second input  = [-1 1]
  • Third input = 0
  • Fourth input = 3
  • The Code is self explanatory but if anyone having any problem in it may ask in comments.
That's all for today. I hope you now have the idea How to Find Roots of Quadratic Equations in MATLAB. I will meet you guys in the next lecture. Till then take care.

Create Database in Microsoft Visual Studio

Hello friends, hope you all are enjoying good health. Today, I am going to share How to create a Database in Microsoft Visual Studio 2010. Around two to three months ago, I have shared a topic on Microsoft Visual Basic 2010 - Com Port  in which I have explained completely how to make the serial communication in Microsoft Visual studio using visual basic language. Today I am going to share another complete tutorial on how to create a database in Microsoft visual studio. Its a most common project in computer science which usually students do as a semester project, so I thought of sharing it here. I have divided this project or tutorial into three parts, today we will just create a simple database in which we can add out objects easily and later on we will add few functionality in it. In this tutorial we are going to create a database driven application. In this tutorial we are going to create a simple contact form database. Simply follow these steps. I have also posted How to add Button Control in VB Database  and How to Update Database Table with Programming in VB 2010. You must read them as well if you are planning to work on VB database. So, let's get started with creating a Database in Microsoft Visual Studio 2010.

Creating a Database in Microsoft Visual Studio 2010

  • I have tried my best to make this creation of database in Microsoft Visual Studio as simple as possible, that's why I have added screenshot of each step with commenting but still if you guys have any problem at any step ask in comments. At the end of this tutorial, we will create a database driven application as shown in the figure below:

Step 1 : Creating New Project

  • First of all open the Microsoft Visual Studio 2010 and click on the New Project as shown in figure below:
  •  After clicking it, the below screen will show. Now, choose the language and the project type and then give this project a name and click OK. In our project I am using Visual Basic language and project type is Windows Form Application.
  •  It will create a new project for you, where we are gonna add the database.

Step 2 : Creating a Database

  • Now we are gonna create a database in our project.
  • For this first go to the Solution Explorer in your project.
  • Now right click on your project name and then click on Add and finally click on New Item.
Note :
  • If you can't find it click on View in the above menu tab and then click on Solution Explorer.
  • If you can't find the Solution Explorer then click on View in the above menu tab and then click on Solution Explorer.
  • After clicking on New Item, a list of items will open up as shown in below figure. Now from these select the Service Based Database. Give it a name like I gave it Contacts.mdf and then click on Add.
  •  That's now gonna open up a data source wizard as shown in below figure. Just cancel it for now as we don't have anything right now to add in our database.
  •  Now our database has been created which you can also see in the solution explorer but rite now its empty, so now in the next step we are gonna add a table in our database.

Step 3 : Creating a Table

  • Now, double click on the database which we just created in the step 2 and named it Contacts.mdf. (You will find it in Solution Explorer)
  • Double clicking the database will open up Server Explorer.
  • Now in the Server Explorer, right click on the Tables and then Add New Table.
  • Now, it will open a Table where we will add the Columns Name of our Table.
  • I have given the first Column as ColumnID and Data Type is int and unmark the Allow Nulls Option.
  • Now click on the Primary Key as shown in below figure.
  • After that go in the properties of table and click on Identity Specification to expand it.
  • Now change the option from No to Yes.
  • I have done this to make it auto incremented, now as you add the data in it the ContactID will be incremented on its own showning you the total number of data present in the Table.
  •  Now quickly fill the other columns name as shown in below figure, you can choose any data type you want but I have choosen varchar(50).
  • Now click on Save button to save the table and it will ask for the table name.
  • Give the table name and click Ok.
  • Now close this tab.
  • Now our table has been created, in the next step we are gonna add some data in the table.

Step 4 : Adding Data in the Table

  • In order to add data in the table we just created, go to Server Explorer and Expand the Table Section.
  • In the Table Section, you will get your table which we created in the Step3.
  • Right Click on the Table which we named Contact Form and then Click on Show Table Data.
  •  It will open up the Contact Form data table. Now fill the few lines as you can see I have added few info in it and then click Save.
  • It will ask for the name, remain the name as it is and click Save.
  •  Uptill now, we have created our database and then we created a table and added some data in it.
  • Now we are gonna attach a data source with our database in the next step.

Step 5 : Attach a Data Source

  • Now we need to attach a data source with our database.
  • For this first click on Data and then Add New Data Source as shown in below figure.
  • Now it will open the data source configuration wizard. Select the database and click on Next.
  •  Again click on the Next as shown in below figure.
  •  Now we need to attach this data source with the database which we created in the Step 2, so select the Contacts.mdf database and click Next.
  •  Now it will ask for the components you want to add in your data source.
  • Click on the Tables to expand and the select Contact Form, this is the table which we created in step 3.
  • Now click Finish.
  •  Now we have created our data source which contains the table. In the next step we are gonna add this database on our form so that we can use it easily.

Step 6 : Adding Database on the Form

  • Now go to the Data Source, if you cant find it then open it from Data tab in the top menu.
  • Now click on the Contact Form (which is our table) and drag it to the Form Board as shown in the below figure.
  • Now re size it using the mouse according to your form.
  • Next click on the Contact Form in the Data Source and select Details, it will give us detail view of our database.
  •  Now again click the Contact Form and drag it in the Form Board and it will show like detail view as you can see in the figure below.
  •  We have add the both views on our board. Now run it and your project will open up.
  • Now you can add or delete or edit any column and then save it.
  •  So the final form of our project is something like that.
  • You can see the above bar where are options to add, delete or move forward, backward etc.
  • In the next tutorial we will add some functionality in it like adding new column with button and save etc.
  • Hope you guys enjoyed it. If someone needs this database in Microsoft Visual studio along with the exe file of this project then Subscribe Us via Email and post your email in the comments and we will email it to you.
That's all for today, and I hope you guys are not familiar with How to create Database in microsoft visual studio 2010, will meet you in the next tutorial, till then take care ALLAH HAFIZ. :))

Protect Simulink Design in MATLAB

Hello friends hope you all are healthy and enjoying good health. In today's tutorial, I am going to share How to Protect Simulink Design in MATLAB and in order to do so I have used S Function method. In my previous post I have explained How to Protect your m-file Codes in MATLAB by converting it to p-file so that no one can reach to your code and now I am gonna explain how to protect your simulations in MATLAB which you create in Simulink so that your intellectual work wont go waste.There are many methods to protect the Simulink simulations and the easiest of them is using S-function. Now follow these simple steps and it won't be much difficult.

Protect Simulink Design in MATLAB

  • Open the simulation which you want to protect. Make sure you are done with the simulation and don't need any more editing. As after conversion you wont be able to edit it.
  • Now select whole of your simulation and right click on it.
  • Click on the Create Subsystem in right click listing.This will create a single block for your whole system.If you double click click this block a new window will pop up and you can see your whole model again.
  • Now right click on this newly created subsystem block and then in the listing click on Real Time Workshop and the Generate S-Function.
  • On clicking a new window will pop-up add variables if you want to control any otherwise just tick the corner which says Use Embedded Coder and hit Build.
  • It will take few seconds to build the S-function for your simulation and when its done Hurrah your simulation is now protected.
  • Now double click on your subsytem and you won't be able to open your design, instead a window pops up which will give some description.
  • You can add the complete description while generating your simulation.
  • Now start your simulation , it will work fine but no one could find your design.
Note :
  • This method is mostly used by the developers to protect their simulations.
  • Users can use their simulation but couldn't get the design of it, the design got fully protected.

Convert m File into p File in MATLAB

Hello friends, I hope you all are doing great. In today's tutorial, I am going to show you How to Convert m File into p File in MATLAB. Now the question arises that why we need to do that? & the answer is if you want to protect your code and don't want anyone to access it then you need to your Convert m File into p File. P File is like an encrypted file which performs the same functionality as your original m file but no one can get the code out of it. Like me explain it with an example, suppose you are some sort of developer and you have created some code for a company and now you want to protect your code and just send the company some sort of software. MATLAB has a function in which you convert your m-file into p-file and no one can open that p file code. P-file functionality is as same as of m-file but no one can check what's inside p-file.

Convert m File into p File in MATLAB

  • Suppose you have created your m-file and you are now want to protect your code and the send the rest to your employer so that he can use it without knowing the code inside it.
  • Use these command to do this :
pcode(fun) pcode(fun1,...,funN)
  • If fun is the name of the m-file then MATLAB will conver the fun.m to fun.p and create it in the same folder.
  • If fun is the name of the folder then MATLAB will convert all the m-files within that folder into p-files.
  • If you want to convert more than one m-file into p-file then use the second code and place all the m-files there.
  • You can also convert more than one folder using the second command.
So, that's all for today. In my next post I will tell you a way of protecting your simulink model in the same way as we protected our m-file. Till then take care & stay blessed .... :))

Difference Between AC and DC Power

Hello friends, I hope you all are fine and having fun. In today's tutorial, I am going to share the difference between AC and DC Power. In our everyday life, we have noticed many times about AC and DC but very few of us know exactly the difference between them, and this is mostly the favorite question of interviewer, so today we will see their difference.Electricity is basically a type of energy, which  is produced or generate because of movement of electrons within any conductor. This movement of electrons can be in one direction only or they can also move in two directions. On the basis of the movement of electrons, we get two types of electric energy, one is called Direct Current (DC) and other one is Alternating Current (AC). You should also have a look at Difference Between AC and DC Motors.Lets check Difference Between AC and DC Power in detail one by one:

Direct Current (DC)

  • Direct Current originate because of movement of electrons in a conductor in one direction.
  • In DC case, electrons don't change their direction and keep on moving in one direction.
  • A magnetic field near a wire causes the electrons in the wire to flow in one direction along the wire. The reason of movement of electrons is because they are repelled and attracted by the poles of the magnet.
  • DC current was invented by Thomas Edison.
  • DC batteries we use in the cars based on this phenomena.

Alternating Current (AC)

  • When electrons in a conductor moves in two directions than AC current generates.
  • AC current was invented by Nikola Tesla , a Serbian scientist.
  • Instead of applying the magnetism along the wire steadily (in one direction), he used a magnet that was rotating.In other words changing its direction.
  • When the magnet was oriented in one direction, the electrons start to flow towards positive direction and when magnet oriented in opposite direction, they begin to move in opposite direction.
  • That's the reason alternating current keeps on changing its polarity.
The Question is ???
  • Now the question arises that when we had Direct Current , then whats.'s the need of Alternating Current ???
  • Answer to this question is DC stores very low energy that's why we can't use it for long distances but the AC current can easily move to very long ranges.
  • You have observed that all those thing where we need current just on the spot we use DC, such as in the cars. We are generating DC and using it at the same spot.
  • But when there's a need to send energy at long distance we use AC such as in our house, all the energy coming from Power Plant to our houses is AC.
Note :
  • There is also a limit of range for AC and for that reason we use transformers, which acts as a recharger and makes the energy of AC high again.
So, that's all about Difference Between AC and DC Power. I hope you guys got something out of it. Let me know did you like it. Thanks.

Difference Between DC and AC Motors

Hello everyone, I hope you all are fine and having fun with your lives. In today's tutorial, I am going to share a Difference Between DC and AC Motors. Both of these motors are used almost in every kind of robotic projects and if we talk about engineering projects then they are used in like 70% of the engineering projects.There are two main types of motors. Both are electrical motors named as :
  • DC Motors
  • AC Motors
You should also have a look at Difference Between AC and DC Power. So, let's get started with Difference Between DC and AC Motors:

1. OperatingSource

DC Motor
  • DC motor operates on DC (Direct Current) and converts the electrical energy into mechanical energy.
AC Motor
  • DC motor operates on DC (Direct Current) and converts the electrical energy into mechanical energy.
Its actually the main common difference between them which also depicts in their names.

2. Main Types

DC Motor
  • DC Motor has two main types named as :
    • Brushless DC Motor
    • Brush DC Motor
AC Motor
  • AC Motor is divided into three main types :
    • Single Phase Motors (Also named as General Purpose Motor)
    • Double Phase Motors
    • Triple Phase Motors
  • They are further classified as :
    • Synchronous AC Motors.
    • Induction AC Motors.

3. Basic Working Principle

DC Motor
  • A simple DC motor contains a coil of wire that can rotate in a magnetic field provided by the permanent magnets.
  • So when the coil placed in the magnetic field is provided with the current, a force is exerted on this coil which can be find by the Flemming's Right Hand Rule.
  • This force generates a torque in the coil and the coil starts to rotate in the magnetic field as shown in the image below :
  •  The current is provided to the coil through the brushes which are in contact with the split rings.
  • The force produced in the coil of length 'L' placed in the magnetic field 'B' carrying a current 'i' is equal to iLBsin(theta) , where theta is the angle between 'B' and 'i'.
Function of Split Rings :
  • When the coil surface comes in horizontal with the magnetic field, we can see that now torque becomes 0 , because current is zero at this point and also the brushes comes in the gap between split rings.
  • At this point, no current is provided to the coil but coil still continue its motion because of its momentum and then again split rings come in contact and the process continues.
AC Motors
  • AC motor works on the same principle as I have described for the DC motor, the only difference lies in the split rings.
  • For AC motors we use continuous rings as shown in image below, they doesn't block the current and the current can move in both directions easily.
  • Moreover, in most of the AC motors armature remains stationary and the magnetic field keeps on rotating.

4. Applications

DC Motors
  • DC Motors are used where you want to controlled speed.
  • It doesn't provide high energy so its used mostly where low energy is required.
AC Motors
  • AC motors provide high energy that's the only reason AC motors are mostly used in industries.
  • We can't control the speed of AC motor.

A Newly Launched Thread - Difference Between

No. Difference Between
Give Your Suggestions !!!
1. DC and AC Motors
2. AC and DC Power
Hello friends, today we are going to start a new session in our site. This session is named as Difference Between. In this session, I am gonna give a difference between any two things which are of same nature. Like Difference between DC motor and AC motor. Their function is quite the same but their working is different and most of the people don't know much about it. Let's have a look why I am starting this thread and how you guys can help me to improve it.

Why am I starting This ???

There are many reasons of starting this thread.
  • First of all, these are the most commonly asked questions during the vivas.
  • Moreover, mostly during job interviews, these kind of questions are asked.
  • Its a general behavior of human mind that the difference thing is much captured by it than a simple plain topic.
  • You guys have noticed that when you read some difference between two things, it lasts in memory much longer than a simple tutorial on any topic.
  • So, these are the few things because of which I am gonna start this thread.

Where you can access it ???

  • I am gonna make a tab above in which I will post all the topics so that you guys can access easily.
  • Moreover, I am working on adding a google search to our blog because I am getting these complaints that user can't search the site

Your Role ???

  • If you are confused about any topic, then you can contact me and I will try to post on it as well.
  • One important thing, I am open to suggestions, so if anyone have any kind of idea in his/her mind, let me know about it , I will be really obliged.
  • I am also thinking of adding some admins to our site, so if you think you have knowledge then contact me asap.
At the end, I would like to thank my friend Adnan because of whom this idea hit me. .... :))

Create Setup File in Visual Studio 2010

Hello friends, I hope you all are healthy and having fun. Today I am posting a simple tutorial in which I will show you How to Create Setup File in Visual Studio 2010. Actually I got a request from one of our members to post this tutorial, he was having some problems in it, so i thought to share it. In my previous tutorial How to use Serial Port in VB 2010, we have designed a simple tool, now what if I want to create an exe file so that I could easily share my tool with my friends, without giving them the access to my code. So, in today's tutorial, we are gonna have a look at How to create exe or setup file in Visual Studio 2010. No one can get your code from the exe file so its like your code is safe but anyone can use your software. These days I am planning on designing such small free tools, which I think will help our readers and we can add our logo for free publicity. In simple words, there are numerous uses of giving professional look to your software by creating its exe or setup file. So, let's get started with How to Create Setup File in Visual Studio 2010:

Why you Need to Create it ?

  • Suppose you have created your software on Visual Studio 2010 and now you want to use that software on any other computer.
  • So to do this, there's no need to copy whole code and create project in the second computer.
  • Instead just create executable (.exe) file of that software and install it on other computer.
  • You can also publish your software online on your blog etc.
Now follow these simple steps carefully in order to Create Setup File in Visual Studio 2010:

Create Setup File in Visual Studio 2010

  • Complete your software and test it to confirm that its ready.
  • Now click on the Project in your Top Menu Bar and at the bottom click on Properties.
  • CNC Gcode is actually the name of my software as shown in image below :
  •   After clicking on properties a new tab will open as shown in image below :
  •  These are actually the properties of our software, like you can change the icon and can also do many other things.
  • Right now we are not changing anything but if you want you can play with its properties.
  • Now click on the Publish button at the bottom and the below screen will appear.
  • Now click on the Publish Now button and it will create the .exe file of your software.
  • You can change the location of the file where it is gonna store in the properties.
So, in this way you can quite easily Create exe File or Setup File in Visual Studio 2010. If you got into any trouble then ask in comments and we will try our best to help you out. So, that was all for today, will see you guys in the next tutorial. Till then take care and have fun !!! :)

Modified Sine Wave Design With Code

Hello guys, I hope you all are doing great. In today's tutorial, I am gonna give you a detailed introduction of Modified Sine Wave Inverter with code. In this inverter series, I have first explained the Basics of Inverters with Topology in which we have seen the Introductionof inverter and its different types. After that, we have discussed the Major Components of Inverter which are essential for its designing. Now in today's post, I am gonna explain the modified sine wave inverter. I have used AVR microcontroller in this project. Before starting on modified sine wave inverter, you should also read this Pure Sine Wave Inverter. I tried my best to keep it simple but still if you guys got stuck at any point ask in comments and I will remove your query. 

Modified Sine Wave Inverter

  • Modified sine wave inverter gives an output which is intermediate between the square wave and pure sine wave.
  • Its actually a sine wave, which has a lot of steps.
  • Let's have a look at the below figure:
  • In the above figure, the red wave is a pure sine wave and the green signal is a square signal but the blue one is in between and its called modified sine wave.
  • Here's a modified sine wave in MATLAB, I have designed it for another project but it will clear the idea How Modified Sine wave looks.
  • Modified sine wave has much lower efficiency than the pure sine wave.
  • The circuit diagram of a modified sine wave inverter is shown below:

Explanation.

  • For a modified sine wave inverter we need two inverted square waves signal to switch the MOSFETs. Two generate these signals we use HEF4047 multi-vibrator IC.
  • We use it in a-stable mode. It gives a buffered output so there is no need for impedance matching between TTL based ICs and CMOS based ICs.
  • In a-stable mode it generates square wave of exactly 50% duty cycle at its pin 10 and gives its inverted signal on pin 11.
  • It also generates frequency double to that of pin 10 at pin 13. It can be done by using 0.2µF capacitor and a 7.6KO resistor as mentioned in its datasheet to generate frequency of 500Hz at pin 13.
  • From pin 13 we give a signal to HCF4017 IC as a clock. HCF 4017 is a decade counter with 12 outputs. It is used to generate a 50Hz signal with controlled delay at both positive and negative edge. Pins 1, 5, 6, 9 and pins 2, 4, 7 are used as output.
  • All other outputs are grounded as CMOS ICs are very sensitive and even a small stray signal can burn them out.
  • The output of HCF4047 is about 1v, which cannot be used to drive MOSFETs so the signal is amplified by using BC-547 as an amplifier (connected in common emitter biased configuration.
  • This signal is again amplified and inverted. The signal obtained is a controlled PWM which we now give at the MOSFET gates.
  • The block diagram of the modified sine wave inverter module is given below:
 

Working

  • We gave a PWM signal to the pair of MOSFET connected in a push pull configuration.
  • When M1 MOSFET is turned on by a high input (Q), the M2 MOSFET turns off at that time because on its input we had given an inverted signal (Q ) with some delay.
  • This delay is used so that one of the MOSFETs gets time to turn off before second one turns on.
  • In this mode, the current flows from source to MOSFET M1 as shown in figure.
  • When Q1 goes low Q becomes high and M2 turns on, resulting in a current flowing from source as shown in diagram by I2.
  • Thus, we get a bipolar high voltage output at the transformers secondary.
  • The 22kO resistor from Gate to the source as shown in the diagram is important because when the input signal goes to zero, the MOSFETs may not completely turn off because of the capacitance between gate and source so this resistance makes sure that signal is fully grounded.
  • The threshold voltage to turn on a MOSFET is approximately 4V. We are driving MOSFETs with 12v signal so that MOSFETs is completely turned on otherwise it will result in power dissipation.

Results

FIGURE 4 : Delayed inverted output

Problems

  • In power inverter, shoot through current is a major problem and needs to be solved.
  • It is a short circuit current, and as described in the previous topic, occurs when both MOSFETs are on. This happens for a very short time i.e. for some Nano-seconds.
  • But eventually it results in a short circuit current, which causes loading and thus it may damage the MOSFETs.
  • This situation can be avoided by introducing a dead time between the two signals both at rise and fall edge.
  • If the dead time is increased too much, the output voltages drop because MOSFETs are turned ON for a very short time.
  • Finally impedance matching is an important factor.
  • Transformers output impedance (Secondary) should be low so that minimum voltage drop occurs when we connect any load to with it.
So, that was all about Modified Sine Wave Inverter Design. I hope you will like it. Have a good day !!! :)
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